fix(activity): a step waiting on its own command says what is running, and is not redone as stalled (#69) #71

Merged
cmoriarty merged 2 commits from fix/running-tool-69 into main 2026-09-27 00:16:36 -04:00
Owner

Fixes #69.

On soundcheck#32 an openspec.apply agent ran npx vitest run … 2>&1 | tail -12 for several minutes. The spine counted "silent for …" the whole time, and nothing said what was running. A shell command writes no event while it runs, and silence was measured from the last event, even though opencode records the call as running, with its command and start time.

The same cause could kill a long command. The stall watchdog redoes, and rolls back, an agent step silent for 480 s. It exempted steps waiting on a subagent or on the operator, but not steps waiting on their own tool call.

What changes

  • A tool call in flight is not silence. running_tool_call finds the newest tool call opencode has started and not finished. While it runs in a busy session the step isn't silent, and the digest carries running_tool, running_target and running_for_s, timed from the call's own start.
  • The spine names and times it: Running npx vitest run src/lib/… · 3m 12s. The tooltip has the whole command line, how long it has run, and the step's own time.
  • A running call's transcript row counts up (a command piped through tail used to show a dot and nothing moving).
  • The watchdog leaves a step waiting on its own tool call alone for up to TOOL_CALL_CEILING_S (20 minutes). opencode times shell calls out itself, so a call still running past that is a wedge, and the redo applies as before.

Verification

  • ./tools/test.sh: fast lane passed, with 1,782 backend, 416 UI unit and 67 browser tests. New tests:
    • a command in flight isn't silence, and silence returns once it completes;
    • an idle session's leftover running part doesn't count;
    • the watchdog skips a 9-minute command but redoes one running past the ceiling;
    • the spine line and tooltip;
    • the transcript row's start time;
    • e2e/running-tool.spec.ts, which checks the spine in a real browser against a fixture step three minutes into a command.
  • test_silence_escalates_and_names_the_last_tool asserted the old behaviour (a running bash read as silent). It now uses a completed call.
  • The OpenSpec change is archived in this PR: run-spine, agent-delegation and agent-transcript each gain a requirement.

🤖 Generated with Claude Code

Fixes #69. On soundcheck#32 an `openspec.apply` agent ran `npx vitest run … 2>&1 | tail -12` for several minutes. The spine counted "silent for …" the whole time, and nothing said what was running. A shell command writes no event while it runs, and silence was measured from the last event, even though opencode records the call as `running`, with its command and start time. The same cause could kill a long command. The stall watchdog redoes, and rolls back, an agent step silent for 480 s. It exempted steps waiting on a subagent or on the operator, but not steps waiting on their own tool call. ## What changes - **A tool call in flight is not silence.** `running_tool_call` finds the newest tool call opencode has started and not finished. While it runs in a busy session the step isn't silent, and the digest carries `running_tool`, `running_target` and `running_for_s`, timed from the call's own start. - **The spine names and times it:** `Running npx vitest run src/lib/… · 3m 12s`. The tooltip has the whole command line, how long it has run, and the step's own time. - **A running call's transcript row counts up** (a command piped through `tail` used to show a dot and nothing moving). - **The watchdog leaves a step waiting on its own tool call alone** for up to `TOOL_CALL_CEILING_S` (20 minutes). opencode times shell calls out itself, so a call still `running` past that is a wedge, and the redo applies as before. ## Verification - `./tools/test.sh`: fast lane passed, with 1,782 backend, 416 UI unit and 67 browser tests. New tests: - a command in flight isn't silence, and silence returns once it completes; - an idle session's leftover running part doesn't count; - the watchdog skips a 9-minute command but redoes one running past the ceiling; - the spine line and tooltip; - the transcript row's start time; - `e2e/running-tool.spec.ts`, which checks the spine in a real browser against a fixture step three minutes into a command. - `test_silence_escalates_and_names_the_last_tool` asserted the old behaviour (a `running` bash read as silent). It now uses a completed call. - The OpenSpec change is archived in this PR: `run-spine`, `agent-delegation` and `agent-transcript` each gain a requirement. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
On soundcheck#32 an apply agent ran `npx vitest run … 2>&1 | tail -12` for several minutes, and
the spine counted "silent for …" the whole time with nothing saying what was running. A shell
command writes no event while it runs, and silence was measured from the last event, although
opencode records the call as `running` with its command and start time. The same cause could
kill a long command: the stall watchdog redoes, and rolls back, an agent step silent for 480 s.
It exempted a step waiting on a subagent or the operator, but not one waiting on its own tool
call.

running_tool_call finds the newest tool call opencode has started and not finished. While one
runs in a busy session, the step is not silent, and the digest carries running_tool,
running_target and running_for_s, timed from the call's own start. The spine line names and times
it (`Running npx vitest run src/lib/… · 3m 12s`), with the whole command line, its time and the
step's time in the tooltip. A running call's transcript row counts up.

The watchdog skips a step waiting on its own tool call younger than TOOL_CALL_CEILING_S (20
minutes). opencode times a shell call out itself, so a call still running past that is a wedge,
and the redo applies as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Archive running-tool-is-not-silence
Some checks failed
deploy / deploy (push) Has been cancelled
bd3902f4a3
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cmoriarty/braid!71
No description provided.