Conversation
…n an event is dropped
This was referenced Oct 21, 2026
1 task
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.
Fixes #1589
Fixes #1412
Two small Pi extension features, approved in the 2026-10-21 feature triage.
Session events (#1589)
Pi now emits
plannotator:session-openedwhen a review opens andplannotator:session-closedwhen it ends. This covers every review: the/plannotator-*commands, theplannotatortool, plan review, andplannotator:request. A tool like Herdr can show "needs review" between the two.{ id, action, url, openedAt, piSessionId?, reviewId?, requestId? }idis thepn-id that the tool's list and the decision heading use.actionisplan-review,code-review,annotateorannotate-last.outcome(approved,submittedorclosed),closedBy(only when the outcome isclosed:reviewer,agent,stoppedorerror) andclosedAt.After
/reload(#1864). Every emit runs on a microtask inside try/catch. It goes through the opener'spiwhen the opener's session was live at the time of the call. Otherwise it goes through the instance that holds a process-wide slot: an instance claims the slot atsession_startand releases it atsession_shutdown. If no instance holds the slot, the event is dropped without an error. A review that ends after/reloadtherefore reaches the new instance's bus and never throws out of a handler.session_shutdownnow stops an open plan review first, so that review's closed event goes out on its own session's bus.plannotator-events.tsnow starts the session and waits for the decision itself, instead of calling theopen*helpers. This makes the URL known before the decision arrives. Behavior is otherwise unchanged.Checklist widget (#1412)
Pi draws at most 10 lines of a widget. For a longer checklist,
checklistWindow(checklist-window.ts) now sends 10 items:The status line still shows the full count.
Prompt-cache safety
Neither feature changes what the model receives. The events go only to
pi.events, and the widget only toctx.ui.setWidget. No messages, no custom entries, no system prompt, no tool-list changes.Proved in
apps/pi-extension/session-events.test.ts, over a fake Pi where every extension instance shares one bus and a replaced instance throws Pi's stale-ctx error:before_agent_start, and every message the extension sent. Reviews are then opened by a command, closed, opened again, carried across/reload, and closed after it. All 6 requests are byte-identical, and the events did go out./reloadcloses without throwing. A stale slot holder is forgotten without logging.plannotator-events.test.tsadds theplannotator:requestcases: the pair carriesrequestIdandreviewId, and after a replacement nothing is emitted to the dead bus or logged.Typecheck:
tsc -p apps/pi-extensionpasses. Pi suite: 565 pass, 0 fail.The Pi README event API section and CLAUDE.md ("Pi: session events and the checklist window") are updated.