fix(annotate): offer Approve with a note in every gated session that delivers it - #1728
Merged
Merged
Conversation
…delivers it The annotate header hid "Approve with a note…" / "Approve with notes" unless the CLI ran with --gate --json. The Claude Code mod (plannotator tool gate:true, /plannotator-annotate x --gate, taken-over Bash runs) and the classic skill launch plain --gate, so a gated review there (markdown or HTML) had no way to approve with a note, even though the mod's result file already delivers an approved-with-notes turn. - supportsAnnotateApprovalNotes is now gate && !hook. - Plaintext approval with a note prints the configured approvedWithNotes prompt (with the File/Folder/URL/Files context); a bare approval still prints "The user approved." byte for byte. --hook stays off (no message on approve). - Skill/command templates recognize the Approved with Notes message; docs updated.
- Docs: the plannotator skill's plaintext contract and AGENTS.md "Strict direct annotate results" name the one plaintext change (an approval with a note prints the approved-with-notes message). - Mod legacyResult recognizes the default "# Approved with Notes" heading on annotate surfaces, so a launch with no result.json is still delivered as "Approved with notes" rather than as feedback. - annotateContextLine (host-result.ts) is the one File:/Folder:/URL:/Files: helper for both the result file and plaintext stdout; parity test. - The call-site scan requires supportsAnnotateApprovalNotes( at every startAnnotateServer site except opencode-annotate-last.
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.
What the owner saw
A gated annotate session (often an HTML plan from the visual-explainer skill, which runs
plannotator annotate <file> --gate) showed Approve and Request changes…, but no Approve with a note….The item shows only when
/api/plansendsapprovalNotesSupported: true. The Bun CLI set that only for--gate --json. Every Claude Code path launches plain--gate, so all of them gotfalse:plannotatortool withgate: true/plannotator-annotate x --gateplannotator annotate x --gateBash runHTML is not the cause. Markdown, raw-HTML and live-app surfaces build the header from the same
buildDecisionSpecinput. The only HTML-specific header option isdismissOnIframeFocus.In a non-gated session (no
--gate), the header shows Done and Send a note…. That is intended: the maintainer ruled that "Done with a note…" and "Request changes…" collapse into one composer, because both used the same/api/feedbacktransport.Fix
supportsAnnotateApprovalNotesis nowgate && !hook.--jsonis no longer required.approvedWithNotesprompt, with theFile:/Folder:/URL:/Files:context. This matches what review plaintext already does. A bare approval still printsThe user approved.byte for byte, and before this change plaintext could never carry a note.noop: false).--hookstays off, because the hook protocol carries no message on approval.Per-host advert (gated sessions)
annotate --gate --json(also strict--require-approval/--result-file)feedback/ strict recordfeedbackannotate --gate(plain; classic skill, visual-explainer, Codex/Gemini/Copilot/Vibe/Kiro skills)gate: true,/plannotator-annotate x --gate, taken-over Bashannotate-last/copilot-last --gate(plain or json)--gate --hookannotate … --json --gate),opencode-annotate-lastcommands.ts--json)index.tsapproved-with-notesProposal, not implemented: non-gated "Done with a note"
A note in a non-gated session already reaches the agent as feedback through "Send a note…". The maintainer collapsed the old "Done with a note…" / "Request changes…" pair because both posted the same
/api/feedback. Only the framing differed:approvalFraminginbuildCompleteAnnotateFeedback.Bringing back a positive-note item would mean adding that framing back to the empty-state menu. That reverses the ruling, so I left it for the owner to decide.
Tests
annotate-output.test.tsstartAnnotateServercall site setsapprovalNotesSupportedannotate-host-result.test.tsruns the real process the way the mod launches it (page.html --gatewith the result file):/api/planadvertises the item on an HTML surface--hookkeeps the advert offThe UI code is unchanged, so no DOM tests were added.
Results:
bun test apps/hook apps/skills apps/opencode-plugin apps/amp-plugin(883 pass),bun run typecheck,build:review+build:hook, and a Bun bundle of the CLI all pass.