mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
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:
@@ -1049,6 +1049,16 @@ func TestSessionIDTracking(t *testing.T) {
|
||||
"User-Agent": []string{"Zed/0.219.4+stable.119.abc123 (macos; aarch64)"},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "opencode",
|
||||
fixture: fixtures.AntSimple,
|
||||
expectedClient: aibridge.ClientOpenCode,
|
||||
expectSessionID: "ses_15a48edefffe7oY0YcIHRv29dD",
|
||||
header: http.Header{
|
||||
"User-Agent": []string{"opencode/1.16.0 ai-sdk/provider-utils/4.0.23 runtime/bun/1.3.14"},
|
||||
"X-OpenCode-Session": []string{"ses_15a48edefffe7oY0YcIHRv29dD"},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
|
||||
Reference in New Issue
Block a user