From c6ba45efab3050c76920d8418b782f979a8946c0 Mon Sep 17 00:00:00 2001 From: Danny Kopping Date: Tue, 31 Mar 2026 16:09:05 +0200 Subject: [PATCH] chore: add support for Coder Agents sessions Signed-off-by: Danny Kopping --- session.go | 2 +- session_test.go | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/session.go b/session.go index afb6e1f7..1802be92 100644 --- a/session.go +++ b/session.go @@ -66,7 +66,7 @@ func guessSessionID(client Client, r *http.Request) *string { case ClientKilo: return cleanRef(r.Header.Get("X-KILOCODE-TASKID")) case ClientCoderAgents: - return nil // Session ID support planned in a follow-up. + return cleanRef(r.Header.Get("X-Coder-Chat-Id")) case ClientRoo: return nil // RooCode doesn't send a session ID. case ClientCursor: diff --git a/session_test.go b/session_test.go index 6ad9fc1b..4807f32c 100644 --- a/session_test.go +++ b/session_test.go @@ -127,7 +127,13 @@ func TestGuessSessionID(t *testing.T) { }, // Coder Agents. { - name: "coder_agents_returns_empty", + name: "coder_agents_with_chat_id", + client: ClientCoderAgents, + headers: map[string]string{"X-Coder-Chat-Id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"}, + sessionID: utils.PtrTo("a1b2c3d4-e5f6-7890-abcd-ef1234567890"), + }, + { + name: "coder_agents_without_chat_id", client: ClientCoderAgents, }, // Roo.