Skip to content

fix(opencode): the model is set once, without a retry - #7

Merged
eshatalov merged 1 commit into
mainfrom
claude/issue-52472-fix-check-ef8ccf
Oct 10, 2026
Merged

eshatalov merged 1 commit into
mainfrom
claude/issue-52472-fix-check-ef8ccf

Conversation

@eshatalov

Copy link
Copy Markdown
Owner

OpenCode's ACP catalog used to be read before the location's plugins had registered their providers, so a model from OpenCode Console (opencode-go/*, opencode/*) or from opencode.json selected right after session/new was refused with -32602. Subturn worked around it by setting the model again after each config_option_update for up to 5 s.

OpenCode 2.0.25 reads the catalog after the plugins have loaded (anomalyco/opencode#53358, closing #52472 and #52729), so the retry has nothing left to do.

  • src/core/acp-turn.ts: retryOnConfigUpdate, the config_option_update counter and the configure_retry event are gone; configure(client, sessionId) has two parameters again.
  • src/plugins/opencode.ts, src/plugins/fake.ts: the model is set with one session/set_config_option call. The plugin header no longer describes the late-model behavior.
  • test/fake-agent.mjs, test/core.test.ts: the latemodel and nomodel modes and their two tests are removed.
  • README.md: the minimum OpenCode version is 2.0.25.

For a reviewer, verified on OpenCode 2.0.26:

  • npm run typecheck, npm test: 34 pass, 3 live skipped.
  • subturn status lists opencode-go/* and opencode/* from the first catalog.
  • Live smoke + resume on zai-coding-plan/glm-5.3-flash and on opencode-go/muse-spark-1.3-contributor, where the model was acknowledged 19 ms after session/new. The user's opencode.db gained no session. 4 live turns spent.

Upstream still delivers providers added by a second activation pass (an npm plugin installed on first run) or by background discovery after the first catalog. The npm cache lives in XDG_CACHE_HOME, which the shadow does not replace, so a Subturn shadow is not a first run; no retry is kept for that case.

Claude Fable 5.1 in Claude Code.

🤖 Generated with Claude Code

OpenCode's ACP catalog used to be read before the location's plugins had registered their providers, so a model from OpenCode Console (`opencode-go/*`, `opencode/*`) or from `opencode.json` selected right after `session/new` was refused with -32602. Subturn set the model again after each `config_option_update` for up to 5 s.

OpenCode 2.0.25 reads the catalog after the plugins have loaded (anomalyco/opencode#53358, closing #52472 and #52729), so the retry has nothing left to do. It is removed from the ACP turn, together with the fake agent's `latemodel` and `nomodel` modes and their two tests; `configure` takes the client and the session id again. README names 2.0.25 as the minimum OpenCode version.

Verified on OpenCode 2.0.26: typecheck and the offline suite (34 pass, 3 live skipped); `subturn status` lists `opencode-go/*` from the first catalog; live smoke + resume on `zai-coding-plan/glm-5.3-flash` and `opencode-go/muse-spark-1.3-contributor`, where the model was acknowledged 19 ms after `session/new`; the user's `opencode.db` gained no session.

Claude Fable 5.1 in Claude Code.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-10T15:46:55.340683Z 5abec03 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5abec03d7c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/plugins/opencode.ts
@eshatalov
eshatalov merged commit d3f4b11 into main Oct 10, 2026
1 check passed
@eshatalov
eshatalov deleted the claude/issue-52472-fix-check-ef8ccf branch October 10, 2026 21:38
@eshatalov eshatalov mentioned this pull request Oct 11, 2026
eshatalov added a commit that referenced this pull request Oct 11, 2026
Version bump for 0.2.0. Minor rather than patch because OpenCode support
moved to OpenCode 2 (#6).

Ships since 0.1.1:
- #5 the newest installed copy of a harness is launched
- #6 support OpenCode 2
- #7 OpenCode model is set once, without a retry
- #8 Grok's requested model is no longer overridden by launch campaigns
- #9 README: the caller's instructions are an inline example

Done by Claude Opus 5.5 in Claude Code.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant