← Back to Pull requests

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

Closed
unknown closed this pull request without merging on Jul 29, 2026 18:18 UTC
View on GitHub
unknown unknown commented on Jul 29, 2026 18:06 UTC
Author

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 fails → UnknownError: Unexpected server error right after the first-run DB migration (opencode_persists_streamed_response_to_session_db, opencode_handles_server_500_without_hanging)

  • fetch succeeds → Model 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

  • cargo check -p agent-tui-integration --features bwrap --tests

  • cargo clippy --workspace --all-targets -- -D warnings, cargo fmt --check

  • The bwrap suite needs a container host — CI's integration (bwrap) job is the execution environment (same arrangement as #127).
  • 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

    Diff: 254 lines (+190 / -64) across 3 files Reviewer: pquerna Review duration: 12m
    All Vouch review confidence checks passed
    Residual risk 0.27 = Change Risk (0.67) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.67 · 254 lines diff across 3 files
    0.67
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.332
    Shallow Review Depth shallow_review_depth
    0.289
    Sensitive Paths sensitive_paths
    0.067
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #129"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed sensitive_module
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 67.2% (HIGH) · Higher = larger blast radius
    67.2%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 26.6% · Safe to merge
    26.6%