OpenCode conversation identity
OpenCode and OpenCode Go reuse explicit conversation IDs across turns. The
resolver checks x-opencode-session, existing affinity/session headers, native
CLI session/thread headers, request metadata, and then top-level session/thread
fields. Claude’s JSON-encoded metadata.user_id is inspected for a session ID;
an opaque account/user ID alone is never treated as a conversation ID.
Values containing control characters, empty IDs and IDs longer than 256 characters are ignored. JSON metadata parsing is bounded. Before translation, the executor header normalizer preserves this identity only for the OpenCode providers; it does not inject OpenCode headers for other providers.
The existing canonical ses_ encoding and conversation fingerprint fallback
remain unchanged. With no explicit ID, the first user message and other
existing fingerprint inputs continue to determine continuity. This is not a
new authorization boundary or proof of upstream content isolation.
The implementation lives in open-sse/utils/opencodeSessionIdentity.ts,
open-sse/utils/opencodeHeaders.ts and
open-sse/handlers/chatCore/executorClientHeaders.ts. Regression tests cover
native IDs, Claude metadata, precedence, invalid values and the existing
fingerprint behavior without paid upstream calls.
HagiCode
HagiCode 是面向專案開發的 AI 編碼工作台:豐富、便利的介面互動讓規劃、Agent 執行與專案工作更容易上手和跟進,帶來更投入的開發體驗。
透過豐富、便利的介面互動,讓規劃、Agent 執行與專案工作更容易上手和跟進。
- 智慧OpenSpec 工作流程將意圖轉化為從提案、設計、任務到交付的可執行路徑。
- 高效多 Agent 並行推進研究、實作與審查,並支援多儲存庫變更與你熟悉的 Agent CLI。
- 有趣豐富、便利的介面互動讓規劃、Agent 執行與專案工作更容易上手和跟進,帶來更投入的開發體驗。
下載 Windows 版
分享 HagiCode
讓想法化為交付成果。
HagiCode 是面向專案開發的 AI 編碼工作台:以 OpenSpec 工作流程規劃變更,多 Agent 並行執行,再由 Hero Scenario 讓進度一目了然,將想法化為交付成果。
- 智慧
- OpenSpec 工作流程將意圖轉化為從提案到交付的可執行路徑。
- 高效
- 多 Agent 並行推進研究、實作與審查。
- 有趣
- 豐富、便利的介面互動,讓規劃、Agent 執行與專案工作更容易跟進。
© 2026 HagiCode | Powered By hagilight-starlight@0.21.0 | Branch: main | Commit: de60bcd | Built:

