Skip to content

fix(review): mark the PR-platform status post explicitly - #1719

Merged
backnotprop merged 2 commits into
mainfrom
fix/review-platform-flag
Oct 5, 2026
Merged

backnotprop merged 2 commits into
mainfrom
fix/review-platform-flag

Conversation

@backnotprop

@backnotprop backnotprop commented Oct 5, 2026 •

Copy link
Copy Markdown
Owner

Problem

Since 0.28.0, reviewHostResult (apps/hook/server/host-result.ts) read any request-changes review with zero annotations as the PR-platform status post: noop: true. The review editor puts only code comments in annotations. PR description comments, PR comment notes and VS Code editor comments go only into the feedback markdown. So under the Claude Code mod, a review made only of those comments sent Claude nothing, and the server had already cleared the draft.

Fix

The platform post now marks itself, and nothing infers it from the annotation count.

  • Client (packages/review-editor/App.tsx): the status post that follows a platform submission sends platform: true in its /api/feedback body. No other body sends it.
  • Servers (packages/server/review.ts, apps/pi-extension/server/serverReview.ts): put platform: true on the decision only when the body value is boolean true.
  • Consumers now decide on the flag:
    • reviewHostResult: with the flag, noop: true and platform: true. Feedback without the flag is delivered (noop: false), including annotationCount: 0. A submit with no feedback text and no annotations stays a no-op.
    • buildReviewOutput (CLI stdout and --json, which Amp reads): every review gets the request-changes suffix except the platform status line.
    • OpenCode embedded /plannotator-review: same rule.
    • OpenCode CLI bridge: opencode-review always sends platform as a boolean. When the field is missing, the CLI is older, and the bridge falls back to the old isPRMode rule.
    • Pi: the new classifyReviewOutcome in apps/pi-extension/review-outcome.ts, which is added to the package files list. The event API's code-review result declares the same field.
  • Unchanged:
    • The mod's legacyResult (stdout from an older CLI) never inferred the platform post. A status line from an older CLI still arrives as a feedback turn, as before. This is now noted in its doc comment.
    • The feedback archive's decision comes from approved and whether the body has content, not from the annotation count.

Side effect: zero-annotation feedback (PR description, PR comment or editor comments only) now gets the request-changes suffix on the CLI, OpenCode and Pi. Before, it was delivered without the suffix, as if it were the status line.

Version skew: the client and the server ship together in each binary and package, so the flag is always present where it is needed. The OpenCode plugin and the CLI version independently, which is why the bridge has the fallback. Docs are updated in AGENTS.md: the host result file paragraph and the /api/feedback row.

Tests

  • apps/hook/server/host-result.test.ts: description-only, PR-comment-only and editor-only feedback with zero code annotations is delivered. The flagged platform post stays a no-op with the follow-up suggestion. An empty submit stays a no-op. One end-to-end case passes the real record through the mod's deliveryFor.
  • apps/hook/server/review-output.test.ts: CLI output for each case.
  • apps/opencode-plugin/commands.test.ts and apps/opencode-plugin/cli-bridge.test.ts: the embedded command and the bridge, including the older-CLI fallback.
  • apps/pi-extension/review-outcome.test.ts: Pi delivery through the real Pi review server.
  • packages/server/review-platform-flag.test.ts: both runtimes carry the flag only for a boolean true ("true", 1 and {} are dropped).
  • packages/review-editor/App.decisionControl.test.tsx (DOM, already listed in CI): the platform status post sends platform: true, and agent-path feedback does not send the field.

Run locally:

  • bun test on apps/hook, apps/opencode-plugin, apps/pi-extension, packages/server, packages/review-editor and packages/shared: all pass.
  • Review-editor DOM tests: all pass.
  • bun run typecheck: passes.
  • Review and hook builds: succeed.
  • guides.show viewer build, size budgets and check:manifest: pass.
  • scripts/test-claude-code-mod.sh with a temporary CLAUDE_CONFIG_DIR (a fresh directory holding only a seeded .claude.json): 15 pass.

Follow-up: binaries from 0.28.0 to 0.28.3

