Skip to content

test(opencode): use the config-defined model so bwrap tests stay hermetic - #129

Merged
pquerna merged 1 commit into
mainfrom
paul.querna/fix-opencode-hermetic-model
Jul 29, 2026
Merged

test(opencode): use the config-defined model so bwrap tests stay hermetic#129
pquerna merged 1 commit into
mainfrom
paul.querna/fix-opencode-hermetic-model

Conversation

@c1-squire-dev

@c1-squire-dev c1-squire-dev Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Main's integration (bwrap) job is red (since the #124 merge run — pre-existing, unrelated to #124): all three opencode_fake_inference failures saw zero requests reach the fake inference server because opencode crashed before its first model call.

Root cause, from the pane.cast CI artifacts: the scenarios invoke -m openai/o3-mini, which resolves against opencode's live-fetched model catalog (models.dev) — not the sha256-pinned v1.15.10 binary. The catalog floated forward and dropped o3-mini. One dependency, three failure modes depending on the fetch outcome:

  • fetch failsUnknownError: Unexpected server error right after the first-run DB migration (opencode_persists_streamed_response_to_session_db, opencode_handles_server_500_without_hanging)
  • fetch succeedsModel not found: openai/o3-mini. Did you mean: gpt-4.1-mini, gpt-4o-mini, gpt-5-mini? (opencode_executes_bash_tool_use_and_persists_output)
  • fetch falls back to the baked catalog → test passes (opencode_streams_chunks_incrementally, opencode_persists_user_prompt_in_session)

Fix

-m openai/fake-model — the model each scenario's own opencode.json already defines under the provider's models map. Resolution then never touches the live catalog. The fake server echoes any model field back without validating it, so request/response shapes are unchanged.

Testing

Not in this PR

crates/agent-tui/skill-data/ai-cli/SKILL.md still uses o3-mini in its real-world examples (the {test=…} blocks don't execute in CI today). Stale for the same root cause, but the right replacement model for user-facing docs is a product call — follow-up.

🤖 Generated with Claude Code + Squire

The opencode bwrap scenarios invoked '-m openai/o3-mini', which resolves
against opencode's live-fetched model catalog (models.dev) — not the
sha256-pinned binary. The catalog floated forward and dropped o3-mini,
breaking main's integration (bwrap) job with three failure modes of the
same dependency (pane.cast evidence from the CI artifacts):

- catalog fetch fails -> 'UnknownError: Unexpected server error' right
  after the first-run DB migration (persists_streamed, server_500)
- catalog fetch succeeds -> 'Model not found: openai/o3-mini. Did you
  mean: gpt-4.1-mini, gpt-4o-mini, gpt-5-mini?' (bash_tool_use)
- catalog fetch falls back to the baked catalog -> test passes
  (streams_chunks, persists_user_prompt)

All three failing tests saw zero requests reach the fake server because
opencode crashed before its first model call.

Fix: '-m openai/fake-model' — the model the scenario's own opencode.json
defines under the provider's models map. Resolution never touches the
live catalog, and the fake server echoes any model field back without
validating it.

Verified: cargo check -p agent-tui-integration --features bwrap --tests,
cargo clippy --workspace --all-targets -- -D warnings, cargo fmt. The
bwrap suite itself needs a container host — CI's integration (bwrap)
job is the execution environment (same arrangement as #127).

Note: crates/agent-tui/skill-data/ai-cli/SKILL.md still uses o3-mini in
its (non-executed) real-world examples — stale for the same reason;
left for a follow-up since the right replacement model for user-facing
docs is a product call.

Co-authored-by: c1-squire-dev[bot] <c1-squire-dev[bot]@users.noreply.github.com>
@pquerna
pquerna merged commit 3c9909d into main Jul 29, 2026
17 checks passed
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