Skip to content

Commit c6ba45e

Browse files
committed
chore: add support for Coder Agents sessions
Signed-off-by: Danny Kopping <danny@coder.com>
1 parent 77d597a commit c6ba45e

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
@@ -66,7 +66,7 @@ func guessSessionID(client Client, r *http.Request) *string {
6666
case ClientKilo:
6767
return cleanRef(r.Header.Get("X-KILOCODE-TASKID"))
6868
case ClientCoderAgents:
69-
return nil // Session ID support planned in a follow-up.
69+
return cleanRef(r.Header.Get("X-Coder-Chat-Id"))
7070
case ClientRoo:
7171
return nil // RooCode doesn't send a session ID.
7272
case ClientCursor:

session_test.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,13 @@ func TestGuessSessionID(t *testing.T) {
127127
},
128128
// Coder Agents.
129129
{
130-
name: "coder_agents_returns_empty",
130+
name: "coder_agents_with_chat_id",
131+
client: ClientCoderAgents,
132+
headers: map[string]string{"X-Coder-Chat-Id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"},
133+
sessionID: utils.PtrTo("a1b2c3d4-e5f6-7890-abcd-ef1234567890"),
134+
},
135+
{
136+
name: "coder_agents_without_chat_id",
131137
client: ClientCoderAgents,
132138
},
133139
// Roo.

0 commit comments

Comments
 (0)