Skip to content

feat(pi): non-blocking plan review, with Ask this session during review - #1670

Merged
backnotprop merged 6 commits into
mainfrom
feat/pi-nonblocking-plan-review
Oct 3, 2026
Merged

backnotprop merged 6 commits into
mainfrom
feat/pi-nonblocking-plan-review

Conversation

@backnotprop

Copy link
Copy Markdown
Owner

On Pi, plannotator_submit_plan no longer waits for the reviewer. It returns once the review opens and tells the agent to end its turn. The decision arrives later as a session message: approval switches to executing first, deny and answers-only use composePlanDeniedMessage, and external mode hands off. Planning restrictions stay on until approval. Leaving plan mode, a non-planning /tree path, or session shutdown closes the open review.

If the agent resubmits while the review is open, the same tab updates to the new version and keeps the comments. Both plan servers get updatePlan, /api/plan/revision, and a 409 for a decision made on a stale revision. The tab is only told to poll when the server passes planRevisions: true, which today means Pi's submit_plan only, so Claude Code and OpenCode don't change.

The Pi session bridge is now wired into the plan server, so Ask this session works during Pi plan review.

Tests: Pi and Bun server revision tests, an extension flow test with a fake review, and an App DOM test (stale 409 then in-place load). I also ran a live Pi 0.85.1 RPC smoke: plan, deny, resubmit, Ask, a revision pushed in place, a stale approve refused, approve, then implementation.

plannotator_submit_plan now returns as soon as the review opens; the
reviewer's decision arrives later as a session message (approve switches to
executing first, deny / answers-only use composePlanDeniedMessage, external
mode hands off). Planning restrictions stay on until approval. A revision
submitted while the review is open is pushed into the same tab: both plan
servers gain updatePlan, /api/plan/revision and a 409 for a decision on a
stale revision, advertised to the tab only with planRevisions: true (Pi's
submit_plan). The plan editor polls and loads revisions in place. The Pi
session bridge is wired into the plan server, so Ask this session works
during Pi plan review.
A decision passed the revision check, then awaited note integrations
before settling. A revision pushed in that window bumped the revision and
swapped the plan, so the approval was recorded (and delivered by Pi) for
text the reviewer never saw. Claim the decision synchronously after the
revision check; updatePlan returns null while it is claimed.
With updatePlan refusing while a decision is being recorded, submit_plan
would open a fresh review and stop the old one, dropping that decision
(a deny's feedback lost). Tell the agent to wait for the decision instead.
Also stop a review that finished opening after planning ended (an earlier
review's approval landing during the await), rather than leaving an orphan
tab whose decision nothing delivers.
The Pi plan server's approve decision now carries the exact text on
screen. The approval message appends it under "## Approved plan" and
execution works from it: the checklist, the per-turn framing and resume
read the snapshot (recorded on the plannotator-execute entry), and
checkmarks go back to the file only while its checklist still matches.
When the file differs from the approved text at approval, the message
says the edits were not reviewed and must not be executed.
Loading a revision re-renders the document under the composer or the
selection toolbar and drops the half-written comment. Hold it while one
is open (read from the DOM, since they live in the viewer and portals)
and re-check shortly so it loads soon after the composer closes.
The Pi plan-revision test now sets a temp PLANNOTATOR_DATA_DIR inside each
test and restores it in finally, and neither revision test cleans up the
real data dir afterwards any more. AGENTS.md drops an internal spec
reference and documents the approved-text snapshot, the decision claim and
the composer hold.
@backnotprop
backnotprop merged commit 236e71e into main Oct 3, 2026
24 checks passed
@backnotprop
backnotprop deleted the feat/pi-nonblocking-plan-review branch October 3, 2026 14:28
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