Repository navigation
fix(runtime): expose terminal output observations without inferring working state - #146
Conversation
…tput A terminal (PTY) Actor without a managed session, such as a Hermes or Devin TUI or a custom command, was always reported as waiting / pty_running_state_unknown, so its status ring never moved. The daemon already reads every byte such a process writes to its terminal. Record when the session last produced output and report it: - output within the last 10 seconds: working (pty_output_recent) - otherwise: idle (pty_output_quiet), with idle_seconds since the last output - no output yet: unchanged (waiting / pty_running_state_unknown) The rule does not depend on the runtime. CCCC_PTY_ACTIVE_WINDOW_SECONDS (1-600) overrides the 10-second window. A restart starts a new session, so the record never carries over from a previous process. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EHHL9uWYgNe2MEc7uMqddX
|
Live end-to-end run (claw: Debian 13, Skylake 8vCPU AVX2/AVX-512, 15G RAM), 2026-10-21, built
|
|
The missing PTY observability is real, but I am holding this version because output activity does not establish Please separate observation from inference: expose last-output time / quiet duration for display, while retaining an unknown working state when the runtime supplies no authoritative turn information. Preserve managed-session precedence and reset observations on a new PTY session. Add cases for quiet ongoing work and noisy input-waiting, rather than only print-then-sleep. That narrower observability change would be useful without changing the meaning of the shared working-state fields or introducing a global timing knob. |
…unknown Terminal output does not establish whether a process is working: a model can compute silently for a long time, and a spinner or a prompt waiting for input can keep printing. This replaces the output-window inference with display-only observations. - The runtime records when each terminal session last wrote output (wall-clock time for display, monotonic time for the quiet duration). A new session starts without an observation. - Actor fields gain pty_last_output_at and pty_quiet_seconds for a running terminal Actor. They are never read by the working state. - A terminal Actor without authoritative turn information keeps waiting / pty_running_state_unknown. Managed sessions keep precedence. idle_seconds and effective_working_updated_at keep their meaning, and there is no timing setting. Tests cover quiet ongoing work, a noisy prompt waiting for input, print-then-sleep, a new session resetting the observation, and a managed session keeping precedence while its terminal prints.
|
CI note: on current |
Revised per review. Terminal output does not establish whether a process is
working: a model can compute silently for long periods, and a spinner or a
prompt waiting for input can keep printing. This version separates
observation from inference.
What changes
cccc-runtimerecords when each terminal session last wrote output, asa wall-clock time for display and a monotonic instant for the quiet
duration.
cccc_runtime::last_output(group_id, actor_id)returns it forthe live session only. A new session starts without an observation.
pty_last_output_at(RFC 3339) andpty_quiet_seconds. They are nullbefore the first output, for stopped Actors and for non-terminal runners.
What does not change
waiting/pty_running_state_unknown.idle_secondsandeffective_working_updated_atkeep their current values. The new fieldsnever feed the working state.
precedence and behave as before.
Tests (unix, real PTY processes)
Verification: GitHub Actions CI on the fork at exact head
337a6b2a421e6a57bf8b56cc6c33d8f0b1a2d361(run39806606736) passed all six jobs, includingrust-linux. The test-only red reference7413e80c22e598e5a8072c5d4b12bd50fb60fc08on the #146 headc4c9e7a02048aa36320dc3a807ea5e8e03ce65f6(run39806615317) fails exactly the four output-inference cases and the managed-session case, where the observation field is absent.