Symptom
Any session running an opencode-backed model (for example, opencode-go/muse-spark) fails blocking compaction with:
Compaction rejected: compaction generator failed: OpenAI API error (400) {"type":"MissingSessionID","message":"Error from provider (Console Go): Request is missing x-opencode-session ..."}
Root cause
generateSummaryMessage in src/core/extensions/builtin/compaction/speculative-summary.ts streams via modelRuntime/compat using only auth/transformHeaders headers and never merges provider attribution headers, unlike the normal turn path (sdk.ts transformHeaders -> mergeProviderAttributionHeaders). Therefore no x-opencode-session reaches Console Go.
createOpenAiRemoteCompactionHeaders in openai-remote-model.ts also only forwards sessionId for openai-codex-responses.
Evidence
A diagnostic run showed provider opencode-go, API openai-responses, base URL host opencode.ai, and a session ID present, but final headers without x-opencode-session. After merging attribution headers and directly setting the header, compaction succeeded: the header was present and the session compacted cleanly.
Suggested fix direction
Merge mergeProviderAttributionHeaders into the compaction summary request headers (guard for settingsManager being unavailable in that context), or set x-opencode-session directly for opencode providers. Happy to submit a PR if maintainers agree on the direction.
Environment
- omo-ai 5.0.0-0.beta.50 / senpi 2026.9.9
- Windows x64
opencode-go/muse-spark-1.3-contributor session
Symptom
Any session running an opencode-backed model (for example,
opencode-go/muse-spark) fails blocking compaction with:Root cause
generateSummaryMessageinsrc/core/extensions/builtin/compaction/speculative-summary.tsstreams viamodelRuntime/compatusing onlyauth/transformHeadersheaders and never merges provider attribution headers, unlike the normal turn path (sdk.tstransformHeaders->mergeProviderAttributionHeaders). Therefore nox-opencode-sessionreaches Console Go.createOpenAiRemoteCompactionHeadersinopenai-remote-model.tsalso only forwardssessionIdforopenai-codex-responses.Evidence
A diagnostic run showed provider
opencode-go, APIopenai-responses, base URL hostopencode.ai, and a session ID present, but final headers withoutx-opencode-session. After merging attribution headers and directly setting the header, compaction succeeded: the header was present and the session compacted cleanly.Suggested fix direction
Merge
mergeProviderAttributionHeadersinto the compaction summary request headers (guard forsettingsManagerbeing unavailable in that context), or setx-opencode-sessiondirectly for opencode providers. Happy to submit a PR if maintainers agree on the direction.Environment
opencode-go/muse-spark-1.3-contributorsession