Skip to content

Agent status: read hook-reported state from pane user options - #104

Open
Raphael-Hao wants to merge 1 commit into
feature/agent-status-signalsfrom
feature/agent-hook-read
Open

Agent status: read hook-reported state from pane user options#104
Raphael-Hao wants to merge 1 commit into
feature/agent-status-signalsfrom
feature/agent-hook-read

Conversation

@Raphael-Hao

Copy link
Copy Markdown
Collaborator

What

PR 4 of docs/agent-status-plan.md (stacked on #103#102; merge those first).

The transport for the optional agent lifecycle hooks, read side only:

  • PANE_FORMAT gains #{@deck_agent_state} — a pane-scoped tmux user option the hook script (next PR) writes via the $TMUX_PANE the agent inherited. Both gathering paths read it in the list-panes hop they already pay for: zero extra ssh round-trips, no resident remote process, keyed by the %N id deck already targets, gone automatically when the pane dies.
  • hook_status decodes "<state>@<epoch>" against the owning server's clock (local SystemTime, remote the probe's date +%s): Working expires after 60 s — hooks are edge-triggered and Esc / permission-deny / kill fire no closing event; Blocked after 10 min; Idle never (ground state).
  • merge_status gains the hook source, deliberately below the positive idle tells (the interrupt/completed lines are what retract a stale hook Working) and available to light the streaming blind spot when the activity clock has no signal (split window, old tmux).

Inert in production until PR 5 installs the hooks; the whole chain is hand-verifiable with tmux set-option -p @deck_agent_state "working@$(date +%s)".

Tests

773 workspace tests pass; new tests cover decode/expiry and the hook's place in the merge order.

🤖 Generated with Claude Code

https://claude.ai/code/session_0141oi9wW2ak6qv2DbgUHv1A

PANE_FORMAT gains #{@deck_agent_state}: the optional lifecycle hooks
(next step) write "<state>@<epoch>" onto the agent's own pane via the
$TMUX_PANE it inherited, so both gathering paths read the report in the
list-panes hop they already pay for — no socket, no resident process,
and the option dies with the pane.

hook_status decodes and expires the report against the owning server's
clock: Working dies after 60s (hooks are edge-triggered; Esc, deny, and
kill all fire no closing event), Blocked after 10min, Idle never (the
ground state the weak screen fallback agrees with anyway). In the merge
the hook sits below the positive idle tells — the interrupt/completed
lines are what retract a stale hook Working — and lights the streaming
blind spot when the activity clock has no signal.

Inert until the hooks are installed; verifiable by hand with
tmux set-option -p @deck_agent_state "working@$(date +%s)".

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0141oi9wW2ak6qv2DbgUHv1A
@Raphael-Hao
Raphael-Hao force-pushed the feature/agent-status-signals branch from b677920 to 7ca783c Compare August 25, 2026 06:50
@Raphael-Hao
Raphael-Hao force-pushed the feature/agent-hook-read branch from 16fba90 to 5a69d12 Compare August 25, 2026 06:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant