Skip to content

fix(amp): preserve feedback with structured decision delivery - #1476

Merged
backnotprop merged 2 commits into
backnotprop:mainfrom
FNDEVVE:fix/amp-structured-feedback
Sep 7, 2026
Merged

backnotprop merged 2 commits into
backnotprop:mainfrom
FNDEVVE:fix/amp-structured-feedback

Conversation

@FNDEVVE

@FNDEVVE FNDEVVE commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

This was generated by AI during triage.

Fixes #1456.

Problem

Amp classified rendered feedback by substring, so a real comment such as This path has no feedback loop, add one. was treated as no action and never appended to the agent thread. The same classifier also swallowed annotate feedback and approval notes.

Change

  • Add direct plannotator review --json: one { decision, message } record. message is the CLI-rendered agent instruction; this deliberately differs from raw annotate/OpenCode feedback.
  • Generate plaintext and JSON from the same review output builder, preserving prompt customization, approval-with-notes framing, and annotation-dependent verification suffixes.
  • Make both Amp review commands request structured output and route solely by decision. Remove the prose classifier from all review/annotate paths.
  • Retain bare review approvals in the thread and bare annotate approvals as notifications. Invalid/legacy CLI output produces an actionable update notice containing captured output for recovery, never a guessed decision.
  • Document the protocol and compatible-CLI requirement. No server endpoint or OpenCode protocol changes.

Verification

  • Reproduced the original bug through registered Amp commands and a real subprocess: ordinary feedback appended; the reported phrase in review, annotate, and approval notes did not.
  • Registered-command regressions: 30 passed. Focused producer/help/reference and dual-runtime approval-note suite with Amp: 71 passed.
  • Real Amp plugin → source CLI → disposable Git repo → HTTP decision → thread delivery smoke: review feedback, approval notes, bare approval, dismissal, and annotate feedback all passed.
  • Actual direct CLI JSON/plaintext equivalence: annotation suffix, approval notes, bare approval, dismissal; plaintext equals JSON.message + "\n" byte-for-byte.
  • Pinned Bun 1.3.14, disposable HOME, local CI unset: full suite 4,319 passed, 904 skipped, 0 failed; bun run typecheck passed.
  • Review → hook builds passed. Portable viewer build, budget check, and manifest check passed; no manifest change needed.
  • Independent Standards and Spec reviews: no remaining findings.

Includes the same previously reviewed storage data-directory lifetime correction carried by #1473#1475, keeping the known #1464 import-order CI failures fixed until that prerequisite lands. The Amp-specific commit is separate.

No competing pending PR addressing #1456 was found in open PR descriptions or issue timeline references; rechecked immediately before publication.

Resolve plan and history paths from the active data-directory configuration instead of capturing a temporary test override at import time. This reproduces and fixes the four order-dependent annotate CI failures reported in backnotprop#1464; keep both successful persistence and failed-write draft recovery assertions intact.
Fixes backnotprop#1456. Add review --json with a decision and CLI-rendered message, preserving plaintext output and customized prompts. Route Amp review and annotation delivery solely by structured outcomes so reviewer text cannot become a no-op sentinel. Cover actual registered-command delivery and recover legacy output visibly.
@backnotprop

Copy link
Copy Markdown
Owner

Deep review complete before merge, since this adds a CLI output contract every integration shares. Verified: the plaintext path is byte-identical for all existing consumers (framing, newline boundaries, exit codes - revert-verification proved the byte-compat test genuinely guards the seam); both version-skew directions fail closed with the recoverable update notice, tested across nine malformed-output shapes; nothing the old Amp routing delivered is dropped, and the #1456 class of feedback is now delivered instead of silently swallowed. 270/0 tests, typecheck clean, docs match the implementation exactly. Two style-only nits left as-is (duplicated return null in parseReviewDecision; ReviewOutcome as a local structural type). Merging.

@backnotprop
backnotprop merged commit 6414b78 into backnotprop:main Sep 7, 2026
24 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.

Amp relay can swallow an entire review when feedback text contains 'has no feedback'

2 participants