The Claude Code plugin updates from main separately from the binary. A 0.28.0 to 0.28.3 CLI still writes platform: true, noop: true for feedback with zero code annotations. The mod now treats a review record as the platform post only when its message is one of the editor's status lines: Pull request|Merge request approved|reviewed on … or Changes requested on …, the shapes statusMessage builds in App.tsx. Any other non-empty platform record is delivered as review feedback (misreadAsPlatformPost in apps/hook/hooks/mod/delivery.ts). A CLI with this fix sets platform only on the real status post, which always matches, so it never takes this path. This is documented under "Version skew" in AGENTS.md.

New tests in delivery.test.ts:

  • An old-style record with description-only feedback and platform: true is delivered.
  • Every editor status line with platform: true is logged.

Wording fix: only the Claude Code mod logs the status post. OpenCode, Pi, CLI stdout and Amp deliver it verbatim, without the request-changes suffix. The App.tsx comment and the /api/feedback row in AGENTS.md now say this.

Since 0.28.0 reviewHostResult treated an annotated review with zero
annotations as the PR-platform status post (noop), so under the Claude Code
mod a review made only of PR description comments, PR comment notes or VS Code
editor comments (which ride only in the feedback markdown) reached Claude as
nothing, and the draft was cleared.

The platform path's status post now sends `platform: true` in its
/api/feedback body; both review servers carry it onto the decision only when
it is boolean true, and every consumer decides on that flag instead of the
annotation count: the host result record, the CLI output (stdout and --json),
OpenCode's embedded command and CLI bridge (which falls back to isPRMode for an
older CLI), and Pi (classifyReviewOutcome). Zero-annotation feedback is now
delivered and gets the request-changes suffix; a truly empty submit stays a
no-op.
0.28.0-0.28.3 CLIs wrote platform: true, noop: true for any review with zero
code annotations. The mod now treats a review record as the platform post only
when its message is one of the editor's status lines, and delivers any other
platform record as review feedback. Also corrects the flag's wording: only the
mod logs the status post; OpenCode, Pi, CLI stdout and Amp deliver it verbatim
without the request-changes suffix.
@backnotprop
backnotprop merged commit bc7ce92 into main Oct 5, 2026
28 checks passed
backnotprop added a commit that referenced this pull request Oct 5, 2026
Brings in #1719 (platform flag), #1717, 0.28.4 and #1718 (bundles).
Resolution keeps both sides:
- Pi review delivery uses classifyReviewOutcome (the server's platform
  flag; nothing inferred from the annotation count) inside the shared
  launchCodeReview, with this branch's decision heading. The platform
  status post is labeled "Posted to the pull request".
- Bundles go through launchAnnotate, shared by /plannotator-annotate and
  the tool. A tool list target opens one annotate-bundle review in order
  (only the shared selection's bundle outcome opens; missing, folder or
  URL entries refuse). Its subject is plannotatorBundleSubject in the
  result, list, close and decision heading.
- Tests: bundle via the tool (order, list, feedback, close), a list that
  would open fewer files refuses, description-only review feedback through
  the tool path, and the platform post delivered verbatim.

Co-Authored-By: Claude <noreply@anthropic.com>
backnotprop added a commit that referenced this pull request Oct 5, 2026
Brings in #1719 (explicit review `platform` flag), #1717, 0.28.4 and #1718
(bundles). Resolutions and follow-ups:
- cli-bridge annotate: bundle framing ("Files: …") and the older-CLI
  several-paths mapping kept, plus the tool's gated bare approval, failure
  reports and the agent-close log.
- The tool opens a list target as one bundle review through the same launch
  (annotateBundle: each file its own CLI argument; a single tool target is
  never re-split); the subject is plannotatorBundleSubject in the result, list
  and decision heading; an older CLI's refusal answers the bundle update text.
  Slash-command bundles get the same subject.
- Review headings use the platform flag (isPlatformPost, isPRMode fallback
  only without the flag): "Review posted" for the status post, "Changes
  requested" for anything else, never inferred from zero annotations.
- opencode-review carries both #1719's platform and the additive
  annotationCount.
- Tests: a bundle via the tool (argv order, name, list, heading, older CLI),
  description-only PR feedback vs a platform post.

Co-Authored-By: Claude <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.

1 participant