Skip to content

Add Opencode GO Session Id - #833

Merged
TheGreatAxios merged 2 commits into
mainfrom
cl-7504-forward-x-opencode-session-for-opencode-go-console-go
Sep 8, 2026
Merged

TheGreatAxios merged 2 commits into
mainfrom
cl-7504-forward-x-opencode-session-for-opencode-go-console-go

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Collaborator

Summary

  • Forward the active Corbits session through OpenCode Go Chat, Responses, and Messages transports
  • Rebuild source options after /clear and /new session rotation without changing request bodies

Verification

  • Focused adapter and source propagation tests pass
  • bun run test passes
  • bun run typecheck and bun run build pass
  • bun run check reaches lint but fails on the repository's pre-existing lint warnings

Fixes CL-7504

@linear-code

linear-code Bot commented Sep 7, 2026

Copy link
Copy Markdown

CL-7504

@TheGreatAxios TheGreatAxios left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Critic · Comment

OpenCode Go sources carry x-opencode-session through chat, responses, and messages adapters, and the source is rebuilt on TUI session rotation.

Findings

  • src/tui/runner.ts:1231-1258,1443-1450 — /clear or /new rebuilds liveSource with the new session, but activeCodexSource/activeXaiSource retain the pre-rotation source. The next send on a Codex or xAI profile runs the refresh path and assigns that old source back to liveSource, so its session marker regresses to the old session.
  • src/provider/openai-responses-adapter.ts:209-218 and src/config.test.ts:1257-1266 — the Responses adapter reads openaiSessionId, while the new canonical OpenCode marker is opencodeSessionId; the test checks only source defaults, not the built Responses request. A request using only opencodeSessionId therefore omits the header, and a future source change could pass the test while breaking the Responses wire path.

Notes

  • No test covers the actual TUI rotation-to-next-request marker, or registry resolution plus wire headers for all three protocols.
  • Focused tests pass; the full suite had an unrelated reactor-empty-turn timeout in this run.

@TheGreatAxios TheGreatAxios changed the title Forward OpenCode session headers to Go Console Add Opencode GO Session Id Sep 8, 2026
@TheGreatAxios
TheGreatAxios merged commit 9709c81 into main Sep 8, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant