feat(review): remove --post, drop JSON contract, let Claude handle posting#70
Merged
JohnnyVicious merged 1 commit intomainfrom Apr 14, 2026
Merged
Conversation
Third attempt at --post exposed that parser-side heuristics are the
wrong abstraction. v1.0.9 hit the undici body-timeout bug. v1.0.10
added a stderr handoff trailer to shift posting to Claude Code.
v1.0.11 tolerated unescaped inner quotes. Then a real run produced
*valid* JSON of a *different shape* (`{findings: [{summary, findings: [...]}]}`
with no top-level `verdict`), rejected by the schema-aware parser,
falling through to raw-JSON-in-chat and raw-JSON-in-the-PR-comment
again.
Chasing model-invented schemas is a losing game. Fix: remove the
whole flag, drop the JSON output contract entirely, and let Claude
Code handle posting via its own Bash tool when the user asks.
Changes:
* opencode-companion.mjs: remove --post/--confidence-threshold
flags from both review handlers, strip the tryParseReview +
renderReview path so review output is now plain prose passed
through unchanged (with the existing model header), delete
parseConfidenceThreshold and emitPostTrailer.
* Delete plugins/opencode/scripts/lib/pr-comments.mjs and
plugins/opencode/scripts/lib/review-parser.mjs entirely.
* Delete tests/pr-comments.test.mjs and tests/review-parser.test.mjs.
* render.mjs: drop renderReview (no callers left). render.test.mjs:
drop its test suite.
* prompts/adversarial-review.md: replace structured_output_contract
with an output_format section that asks for plain markdown
prose with a per-finding heading/file/confidence shape.
* lib/prompts.mjs: same treatment for the standard review prompt.
* commands/review.md and adversarial-review.md: remove --post /
--confidence-threshold from arg-hint and flag list, delete the
"Post-review publishing" trailer-parsing section, add an
"Optional: post the review to GitHub" section that fires ONLY
when the user explicitly asked in natural language. Claude
composes its own summary body, writes the gh review payload to
a temp file via the Write tool, POSTs via `gh api ... --input`,
and reports html_url. Never REQUEST_CHANGES — always COMMENT.
Net effect: the companion is simpler, the chat output is prose the
user can actually read, and posting is Claude's job (where it
belongs, because Claude has full editorial discretion and full
access to gh).
Tests: 220/220 pass (down from 268 because 48 cases covered the
removed post-plumbing). No regressions in remaining suites.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Third attempt at `--post` exposed that parser-side heuristics are the wrong abstraction:
Chasing model-invented schemas is a losing game. The pivot we converged on in the plan thread: rip the whole flag out, drop the JSON output contract entirely, and let Claude Code handle posting via its own Bash tool when the user asks.
What changes
Removed
Added
Net effect
Test plan
Out of scope (explicitly)