Skip to content

Remove hardcoded OpenCode model, fix flaky worker pool tests#264

Merged
wesm merged 3 commits intomainfrom
opencode-model-default
Feb 15, 2026
Merged

Remove hardcoded OpenCode model, fix flaky worker pool tests#264
wesm merged 3 commits intomainfrom
opencode-model-default

Conversation

@wesm
Copy link
Collaborator

@wesm wesm commented Feb 15, 2026

Summary

  • Remove hardcoded opencode/minimax-m2.1-free model which is obsolete
  • Only pass --model flag when explicitly configured by user
  • Add tests for CommandLine() and Review() verifying --model is omitted when empty and present when set
  • Fix flaky TestWorkerPoolCancelRunningJob by initializing test dirs as real git repos with real commit SHAs, so prompt building succeeds and the job reaches the agent's Review() where cancellation can reliably fire

Original fix by @midnattsol (supersedes #260). Test coverage added per review feedback.

Fixes #259

Test plan

  • TestOpenCodeModelFlag — verifies CommandLine() string output
  • TestOpenCodeReviewModelFlag — verifies actual subprocess args via mockAgentCLI
  • Existing TestOpenCodeReviewFiltersToolCallLines still passes
  • TestWorkerPoolCancelRunningJob passes consistently under -race -count=10
  • TestWorkerPoolE2E and TestWorkerPoolConcurrency now exercise the full prompt-build → agent-review path

🤖 Generated with Claude Code

midnattsol and others added 2 commits February 15, 2026 13:23
Test that CommandLine() and Review() omit --model when Model is empty
and include it when explicitly set. Covers both the string output path
and actual subprocess args via mockAgentCLI.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@roborev-ci
Copy link

roborev-ci bot commented Feb 15, 2026

roborev: Combined Review

Verdict: No Medium/High/Critical issues found; changes look clean and ready to merge.

All four reviews (security + default from both agents) reported no issues, with no conflicting findings to reconcile.


Synthesized from 4 reviews (agents: codex, gemini | types: security, default)

TestWorkerPoolCancelRunningJob failed intermittently under -race because
the test used fake SHAs in a non-git directory. Prompt building failed
immediately (git log exit 128), so the job never reached the agent's
Review() and exhausted retries before cancellation could fire.

Initialize tmpDir as a real git repo in newWorkerTestContext and use the
actual HEAD SHA in TestWorkerPoolE2E, TestWorkerPoolConcurrency, and
TestWorkerPoolCancelRunningJob. Replace the hardcoded sleep+poll in the
cancel test with waitForJobStatus for robustness.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@wesm wesm changed the title Remove hardcoded OpenCode model, add --model flag tests Remove hardcoded OpenCode model, fix flaky worker pool tests Feb 15, 2026
@roborev-ci
Copy link

roborev-ci bot commented Feb 15, 2026

roborev: Combined Review

Verdict: No Medium/High/Critical issues found; this PR appears clean.

Findings (Medium+)

None.

Only low-severity suggestions were reported (and are omitted per your criteria).


Synthesized from 4 reviews (agents: codex, gemini | types: security, default)

@wesm wesm merged commit dd88e1a into main Feb 15, 2026
7 checks passed
@wesm wesm deleted the opencode-model-default branch February 15, 2026 20:06
hughdbrown pushed a commit to hughdbrown/roborev that referenced this pull request Feb 16, 2026
…-dev#264)

## Summary

- Remove hardcoded `opencode/minimax-m2.1-free` model which is obsolete
- Only pass `--model` flag when explicitly configured by user
- Add tests for `CommandLine()` and `Review()` verifying `--model` is
omitted when empty and present when set
- Fix flaky `TestWorkerPoolCancelRunningJob` by initializing test dirs
as real git repos with real commit SHAs, so prompt building succeeds and
the job reaches the agent's `Review()` where cancellation can reliably
fire

Original fix by @midnattsol (supersedes roborev-dev#260). Test coverage added per
review feedback.

Fixes roborev-dev#259

## Test plan

- [x] `TestOpenCodeModelFlag` — verifies `CommandLine()` string output
- [x] `TestOpenCodeReviewModelFlag` — verifies actual subprocess args
via `mockAgentCLI`
- [x] Existing `TestOpenCodeReviewFiltersToolCallLines` still passes
- [x] `TestWorkerPoolCancelRunningJob` passes consistently under `-race
-count=10`
- [x] `TestWorkerPoolE2E` and `TestWorkerPoolConcurrency` now exercise
the full prompt-build → agent-review path

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

---------

Co-authored-by: midnattsol <juanjo@delasheras.dev>
Co-authored-by: Claude Opus 4.6 <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.

OpenCode agent hardcodes obsolete MiniMax model

2 participants

Comments