fix(coding-agent): preserve session-start notifications until UI attach - #1146
Open
Diyoncrz18 wants to merge 3 commits into
Open
fix(coding-agent): preserve session-start notifications until UI attach#1146Diyoncrz18 wants to merge 3 commits into
Diyoncrz18 wants to merge 3 commits into
Conversation
Capture retained extension UI notifications only during the initial extension bind. Route the replay to the first eligible public client while preserving normal live notification fanout, ordering, backpressure, and cleanup behavior. Fixes PrimeIntellect-ai#1032
# Conflicts: # packages/coding-agent/CHANGELOG.md
Diyoncrz18
marked this pull request as ready for review
August 10, 2026 15:59
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.
Summary
session_startbind until the first eligible extension-UI client can receive them.Root cause
Extensions are bound before a daemon UI client is attached. A
session_starthandler that calledctx.ui.notify()therefore emitted anextension_ui_requestinto an empty recipient set. The initial fix retained notifications, but its capture window extended beyond the initial bind, ordinary last-client detach could clear the queue, and a supervisor subscription could release the queue before a public UI client was ready.Solution
notifyrequests only while the initial extension bind is running.Only fire-and-forget
notifyrequests participate in startup retention. Modal requests such asconfirm,select,input, andeditorretain their existing response and cancellation behavior. Clients without the per-sessionextension_uicapability neither receive nor consume retained notifications.Compatibility
This change is backward-compatible. It only changes internal retention, ordering, and routing of the existing
extension_ui_requestnotification. It adds no daemon command, event type, response field, or startup requirement, soDAEMON_PROTOCOL_VERSIONandDAEMON_SCHEMA_REVISIONremain unchanged.Validation
npm run checkpassed, including formatting, linting, type checking, installer rendering, and browser smoke validation.git diff --checkpassed.The complete supervisor monitor suite passed 44 tests on Windows; one unrelated Unix-socket test could not create its socket path because Windows returned
EACCES. The affected supervisor routing and backpressure cases pass when run directly.Issue
Fixes #1032
Note
Preserve daemon session-start extension UI notifications until a UI-capable client attaches
notifyevents emitted duringsession_startwere previously lost if no UI-capable client was attached yet; they are now buffered and replayed once to the first eligible client after attach and snapshot streaming complete.MAX_PENDING_EXTENSION_UI_NOTIFICATIONS) to bound memory use, and delivery is deferred past backpressure.shouldSendDaemonOutboundToClientnow gatesnotify-typeextension_ui_requestmessages on per-session UI capability, so non-UI clients no longer receive them.1032-session-start-notification.test.tscovers capture, single-recipient replay, backpressure, rebind, and bounded buffering.Macroscope summarized 39da919.