Skip to content

fix(opencode): render tool calls and drop stderr migration noise#639

Merged
wesm merged 3 commits intoroborev-dev:mainfrom
cpcloud:worktree-prancy-sprouting-salamander
Apr 12, 2026
Merged

fix(opencode): render tool calls and drop stderr migration noise#639
wesm merged 3 commits intoroborev-dev:mainfrom
cpcloud:worktree-prancy-sprouting-salamander

Conversation

@cpcloud
Copy link
Copy Markdown
Contributor

@cpcloud cpcloud commented Apr 12, 2026

Summary

  • streamfmt now renders opencode events whose outer type is tool_use (opencode 1.4+); earlier versions used tool and the renderer was silently dropping every tool call from the live job log on current opencode.
  • The tool_use branch is shared with Gemini; routing is by payload shape (part object → opencode, top-level tool_name → Gemini).
  • The opencode agent no longer streams stderr into the live log. opencode prints sqlite-migration:* progress and the Performing one time database migration... / Database migration complete. banners to stderr on every invocation; those lines were dominating the log for short reviews.
  • Captured stderr still reaches the user on non-zero exit via formatDetailedCLIWaitError. A new test, TestOpenCodeReviewStderrPreservedInError, drives an exit-1 scenario and asserts the stderr content appears in the returned error.

opencode 1.4.3 emits outer event type "tool_use" with a nested
part.type of "tool"; earlier versions used outer "tool". The
renderer previously only matched outer "tool", so every Read,
Glob, Bash call from recent opencode versions was silently
dropped from the live job log.

Merge the existing Gemini-only "tool_use" branch with the opencode
part-based branch, routing by payload shape: a nested "part" object
is opencode, a top-level tool_name is Gemini.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@roborev-ci
Copy link
Copy Markdown

roborev-ci bot commented Apr 12, 2026

roborev: Combined Review (e0042ab)

Summary verdict: Changes are mostly sound, but there is one medium-severity regression that should be addressed before merge.

Medium

  • internal/agent/opencode.go:111
    Disabling live stderr streaming with StreamStderr: false suppresses all stderr on successful opencode runs, not just the intended sqlite migration noise. That means legitimate warnings or diagnostics emitted alongside a 0 exit status are now silently lost.
    Suggested fix: Re-enable stderr streaming and filter only the known noisy migration lines, or otherwise preserve non-noise stderr in the job output/result.

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

cpcloud and others added 2 commits April 12, 2026 07:08
opencode prints sqlite-migration progress to stderr on every
invocation (e.g. "Performing one time database migration...",
"sqlite-migration:0", "Database migration complete."), which
dominates the live log for short reviews and buries actual
activity. Disable stderr streaming for opencode; the full
stderr is still captured into the streaming result buffer and
surfaced via formatDetailedCLIWaitError on non-zero exit, so
real failures still reach the user.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The prior commit disabled live stderr streaming for opencode, relying
on runStreamingCLI's captured Stderr being surfaced through
formatDetailedCLIWaitError when the process exits non-zero. Add a
regression test that drives a non-zero exit with a real error line on
stderr and asserts the line appears in the returned error message,
locking in the failure-visibility guarantee.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@cpcloud cpcloud force-pushed the worktree-prancy-sprouting-salamander branch from e0042ab to 40f0d2b Compare April 12, 2026 11:11
@roborev-ci
Copy link
Copy Markdown

roborev-ci bot commented Apr 12, 2026

roborev: Combined Review (40f0d2b)

Verdict: No medium-or-higher issues found across the reviewed outputs.

The agents consistently found the change clean. The diff appears to suppress noisy opencode live stderr output while preserving stderr in failure paths, and adds support for newer OpenCode tool_use stream events, with no medium, high, or critical findings reported.


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

@wesm wesm merged commit dc18257 into roborev-dev:main Apr 12, 2026
8 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.

3 participants