Summary
When Plannotator is invoked from an agent session (plan review via hook, /plannotator-last, /plannotator-annotate), the Ask AI sidebar always starts a fresh provider session. It receives the document/diff content as a system prompt, but has none of the conversation history from the session that produced the work; the agent's reasoning, exploration, and rejected alternatives. This is especially important if we are reviewing a document that was created at the end of a very, very long session with many other back-and-forths.
The fork machinery for this was merged in #363, but no client passes a parent session, so it's currently unreachable...
Current behaviour
Every Ask AI session is created fresh. context.parent is never populated by any surface:
packages/editor/App.tsx (plan-review and annotate modes) builds AIContext without parent.
packages/review-editor/hooks/useAIChat.ts (code-review mode) builds AIContext without parent.
As a result, the shouldFork branch in packages/ai/endpoints.ts (context.parent && provider.capabilities.fork) is always false.
What the fresh session does get is the static snapshot: plan/document content, annotations so far, version info, and (code review) the changeset as a git command or pasted diff. What it can't answer is anything about how the work came to be.
Requested behaviour
Optionally, fork the invoking parent to answer questions. Optional, because it might be advantageous to start with a fresh session.
Summary
When Plannotator is invoked from an agent session (plan review via hook,
/plannotator-last,/plannotator-annotate), the Ask AI sidebar always starts a fresh provider session. It receives the document/diff content as a system prompt, but has none of the conversation history from the session that produced the work; the agent's reasoning, exploration, and rejected alternatives. This is especially important if we are reviewing a document that was created at the end of a very, very long session with many other back-and-forths.The fork machinery for this was merged in #363, but no client passes a parent session, so it's currently unreachable...
Current behaviour
Every Ask AI session is created fresh.
context.parentis never populated by any surface:packages/editor/App.tsx(plan-review and annotate modes) buildsAIContextwithoutparent.packages/review-editor/hooks/useAIChat.ts(code-review mode) buildsAIContextwithoutparent.As a result, the
shouldForkbranch inpackages/ai/endpoints.ts(context.parent && provider.capabilities.fork) is always false.What the fresh session does get is the static snapshot: plan/document content, annotations so far, version info, and (code review) the changeset as a git command or pasted diff. What it can't answer is anything about how the work came to be.
Requested behaviour
Optionally, fork the invoking parent to answer questions. Optional, because it might be advantageous to start with a fresh session.