Files
Austin SpragginsandClaude Opus 5.5 1b55d3cb00 feat(agents): one key jumps to the agent that has waited on you longest (#1164)
With several agents running across tabs and windows, finding the one
blocked on a permission prompt meant scanning tab dots or opening the tray
menu. Go to Next Agent Needing Attention (cmd-shift-U, and ctrl-shift-U off
macOS; FocusNextAgentNeedingAttention to rebind, also in Search Everywhere)
reveals it directly: waiting agents first, the longest wait at the head,
then finished turns nobody has read. Pressing again from one of them moves
to the next and wraps; from anywhere else it starts at the head. It searches
the tabs of every open window, the same agents the tray menu lists, and
reveals a pane in another window the way a tray pick does; a workspace no
window is showing is not searched. With nothing to attend to it says so
("No agent in your open windows needs you") instead of doing nothing
silently. The ordering is a pure function over the tray's agent rows, with
tests.

Ordering by age needs to know when a status began, so AgentSessionState
carries since_ms: the daemon stamps it whenever a hook event, an assumed
interrupt or a stale-turn sweep moves the status. Hook events are stamped
one at a time, so a status that leaves and comes back within one batch
(Done, a new prompt, Done again) starts a fresh age. It is wall-clock time,
not an Instant, because it crosses the socket and survives a handoff; ages
across machines therefore follow each machine's clock. An older daemon
simply leaves it out and those rows queue behind stamped ones.
The tray menu now reads "needs input · waiting 3m", the workspace switcher
shows the same age beside the tab (computed the same way, on the same
clock), and `tty7 agents` gains a FOR column. Ages are in whole minutes in
the GUI so the tray snapshot, and with it the menu, changes at most once a
minute.


Claude-Session: https://claude.ai/code/session_017RJFBHCC4dbUua21a2TedQ

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 12:18:18 +08:00
..