(remote): light the attention state when a remote session waits on a dialog (#394) - #395
Conversation
…dialog Under tmux on a host the CLI emits no OSC 9, so an unattached remote session waiting on a permission prompt or a question stayed dark. The descriptor already carries status "waiting" (a blocking dialog is open); the remote adapter now turns it into attention, released when the status leaves waiting, the descriptor is gone or the session is dead. waitingFor is kept, validated, and shown in the status line. Closes #394
|
Reviewing |
|
Adversarial review at
Checked and holding: a local row never lights from its own descriptor (only the remote adapter passes |
The handoff to a detached row projected a frozen attention left by the descriptor, and a host that dropped mid-dialog kept the row orange for the whole outage. Detach now releases descriptor-owned attention and a host in error passes attention:false with its descriptor. Rebuilt rows read the remote state at initial paint so the render no longer wipes the class, and waitingFor rejects bidi and zero-width controls. Refs #394
|
Reviewing |
… filter A host that started failing or recovered with no file changes triggered no re-render, so the host-error gate on attention waited for an unrelated render. The indexer now notifies when a host's last error changes, once per change. waitingFor also rejects C1 controls, soft hyphen, ALM, line and paragraph separators, invisible operators and the BOM. Refs #394
sidebar.js called writeIconSlot, which is not a declared cross-file global and which only session-activity-dom.js may call. Add paintSessionIconFromSnapshot there, declare it in eslint.config.js and use it from the sidebar. Refs #394
|
Reviewing |
|
Re-review at |
What
An unattached remote session whose live descriptor says
status: "waiting"now shows the orange attention state, and loses it when the status leaveswaiting, the descriptor disappears or the session is dead. The sidebar status line appends the descriptor'swaitingFor(waiting · permission prompt · 3m ago). Attached rows are unchanged (#273).Why
Under tmux on a host the CLI emits no OSC 9, so a remote session waiting on a dialog stayed dark. The descriptor already reaches the renderer every refresh;
waitingmeans a blocking dialog is open (read from the CLI bundle 2.1.286). Latency is the refresh cycle (about 15 s with the host watch).How
public/session-state.js:descriptorStatusacceptsattention: true.waitingthen sets attention (clearing busy/unread like anattentionevent) and records that the descriptor owns it; any other status,liveness: deador an explicitattentionevent releases it. Attention raised by an explicit event is never cleared by a descriptor. Busy edges and transcript touches never clear it. Only the remote adapter passes the flag, so local rows are unchanged.remote-index.js: keepswaitingForon the descriptors and placeholders, validated (string, trimmed, at most 64 characters, no control characters, otherwise dropped).main.jscopies it onto the session object;public/sidebar.jsshows it while the status iswaiting..ai/contexts/session-state.md(rule),.ai/contexts/cli-session-state.md(reservation updated),docs/remote-hosts.md, CHANGELOG.Tests
test/session-state.test.js(9 reducer tests),test/remote-session-adapter.test.js(unattached lights and clears, attached not painted, decay keeps attention),test/remote-index.test.js(sanitizer, indexer, placeholder),test/annotate-remote-attachable-local-status.test.js,test/dom-sidebar-local-status.test.js. Each was red before the change. Fourteen single-line mutations of the guards (flag requirement, release paths, dead-liveness guard, ownership takeover, clearExclusive, length bound, control-character check, type check, placeholder and indexer copy, main.js copy, sidebar condition) each turn a test red.Not verified
A live descriptor during a permission prompt on a declared host; OSC 9 under tmux, the injection channel (#219) and the tier ladder (#218) are out of scope.
Closes #394