fix(amp,droid): surface Approve-with-Notes feedback instead of dropping it - #1146
Open
Souptik96 wants to merge 1 commit into
Open
fix(amp,droid): surface Approve-with-Notes feedback instead of dropping it#1146Souptik96 wants to merge 1 commit into
Souptik96 wants to merge 1 commit into
Conversation
…ng it The Approve with Notes flow (backnotprop#1092) emits decision:"approved" with a feedback field, but both adapters collapsed every approved decision to a bare "Approved." -- the reviewer's notes were silently lost. Amp had two drop sites: formatAnnotationFeedback returned null for anything not "annotated", and handleAnnotateResult early-returned on approved before formatting was ever reached. Droid's emitAnnotateDecision printed only "Approved." Both adapters now emit the shared approved-with-notes prompt (mirroring DEFAULT_ANNOTATE_APPROVED_WITH_NOTES_PROMPT in packages/shared/prompts.ts); note-less approvals keep the old behavior. The amp config override key approvedWithNotes matches the shared prompt config shape. Fixes backnotprop#1137
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.
Fixes #1137 — Amp and Droid collapsed every
decision: "approved"to a bare "Approved.", silently dropping thefeedbackfield that Approve with Notes (#1092) attaches.Root cause
There were actually three drop sites, one more than the issue lists:
apps/droid-plugin/lib/run-plannotator.js—emitAnnotateDecision's approved branch printed"Approved.\n"and returned, never readingparsed.feedback(theannotatedbranch right below it handles feedback properly).apps/amp-plugin/plannotator.ts—formatAnnotationFeedbackopened withif (decision.decision !== "annotated") return null;, so approved decisions could never format.apps/amp-plugin/plannotator.ts—handleAnnotateResultalso early-returnedctx.ui.notify("Approved.")beforeformatAnnotationFeedbackwas ever called, so fixing (2) alone would not have fixed Amp.Change
Both adapters now surface approved-with-notes feedback using the same prompt text as
DEFAULT_ANNOTATE_APPROVED_WITH_NOTES_PROMPTinpackages/shared/prompts.ts(the wording the OpenCode and Pi adapters already emit viagetAnnotateApprovedWithNotesPrompt). Since the Amp plugin and the Droidlib/are self-contained and don't importpackages/shared, the text is mirrored locally with a keep-in-sync comment, the same pattern the Amp plugin already uses for itsfileFeedback/messageFeedbackdefaults.formatAnnotationFeedbackhandlesapproved+ feedback (file annotations get aFile: <path>context line, matchingbuildAnnotatePromptFromBridgeOutcomein the OpenCode adapter);handleAnnotateResultappends the formatted notes to the thread, and only note-less approvals keep the plain"Approved."notify. The config override key isapprovedWithNotesunderprompts.annotate(andprompts.annotate.runtimes.amp), matching the shared prompt config shape.emitAnnotateDecisionemits the approved-with-notes block when feedback is present; blank/absent feedback still prints"Approved.\n".Deliberately preserved:
dismissedstays silent even if afeedbackfield is somehow present, and raw-output fallback for non-JSON stdout is untouched.Tests
plannotator.test.ts, +3): message-kind approved-with-notes formats the full prompt; file-kind includes theFile:context; note-less / blank / dismissed all staynull.run-plannotator.test.js, new file, 7 tests): pins the whole decision→stdout contract — plain approved, approved-with-notes, blank-feedback approved, dismissed, annotated, empty output, non-JSON passthrough.Verification (Windows, bun 1.3.13)
Full
bun teston this branch: 2283 pass / 72 fail / 14 errors across 225 files, vs pristinemainon the same machine: 2274 pass / 71 fail / 14 errors across 224 files — the delta is exactly the 10 added tests (9 pass; the one extra "fail",commit-history.test.ts"pages with before and reports hasMore honestly", is unrelated to these files and passes in isolation on this branch, so it appears load-flaky on this box). The ~71 baseline failures are pre-existing Windows-environment failures (workspace/symlink-heavy suites), identical either side.bun run typecheckdoesn't coverapps/amp-plugin(no tsconfig there and it's not in the script's project list), so as a proxy I ran the same standalonetsc --strictinvocation overplannotator.tson both pristine and this branch: 37 errors both sides, byte-identical sets (all pre-existing module-resolution noise from checking the file outside its build context — nothing introduced).Not verified live: I don't have Amp or Droid (Factory) installed, so this is exercised through the exported helpers/unit contract rather than an end-to-end annotate session.