Skip to content

Commit a011104

Browse files
authored
chore: add support for Coder Agents sessions (#242)
_Disclaimer:_ _implemented_ _using_ _Claude_ _Opus_ _4\.6, reviewed by me._ Follow-up from coder/coder#23578 We still need to fake the initiator using the `X-Coder-Owner-Id`; that's implemented upstack. Validated manually using Coder Agents with an OpenAI-Compatible provider pointed at AI Bridge in my workspace.
1 parent fc40103 commit a011104

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

session.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ func guessSessionID(client Client, r *http.Request) *string {
7373
case ClientKilo:
7474
return cleanRef(r.Header.Get("X-KILOCODE-TASKID"))
7575
case ClientCoderAgents:
76-
return nil // Session ID support planned in a follow-up.
76+
return cleanRef(r.Header.Get("X-Coder-Chat-Id"))
7777
case ClientRoo:
7878
return nil // RooCode doesn't send a session ID.
7979
case ClientCursor:

session_test.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,13 @@ func TestGuessSessionID(t *testing.T) {
171171
},
172172
// Coder Agents.
173173
{
174-
name: "coder_agents_returns_empty",
174+
name: "coder_agents_with_chat_id",
175+
client: ClientCoderAgents,
176+
headers: map[string]string{"X-Coder-Chat-Id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"},
177+
sessionID: utils.PtrTo("a1b2c3d4-e5f6-7890-abcd-ef1234567890"),
178+
},
179+
{
180+
name: "coder_agents_without_chat_id",
175181
client: ClientCoderAgents,
176182
},
177183
// Roo.

0 commit comments

Comments
 (0)