currentSessionID returns this process's harness session id, or "" if not running inside any known harness. Probes every implemented harness's session-id env var and returns the one that's set.
()
| 19 | // if not running inside any known harness. Probes every implemented |
| 20 | // harness's session-id env var and returns the one that's set. |
| 21 | func currentSessionID() string { |
| 22 | if h := ambientHarness(); h != nil { |
| 23 | return os.Getenv(h.SessionIDEnvVar()) |
| 24 | } |
| 25 | return "" |
| 26 | } |
| 27 | |
| 28 | // currentSessionTask returns the task bound to this Claude session |
| 29 | // via tasks.session_id. Returns sql.ErrNoRows if the current session |
no test coverage detected