Repository navigation
Description
Description
muse-spark-1.3-contributor-free (provider opencode / Console / Zen) consistently fails mid-session when switching models, with:
Error from provider (Console): Upstream request failed: [invalid_request_error] reasoning `encrypted_content` was not issued to this caller
muse-spark-1.2-contributor-free does not trigger this in the same workflow.
Reproduction
- opencode
1.18.30(both~/.opencode/bin/opencodeand~/.npm-global/bin/opencodeare1.18.30, plugin@opencode-ai/plugin@1.18.30) - Start a session with
muse-spark-1.2-contributor-free(provideropencode) - Chat for a few turns (reasoning enabled by default:
transform.tssetsinclude: ["reasoning.encrypted_content"]forproviderID.startsWith("opencode")) - Switch model in the same session to
muse-spark-1.3-contributor-freeand send next message
Result: every subsequent request fails (see logs below). Also reproducible in reverse (start with 1.3 then switch to 1.2/other models) — symmetric cross-model replay issue.
Fresh session starting directly with 1.3 works fine; failure only occurs when session history contains reasoning.encrypted_content issued by a different caller/model and is replayed.
Logs
~/.local/share/opencode/log/opencode.log (30+ occurrences, same session IDs):
timestamp=2026-09-13T08:22:14.112Z level=ERROR run=99d847df message="stream error" providerID=opencode modelID=muse-spark-1.3-contributor-free session.id=ses_f6c6b96a9ffePiDYbHphIWblIr small=false agent=build mode=primary error.error="AI_APICallError: Error from provider (Console): Upstream request failed: [invalid_request_error] reasoning `encrypted_content` was not issued to this caller"
timestamp=2026-09-13T08:46:43.962Z level=ERROR run=0ac5e92c message="stream error" providerID=opencode modelID=muse-spark-1.3-contributor-free session.id=ses_f66192d6bffe1g2Y9nnuRNruxP small=false agent=build mode=primary ...
# (full log has 30+ identical errors for ses_f6c6b96a9ffePiDYbHphIWblIr and ses_f66192d6bffe1g2Y9nnuRNruxP)
Root cause (suspected)
muse-spark-1.3 returns reasoning items with encrypted_content (opaque, caller-bound, see also #43584 where muse-spark-1.2 already returns encrypted_content with summary:[]). transform.ts:447 enables include: ["reasoning.encrypted_content"] for all opencode providers, so history replay includes that blob.
When switching models mid-session, opencode replays the previous model's encrypted_content to the new model. Upstream Console validates the caller and rejects (was not issued to this caller). Same class as recent Claude fix in v1.18.27 (thinking.blockBinding tolerance for stale blocks), but no equivalent tolerance for OpenAI-style reasoning.encrypted_content on the opencode provider path.
PRs #45050/#45032/#44997 fixed similar store:false replay for openai/azure providers, but native-runtime.ts allowlist and transform handling for opencode provider's muse-spark family does not yet strip/isolate encrypted_content on model switch.
Expected
Cross-model switch in same session should not fail. Similar to Claude fix, opencode should drop encrypted_content (keep only summary) when replaying reasoning across different models/callers, or isolate reasoning per model.
Environment
- opencode
1.18.30(latest as of 2026-09-13), also tested after freshcurl -fsSL https://opencode.ai/install | bash ~/.opencodeplugin1.18.30- OS: Linux (Ubuntu),
opencode web --port 4096and TUI
Workaround
Start a new session (/new) when switching between muse-spark-1.2 and 1.3 (or any reasoning model). /clear before switch also avoids the replay.
Activity
github-actions commentedon Sep 13, 2026
This issue might be a duplicate of existing issues. Please check:
reasoning.encrypted_contentfrom a prior session (fork scenario), sameencrypted_contentcaller-binding rejection mechanisminvalid_request_erroron the sameopencodeprovider path — same class of stale/mismatched encrypted reasoning replayIf your issue is distinct (specifically the cross-model switch case within the same session for
muse-sparkon theopencodeprovider), please note that distinction in a comment so maintainers can track it separately.Joelincn commentedon Sep 13, 2026
Distinct from #37444 / #48319 / #48441 — this is cross-model switch in the SAME session.
Update with latest verification on opencode 1.18.30:
opencode.jsonc.bak.20260914010412):{ "$schema": "https://opencode.ai/config.json", "provider": { "opencode": { "models": { "muse-spark-1.3-contributor-free": { "options": { "include": [] } }, "muse-spark-1.3": { "options": { "include": [] } }, "muse-spark-1.2-contributor-free": { "options": { "include": [] } }, "muse-spark-1.2": { "options": { "include": [] } } } } } }muse-spark-1.3-contributor-freeworks fine, noencrypted_contenterror (sessionses_f643dfaedffesBqtvGAsRpeffn, logs clean after 2026-09-13T17:12Z).ses_f66202cd9ffeCze6vsn4v6gz1U,ses_f6c6b96a9ffePiDYbHphIWblIr) failed symmetrically in BOTH directions (1.2 -> 1.3 and 1.3 -> 1.2), 30+reasoning encrypted_content was not issued to this callererrors. Polluted session deleted viaopencode session delete, DB verified clean (session/message/partcount 0).include: []only prevents requesting NEWencrypted_content, it does NOT strip history. So it cannot fix already-polluted sessions.Why not a dup:
rsn_/smry_prefix), mine is same session + different model, no fork.rs_A:rs_B, mine reproduces without restart.idon strict gateways, mine has the blob but caller mismatch.Suggestion: same tolerance as the Claude fix in v1.18.27 (
thinking.blockBinding), but for OpenAI-stylereasoning.encrypted_contenton theproviderID.startsWith("opencode")path — dropencrypted_contentand keep onlysummarywhen replaying across different models/callers.1837620622 commentedon Sep 14, 2026
Also happens without a model switch: idle/resume of a Muse 1.3 session on 1.18.30 bricks the chat with the same Console
encrypted_contentcaller error.#48915
1837620622 commentedon Sep 14, 2026
Same class of stale encrypted_content replay. Fix: #48918
Joelincn commentedon Sep 14, 2026
Confirming a third trigger of the same root cause, no model switch involved:
muse-spark-1.3-contributor-freesocket connection was closed unexpectedly, then ~10s laterreasoning encrypted_content was not issued to this caller. The "8-10 rounds" pattern matches keep-alive lifetime, not turn count.This matches #48915 (thanks for linking). Endorsing its ask here: on this specific 400, drop
reasoningEncryptedContent/itemId, persist cleaned parts, and retry once — same class as the Claude stale-thinking recovery in v1.18.27 — instead of blind retry. Plus either sticky routing for Console sessions or a doc note that free models do not tolerate caller/egress rotation. Happy to provide logs.cwkeam commentedon Sep 15, 2026
Same root cause as #37444, and I hit it without any model switch: plain restart + resume (
opencode --continue) of a longmuse-spark-1.3-contributor-freesession (Console/Zen path,xhigh) reproduces the identical 400 immediately — the first resumed turn fails and every retry in that session fails. The stored reasoning parts carry caller-bound continuation state minted by the previous opencode process; replayed into a fresh caller connection, the gateway rejects them. That's #48319's restart trigger, same family, just our error message instead ofrs_A:rs_B not found.DB evidence (stock
~/.local/share/opencode/opencode.db, pre-cleanup snapshot):part.datareasoning rows look like:{"type":"reasoning","text":"<summary>","metadata":{"openai":{"itemId":"rs_…","reasoningEncryptedContent":"Q-Pa…"}}}message.dataerror rows:APIError · 400 · "reasoning \encrypted_content` was not issued to this caller"from gatewayhttps://opencode.ai/zen/v1/responses`.Workaround that works today (no upstream change): delete
metadata.openai.itemIdandmetadata.openai.reasoningEncryptedContentfrom stored reasoning parts. The visible reasoning summary/text is preserved, and resumed sessions continue cleanly after restart. I made it durable by installing persistent AFTER INSERT/UPDATE triggers on theparttable so the fields never get persisted again — re-runnable stdlib script, idempotent, re-run after any opencode upgrade that rebuilds the store.On the proper fix: agree with #37444's patch direction — the request-normalization layer should treat
itemId/reasoningEncryptedContentas non-durable continuation state: replay it only for the current in-flight turn (same connection, tool-loop continuation), and keep only the visible summary for historical reasoning when reconstructing input across fork/resume/restart boundaries. The auto-retry fallback in #31236 (on this specific 400, resend once with stale reasoning references dropped) would make all these triggers transparent for every provider.One more signal worth triaging separately: #49188 (filed today) reports this now happens in fresh short sessions after 2–3 messages, no resume/compact involved — suggests the Console gateway started enforcing stricter validation/expiry on the replayed
encrypted_content. If the normalization fix lands and that repro persists, it points at the gateway side.darman-a11y commentedon Oct 7, 2026
STILL UNSOLVED
thdxr commentedon Oct 11, 2026
Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (
opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊
nickchomey commentedon Oct 30, 2026
im getting this now as well.
Opencode failed to send message with error: reasoning encrypted_content was not issued to this caller
{
"model": "muse-spark-1.3-contributor",
"error": {
"code": null,
"message": "reasoning
encrypted_contentwas not issued to this caller","param": null,
"type": "invalid_request_error"
}
}****