docs(design): daemon side-channel coordination (A1/A2/A4/A5)#4511
Open
chiga0 wants to merge 2 commits into
Open
docs(design): daemon side-channel coordination (A1/A2/A4/A5)#4511chiga0 wants to merge 2 commits into
chiga0 wants to merge 2 commits into
Conversation
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.
What this is
A design-first, docs-only proposal for the A-series follow-ups surfaced by the cross-client real-time sync audit and the PR #4484 post-merge review. No implementation — it defines the approach so it can be reviewed before any code lands. Each item ships as its own implementation PR after this is approved.
The bugfix/cleanup follow-ups from the same review (epoch-reset resync, approval-mode serialization, cancel dedup, forward-failure signal, replay wire rename, Provider catch-up) are separate and already in review.
The four gaps
/model, plan-mode, or agent-internal switches callconfig.switchModel()directly and emit nothing; only the HTTP route broadcasts. Proposal: acurrent_model_updatesessionUpdate (mirrors the existingcurrent_mode_update), mapped by the bridge to the existingmodel_switchedevent, with HTTP + in-session converged on a single emitter to avoid double-broadcast.setModecallsconfig.setApprovalMode()without notifying. Proposal: emitcurrent_mode_updatefromsetMode; affirm and explicitly document the session-scoped (always) vs workspace-scoped (persist-only) broadcast split with ascopediscriminator.permission_resolvedoriginator/voter ambiguity. ItsoriginatorClientIdcarries the voter, whilepermission_request's carries the prompt originator. Proposal: add a canonicalvoterClientIdalias (non-breaking, same pattern as the acceptedlastReplayedEventIdrename); SDK prefers it.session_snapshotframe emitted before replay so a fresh attach renders correct state without extra round-trips.Why
These are the remaining "a state change on one path is invisible to other clients" gaps. Closing them gives the daemon a single coordination invariant: every model/approval-mode/permission transition broadcasts exactly once regardless of entry path, and a fresh attach can reconstruct side-channel state without out-of-band pulls.
Contents
Per-item problem (with code anchors), proposed design, alternatives, wire-compat, and risk; cross-cutting single-emitter and additive-alias patterns; proposed sequencing (A4 → A1+A2 → A5) and a test plan.
Requesting design review before implementation.