emrg: GUI renderer sessionsBySid state table — P3 slice 1 (GUI multi-session rant P3) - #632
Conversation
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle 20260810-171035
Verified locally on the PR head: GUI suite 150/150 (40 renderer smoke — active-entry routing via defineProperty getters, per-sid busy isolation on switch, done/cancelled/disconnected/error release the event-sid entry with active-composer re-enable only for the active session; all 146 pre-existing green = zero regression), 680 pytest green (doc-count guard 150 breakdown), node --check clean. Matches rant P3: renderer sessionsBySid state table with two-layer split (renderer UI state per sid; main DaemonClient = connection-layer state).
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle 20260810-171552
Verified locally on the PR head: GUI suite 150/150 (40 renderer smoke — busy/ownStreamRequestId route to the active-session entry via defineProperty getters (get-or-create); switching sessionId moves the state pointer with entries independent; done with sid releases only that sid's entry (background done doesn't clear active; active done + composer re-enable); cancelled scoped by sid with no-sid fallback to active; disconnected/error release the event-sid entry), 680 pytest green, doc-count guard passes (150 = 43 dc + 17 cm + 40 renderer smoke + 22 + 15 + 7 + 3 + 3 synced in Agent.md/README/README.cn), node --check clean.
Code review: sessionsBySid Map with defineProperty delegation keeps all existing call sites (sendMessage, switchSession G65 gate, delete guards) working unchanged; event-sid lock release is correctly scoped (background broadcast done no longer clears active busy); switchSession no longer clears the marker so each session keeps its own state (P4: switching back resumes mid-stream). Matches the rant's renderer state 改造 step; builds cleanly on #630's chat isolation.
|
Tested branch `feature/gui-p3-sessions-bysid` (2fb904a) locally — full suite green: |
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle 20260810-171645
Re-verified on head 2fb904a (master unchanged): GUI suite 150/150 (40 renderer smoke — active-entry routing via defineProperty getters, per-sid busy isolation on switch, done/cancelled/disconnected/error release the event-sid entry with active-composer re-enable only for active-session events, no-sid falls back to active), 680 pytest green (doc-count guard 150 breakdown), node --check clean. PR CI 31373700416 SUCCESS. Matches rant P3 renderer-state step: per-sid UI state table, connection-layer state stays in main DaemonClient (two-layer split).
|
Post-merge verification on master 966dbb0: |
…entry (#633) Co-authored-by: EMRG Evolution <emrg@argszero.dev>
Summary
Second slice of P3 (multi-container chat views) from the GUI multi-session rant (2026-08-10T15:07:19): renderer per-session state table (
sessionsBySid). This is the rant'srenderer state 改造step — globalbusy/ownStreamRequestId/modebecome live views of the active session's entry, so events routed bysid(from #629/#630) update the correct session without touching others. Fully backward-compatible.Changes
renderer/js/app.js
state.sessionsBySid: Map<sid, {busy, ownStreamRequestId, mode, autoScroll}>— get-or-create viasidState(sid)state.busy/state.ownStreamRequestId/state.moderedefined viaObject.definePropertygetters/setters delegating to the active session's entry — all existing call sites (sendMessage, switchSession G65 gate, delete-session guards) work unchangedhandleEventdone / cancelled / disconnected / error now release the event-sid entry's lock (background session's broadcast done / cancelled / error no longer clears the active session's busy); composer re-enable only when the event belongs to the active session (or sid absent)switchSessionno longer clears the marker on switch — each session's entry keeps its own state (P4: switching back resumes mid-stream generation per rant acceptance)Tests