openclaw - 💡(How to fix) Fix [Bug]: opencode-go works via direct infer but fails in embedded agent runtime with session takeover

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

opencode-go/mimo-v2.5 works through direct inference, but fails consistently when used as the embedded agent runtime for the main Telegram/dashboard agent. The observed failure is EmbeddedAttemptSessionTakeoverError / session file changed while the embedded prompt lock was released.

This still reproduces after updating to OpenClaw 2026.5.28 stable, adding the provider-specific API key, restarting the gateway, creating fresh sessions, purging stale session files, and disabling the local session-snapshot stripping LaunchAgent.

Error Message

Direct inference succeeds, but the embedded agent runtime fails during normal conversation flow with a session takeover/lock error. Switching the same agent runtime to openai/gpt-5.5 works immediately as a control.

Root Cause

opencode-go/mimo-v2.5 works through direct inference, but fails consistently when used as the embedded agent runtime for the main Telegram/dashboard agent. The observed failure is EmbeddedAttemptSessionTakeoverError / session file changed while the embedded prompt lock was released.

This still reproduces after updating to OpenClaw 2026.5.28 stable, adding the provider-specific API key, restarting the gateway, creating fresh sessions, purging stale session files, and disabling the local session-snapshot stripping LaunchAgent.

Fix Action

Workaround

Use opencode-go/mimo-v2.5 only for direct inference for now:

openclaw infer model run --model opencode-go/mimo-v2.5 --prompt "ok"

For the main Telegram/dashboard agent, use a different runtime model such as openai/gpt-5.5 or github-copilot/gpt-5.4-mini.

Code Example

openclaw infer model run --model opencode-go/mimo-v2.5 --prompt "Responde exactamente: ok"

---

openclaw infer model run --model opencode-go/mimo-v2.5 --prompt "ok"
RAW_BUFFERClick to expand / collapse

Bug type

Provider/runtime compatibility bug.

Summary

opencode-go/mimo-v2.5 works through direct inference, but fails consistently when used as the embedded agent runtime for the main Telegram/dashboard agent. The observed failure is EmbeddedAttemptSessionTakeoverError / session file changed while the embedded prompt lock was released.

This still reproduces after updating to OpenClaw 2026.5.28 stable, adding the provider-specific API key, restarting the gateway, creating fresh sessions, purging stale session files, and disabling the local session-snapshot stripping LaunchAgent.

Expected behavior

If openclaw infer model run --model opencode-go/mimo-v2.5 succeeds and the provider is configured/authenticated, the same model should be usable as an agent runtime model for normal Telegram/dashboard conversations, including follow-up turns and tool use.

Actual behavior

Direct inference succeeds, but the embedded agent runtime fails during normal conversation flow with a session takeover/lock error. Switching the same agent runtime to openai/gpt-5.5 works immediately as a control.

Reproduction / steps already tried

Environment: macOS install, OpenClaw updated from 2026.5.28-beta.4 to 2026.5.28 stable during the investigation.

  1. Configure opencode-go/mimo-v2.5 as the agent runtime model for main.
  2. Confirm direct inference works:
openclaw infer model run --model opencode-go/mimo-v2.5 --prompt "Responde exactamente: ok"
  1. Use the same model in the embedded agent runtime through Telegram/dashboard.
  2. First/direct call may work, but follow-up turns/tool sessions fail with EmbeddedAttemptSessionTakeoverError / session file changed while embedded prompt lock was released.

Troubleshooting steps that did not resolve it:

  • Added OPENCODE_GO_API_KEY to the OpenClaw environment.
  • Restarted the gateway.
  • Started a clean Telegram session with /new.
  • Purged stale files from agents/main/sessions/.
  • Updated OpenClaw from 2026.5.28-beta.4 to 2026.5.28 stable.
  • Ran openclaw doctor --fix.
  • Performed full purge + restart + /new again.
  • Disabled the local strip-session-snapshots LaunchAgent / compaction-adjacent file rewrite process.
  • Retested after the above cleanup.

Control test:

  • Switching the same agent runtime to openai/gpt-5.5 works immediately.
  • Other working runtime models observed locally: github-copilot/gpt-5.4-mini, github-copilot/gpt-5.5, and anthropic/claude-opus-4-7.

Why this seems provider/runtime-specific

The important distinction is that direct model inference succeeds, but the embedded runtime path fails. That suggests this is not only a provider auth issue or a basic model availability issue. The failing path appears tied to the OpenClaw agent session lifecycle: session locks, follow-up turns, tool calling, compaction/session-file updates, or provider adapter behavior inside embedded agent execution.

Workaround

Use opencode-go/mimo-v2.5 only for direct inference for now:

openclaw infer model run --model opencode-go/mimo-v2.5 --prompt "ok"

For the main Telegram/dashboard agent, use a different runtime model such as openai/gpt-5.5 or github-copilot/gpt-5.4-mini.

Related issues that may be adjacent but do not seem to cover this exact failure

  • #87790: separate Zen and Go API key env vars
  • #79263: local-transport CLI env loading behavior
  • #74056: missing OpenCode Go models in model list
  • #43247: opencode-go provider missing from API key candidates

Suggested next step

Please verify whether the opencode-go provider adapter supports the same embedded agent runtime/session lifecycle as the other providers. A focused regression test could compare:

  1. direct infer model run success,
  2. first embedded agent turn success,
  3. second embedded agent turn success,
  4. embedded tool-call turn success,
  5. behavior when session compaction/snapshot updates occur.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

If openclaw infer model run --model opencode-go/mimo-v2.5 succeeds and the provider is configured/authenticated, the same model should be usable as an agent runtime model for normal Telegram/dashboard conversations, including follow-up turns and tool use.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix [Bug]: opencode-go works via direct infer but fails in embedded agent runtime with session takeover