WorkBuddy and CodeBuddy name their conversation in X-Conversation-ID,
which sessionHeaders didn't list, so every WorkBuddy request had no
session: Routing put them all under "No session ID", and affinity, usage,
transcripts, OTel and a remote magpie lost the conversation too. The header
is appended last, so the aliases already read keep precedence, and the
vendor is never sent it.
Moved users are covered by the same line: the gateway gives a plugin the
session as ConversationHeader from conversationID(), plugins.go passes it
as FetchRequest.Session, and the WorkBuddy plugin derives its own
X-Conversation-ID from that. No plugin change is needed.
EdwinDigital's record (Windows ARM64, Go 1.26.8, temporary HOME):
- Removing only the alias makes TestWorkBuddySessionHeader,
TestWorkBuddySessionThroughGateway and TestRemoteMagpieKeepsTheSession
fail. They pass with -count=20.
- gofmt and git diff --check are clean. Windows go vet ./... and Linux
ARM64 go vet -tags nogui ./... pass.
- Installed WorkBuddy 5.8.2 (engine 2.161.0) ran against the patched
gateway and a loopback streaming mock. Two native sessions grouped 2+1,
with both titles resolved.
Review and run at this head (macOS, Go private cache, sandbox HOME):
- I read the patch line by line.
- The three tests pass. Commenting out the alias by hand makes all three
fail.
- gofmt -l is clean. go vet passes on darwin, linux -tags nogui and
windows.
- go test -tags nogui -count=1 -timeout 40m ./internal/gateway/: ok (811s).
Not tried by me: a real WorkBuddy or CodeBuddy client, and real vendor
calls. EdwinDigital ran WorkBuddy against a mock.