-
Notifications
You must be signed in to change notification settings - Fork 25
Implement filtering of OpenCode tool-call JSON lines in output #124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
## Summary - Introduces a new function `filterOpencodeToolCallLines` to clean up the output from the OpenCode CLI by removing JSON lines that represent tool calls, which are not needed for the review process. - Adds a helper function `isOpencodeToolCallLine` to identify these JSON lines. ## Changes - Updated the `Review` method to utilize the new filtering function on the command output before returning the result. ## Test plan - [ ] Verify that the output from `OpenCodeAgent.Review` no longer includes tool-call JSON lines. Generated with [Cursor](https://cursor.com)
|
Thank you. I'll push some more commits here -- I'm also going to add some configuration options for opencode (e.g. model selection in |
|
I'm getting other errors with OpenCode now. Will keep looking a this later. My use case is, I use Cursor and want to use roborev with a local Ollama model for reviews to save some money. My MacPro can run qwen2.5-coder:32b with 32k context window without breaking a sweat. |
|
Makes sense. I have a couple inference servers on my tailnet I can use for testing so I can work on ollama support after I get #126 merged and cut the 0.17.0 release |
## Summary Adds `--model` flag support to all agents (codex, claude-code, gemini, copilot, opencode), allowing users to specify which model an agent should use. This lays the groundwork for the more comprehensive agent/model-per-reasoning-level configuration described in #125. ## Changes ### CLI - Add `--model` flag to `review`, `refine`, and `run` commands - Help text explains format varies by agent (e.g., opencode uses `provider/model`) ### Configuration - `default_model` in `~/.roborev/config.toml` - global default model - `model` in `.roborev.toml` - per-repo model override - Resolution priority: CLI flag > repo config > global config > agent default ### Agent Interface - All agents implement `WithModel(model string) Agent` - Model passed to underlying CLI where supported (`--model`, `-m`, etc.) ### Database & Sync - Added `model` column to Postgres schema (v1→v2 migration) - Model included in job sync between SQLite and Postgres - Model returned in job listing/detail API responses - COALESCE backfill ensures existing jobs get model populated on upsert ### Schema Management - Postgres schema now defined in `internal/storage/schemas/*.sql` files - Single source of truth, easy to diff between versions - v1→v2 migration tested with job data preservation ### Bug Fixes - Fixed `OpenCodeAgent.WithReasoning` to preserve Model field - Improved OpenCode tool-call filter documentation ## Relationship to #125 This PR provides the foundation for the model-per-reasoning-level feature proposed in #125: | This PR | Enables in #125 | |---------|-----------------| | `WithModel()` on all agents | Phase 2 model overrides | | `default_model` / `model` config | Fallback when no per-reasoning override | | `model` column in database | Already stores resolved model per job | | `ResolveModel()` function | Base for future `ResolveReviewModel(reasoning, ...)` | The database schema does not need further changes - the single `model` column stores whichever model was resolved at enqueue time, regardless of selection mechanism. ## Supersedes Supersedes #124 (OpenCode tool-call filtering) - that fix is included here along with improved documentation. ## Test Plan - [x] Unit tests for `ResolveModel()` config resolution - [x] Unit tests for `WithModel()` persistence across all agents - [x] Unit tests for model flag generation in `buildArgs()` - [x] Integration tests for Postgres v1→v2 migration - [x] Integration tests for COALESCE model backfill (Postgres & SQLite) - [x] All existing tests pass --------- Co-authored-by: Cesar Delgado <beettlle@gmail.com> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
|
This was included in #126 |
|
In case it's useful, this is the |
Summary
filterOpencodeToolCallLinesto clean up the output from the OpenCode CLI by removing JSON lines that represent tool calls, which are not needed for the review process.isOpencodeToolCallLineto identify these JSON lines.Changes
Reviewmethod to utilize the new filtering function on the command output before returning the result.Test plan
OpenCodeAgent.Reviewno longer includes tool-call JSON lines.Generated with Cursor