anomalyco / anomalyco/opencode

[Bug] muse-spark-1.3-contributor-free: reasoning encrypted_content was not issued to this caller when switching models in same session

Open
#48,805 7 comments 7 reactions 1 assignee View on GitHub

@nexxeln is already working on this.

Since Sep 13, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

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
  1. opencode 1.18.30 (both ~/.opencode/bin/opencode and ~/.npm-global/bin/opencode are 1.18.30, plugin @opencode-ai/plugin@1.18.30)
  2. Start a session with muse-spark-1.2-contributor-free (provider opencode)
  3. Chat for a few turns (reasoning enabled by default: transform.ts sets include: ["reasoning.encrypted_content"] for providerID.startsWith("opencode"))
  4. Switch model in the same session to muse-spark-1.3-contributor-free and 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 fresh curl -fsSL https://opencode.ai/install | bash
  • ~/.opencode plugin 1.18.30
  • OS: Linux (Ubuntu), opencode web --port 4096 and 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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.