(session-state): local-pty rows carry a persistent state like the other adapters - #282
Merged
Merged
Conversation
…er adapters Finishes the #246 migration. public/session-activity.js is the local-pty adapter: one createSessionState per session id, fed by setActivity, clearUnread, setAttention, subagent counts, rekey and purge; the legacy Maps are views over those states, and busy / response-ready / attention exclusivity lives only in the domain. One snapshot-driven projection paints every kind, needs-attention included. Decided and pinned: attention supersedes and consumes the unseen-response state.
…entry on remote detach Review follow-up on the local-pty migration. Attention is cleared only by an explicit clear, never by a busy title; the projection reads busy, attention and response-ready off the snapshot rather than the winning rung so both can show together; a local row idling while active reads "Waiting for input" (decided, pinned); syncLocalPtyAgentsBusy no longer creates states and the remote detach handoff purges the shadow local-pty entry.
Owner
Author
|
Adversarial review (main vs branch in jsdom) → second commit. "DOM output unchanged" in the body reads: unchanged except two decided semantics.
|
This was referenced Sep 13, 2026
Merged
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.
Finishes #246 (steps 1-5 shipped in #266–#270; #273 added the ownership rule). This closes the last gap: the
local-ptykind now holds a persistentcreateSessionStateper session likeremote-sshandlocal-transcript, instead of projecting from the legacy Maps at render time.What
public/session-activity.jsis the local-pty adapter:localPtyStates(one state per id) fed bysetActivity,clearUnread, newsetAttention(sessionId, on, via),syncLocalPtyAgentsBusy(aggregate ofactiveSubagentsByParent),rekeyActivityState,purgeActivityFor. Exported signatures unchanged.sessionBusyState/responseReadySessions/attentionSessionsremain as Map/Set-shaped views over the states for the two readers not migrated (sidebar initial paint, grid-card dot) and for tests.public/session-activity-dom.js:applyStateClasses(sessionId, snapshot)is the single projection for all three kinds and now writesneeds-attentiontoo;computeBusyReadyClasses/applyActivityClassesToElementremoved;snapshotForLocalis a thin wrapper.app.js: notifications go throughsetAttention;sidebar.js: subagent running state mirrored into the adapter.session-state.js apply().attentionevent consumes the unseen-response state — clearing attention lands on idle, not on response-ready (before: independent Sets, CSS precedence, fallback to response-ready).session-state.md(status complete, local-pty section, ports table corrected),ipc-bridge.md.Proof
dom-sidebar-icon-slot,sidebar-busy-agents-tint,session-icon-slot-css-boundary,dom-sidebar-subagent-running,remote-row-ownership,remote-session-adapter,local-transcript-adapter,activity-trace-renderer,running-indicators,dom-file-panel-changes).test/local-pty-adapter.test.js(12): sequence → snapshot, combined states impossible through the API, rekey/purge move/drop the object, the decided attention semantic, a mutation guard.setActivitywritingsessionBusyState.set()directly instead ofapply()→ 3 tests red; reverted.session-activity.test.jsthat forced now-impossible combinations were rewritten to cover the same regressions without them.task check: 1431 + 120 pass, 0 fail, pre-existing skips.Left as is:
activeSubagentsByParent(per-agent TTL tracking) is a different concern; its aggregate is mirrored, not replaced.