feat: track OpenCode sessions (#26128)

This follows #26098 by teaching AI Bridge to read OpenCode session IDs
from the X-OpenCode-Session header, so OpenCode requests are grouped
consistently in interception logs.

Adds unit and integration test coverage for the new header.

<details>
<summary>Coder Agents generated</summary>

This pull request was generated with Coder Agents assistance.
</details>
This commit is contained in:
Danny Kopping
2026-06-08 10:12:03 +02:00
committed by GitHub
parent 2211f9ce4b
commit 9afd3d0bea
3 changed files with 29 additions and 0 deletions
+2
View File
@@ -75,6 +75,8 @@ func GuessSessionID(client Client, r *http.Request) *string {
return cleanRef(r.Header.Get("X-KILOCODE-TASKID"))
case ClientCoderAgents:
return cleanRef(r.Header.Get("X-Coder-Chat-Id"))
case ClientOpenCode:
return cleanRef(r.Header.Get("X-OpenCode-Session"))
case ClientCrush:
return nil // Crush does not send a session ID header.
case ClientRoo: