Repository navigation
fix(annotate): use annotate feedback template for clipboard copy, not plan-deny - #1109
Merged
Merged
Conversation
… plan-deny Clipboard Copy paths (ExportModal Copy and the annotation panel quick copy) unconditionally wrapped exported annotations with the plan-deny template, so annotate sessions copied text starting with "YOUR PLAN WAS NOT APPROVED." while Send Feedback used the annotate template (including custom prompts.annotate.* config). The annotate servers (Bun and Pi) now ship the resolved, unsubstituted copy-wrapper templates in the /api/plan payload (feedbackTemplates), and the plan editor wraps copied annotations mode-aware: server template when present, browser-safe default annotate template otherwise, plan-deny only in actual plan review. Send Feedback behavior is unchanged. Closes #1107
BenNewman100
added a commit
to BenNewman100/plannotator
that referenced
this pull request
Jul 23, 2026
Conflicts were confined to the import blocks of apps/pi-extension/server/reference.ts and serverAnnotate.ts: both sides' imports are kept (this branch's annotate-history wiring plus main's backnotprop#1109 prompt-template additions), rewritten to the exact .ts specifier style that backnotprop#1106 established. saveToHistory is dropped from serverAnnotate's storage import — this branch removed its last call site. Also rewrites three inexact specifiers in server/annotate-history.test.ts (added on this branch before backnotprop#1106 landed) so the new import-specifiers guard test passes. Verified: all seven tsc project checks pass; full bun test matches the upstream/main baseline failure set on this machine (Windows-environment failures only, no regressions introduced by the merge).
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.
The bug
In annotate sessions, the clipboard Copy paths (the Export modal Copy button and the annotation panel quick copy) always wrapped the exported annotations with the plan-deny template. Copied text started with "YOUR PLAN WAS NOT APPROVED." even though the user was annotating a file, not reviewing a plan. That template is deliberately forceful directive framing (tuned in #224), so pasting the copied text into an agent falsely tells it a plan was rejected and pushes it into plan-revision behavior.
Meanwhile Send Feedback posts raw text and the server wraps it with the annotate template via getAnnotateFileFeedbackPrompt(), which also honors user-customized templates in ~/.plannotator/config.json (prompts.annotate.fileFeedback / messageFeedback). So Copy and Send Feedback produced different agent-facing payloads.
Root cause: wrapFeedbackForAgent() in packages/ui/utils/parser.ts unconditionally calls planDenyFeedback() with no mode awareness, and both copy call sites used it.
The fix
Copy is now mode-aware and config-faithful:
ExportModal takes an optional wrapCopiedAnnotations prop whose default reproduces today's behavior, so the review editor and any other consumers are unchanged.
Verification
Closes #1107