Skip to content

feat(annotate): add external agent instructions - #1138

Open
leoreisdias wants to merge 1 commit into
backnotprop:mainfrom
leoreisdias:feat/external-annotation-instructions-for-annotate-mode
Open

feat(annotate): add external agent instructions#1138
leoreisdias wants to merge 1 commit into
backnotprop:mainfrom
leoreisdias:feat/external-annotation-instructions-for-annotate-mode

Conversation

@leoreisdias

Copy link
Copy Markdown
Contributor

Context

Plannotator already exposes /api/external-annotations in Annotate sessions, but the UI hid the Options → Agent Instructions action there. External agents could technically post feedback, yet users had no built-in way to hand an agent the exact session URL and the annotate-specific request shape.

This PR makes that existing capability discoverable in Annotate without adding another optional skill or changing the server API.

Motivation

The workflow that motivated this is a conversational review with GPT Live: open a document in Plannotator, talk through it with GPT Live, and let the agent add external annotations to the live session as findings come up. Those comments then remain visible in Plannotator for the user to inspect, edit, or remove before sending feedback.

A session-specific copy action fits that workflow better than an extra skill because the receiving agent may not have Plannotator skills installed. The copied payload is portable and carries the exact localhost origin, expected mode, annotation schema, and safety boundaries the external agent needs.

What changed

  • exposes Agent Instructions in Annotate alongside the existing Plan Review and Code Review actions
  • adds annotate-specific instructions for single files and annotate-last, including mode verification, document reading, inline comments, global comments, batching, and source-scoped cleanup
  • identifies the current document in the copied payload when Plannotator has an active file path
  • keeps folder sessions honest: external annotations are session-scoped today, so their payload allows only file-labelled global comments instead of promising inline highlights on the selected linked document
  • tells external agents not to finalize the session or clear annotations created by other sources
  • documents the built-in handoff under the External Annotations API guide

No new endpoint or external-annotation storage behavior is introduced.

Review focus

The important behavior is the mode split in the copied contract:

  • file and message sessions use the existing plan-shaped COMMENT / GLOBAL_COMMENT API
  • folder sessions deliberately stay sidebar-only until external annotations can be scoped to a particular linked document
  • the copied URL is treated as the session identity, and the agent is instructed to verify /api/plan before posting

Test plan

  • Targeted annotate-instruction and external-annotation tests (5 pass)
  • TypeScript checks across core, shared, AI, server, UI, strict UI consumer, and Pi configurations
  • bun run build:review
  • bun run build:hook
  • Manual check with ./bin/plannotator.js annotate README.md: confirmed Options → Agent Instructions appears and the copied payload works with the live session

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