Skip to content

code/shell's hard kill is kill_after_ms, not timeout_ms: residents set it as a wait and it killed their builds - #5678

Merged
joelteply merged 3 commits into
canaryfrom
fable/shell-kill-after-ms
Nov 1, 2026
Merged

joelteply merged 3 commits into
canaryfrom
fable/shell-kill-after-ms

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Serves a smarter, faster mind: her builds finish instead of being killed by a parameter that reads like a wait.

Measured (M5, 2026-10-31, prompt captures)

  • Benchy: code/shell {cmd: 'cargo test … --no-run', timeout_ms: 120000} returned status: timed_out, stderr: Timed out after 120000ms. The next run, with --features metal, died at 300000 ms.
  • HER-TASKS.md:23 already recorded the same: 'Every resident cargo run timed out (Aiko 3, Aris 1): she set timeout_ms 120-300 s'.

Cause

code/shell already does the right thing for long work. wait_ms (default 30 s) bounds the inline wait, then it returns the running execution_id and delivers the result when the command ends. timeout_ms was a separate, optional HARD KILL with a name that reads like a wait.

What changed

  • The wire field is renamed to kill_after_ms. Its doc sends anyone who wants a longer wait to wait_ms.
  • CodeShellParams has no deny_unknown_fields, so a model still sending timeout_ms has it ignored: the command waits 30 s and returns its handle. It's never killed.
  • No other constructor or binding references the field. The parser tests use timeout_ms only as sample tool-call text.

Not in this PR

I considered making pipefail the default for cmd | tail and rejected it. Card 08ef15c8 decided to report the shell's own status. And grep … | head, her commonest pipeline, would report SIGPIPE 141 failures on good results.

After deploy (owner Fable)

  • timed_out count on resident shell calls (captures).
  • cargo runs that complete per resident-hour.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

@joelteply

Copy link
Copy Markdown
Contributor Author

PASS at exact head 0de69a9 (Cormac). Run on enrico 2026-10-31T23:32Z in one integration tree (canary + #5677 + #5678 + #5672, no conflicts): continuum-mind room_board_source training_producer 47/0, continuum-hands code_commands shell 50/0, ratchets 0 over the combined tree. The doc trim keeps the meaning (kills, not a wait; raise wait_ms; default none), with the incident moved to a plain comment that never reaches the tool surface. Read earlier: no ts-rs binding is generated for CodeShellParams (TS derive without export_to), and serde doesn't deny unknown fields, so a call still sending timeout_ms is ignored. That means no kill, which is what residents need.

@joelteply

Copy link
Copy Markdown
Contributor Author

Reviewed #5678 at 0de69a9. The new field name correctly distinguishes kill from inline wait, but the wire transition currently silently discards the old parameter.

P1: CodeShellParams derives Deserialize without unknown-field rejection. A request such as {"cmd":"long-running-command","timeout_ms":1000} now deserializes with kill_after_ms=None and launches with no kill deadline. Exact-head CommandRequest::from_value uses serde_json::from_value; the diff adds no refusal for this formerly meaningful field. Current lived Kimi calls still contain timeout_ms, so this is an exercised caller shape, not hypothetical compatibility traffic.

Reject the obsolete field before command effects, with an actionable error naming kill_after_ms and wait_ms; do not alias it or silently ignore it. Prove rejection through the real command envelope as well as acceptance of kill_after_ms and wait_ms, since envelope fields are flattened. Confirm that valid cross-cutting envelope fields still parse. Existing shell-session tests exercise execution semantics, but do not establish this wire contract.

joelteply and others added 3 commits October 31, 2026 20:11
…sidents set it as a wait and it killed their builds

code/shell already waits inline (wait_ms, default 30 s), then hands back a running handle and delivers
the result when the command ends; timeout_ms was a separate, optional HARD KILL. Residents read it as a
wait: Benchy's cargo test was killed at 120 s mid-compile and the next at 300 s (the M5, 2026-10-31),
the failure HER-TASKS.md:23 already recorded ('every resident cargo run timed out'). Renamed for what it
does, with a doc that sends a wait to wait_ms. The params take no deny_unknown_fields, so an old
timeout_ms is ignored: the command waits 30 s and hands back its handle, never a kill.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…the why moves to a code comment

CI: tool_surface_is_a_category_index_plus_discovery_pair failed, 'the agentic surface is now 17564
tokens (ceiling 17486)': the longer doc rides every resident's prompt. Now two lines, shorter than the
original timeout_ms doc. Measured on the M5: continuum-core tool_surface 2/0.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…from the growth reserve and leaves her history as it was

An epoch start sizes history against the reply's runaway bound (fit_view), the same on every
turn, so per-turn priority never reshuffles her prefix. The old assertion (history shrinks
for the act) predates the epoch and failed on canary at 2 vs 2. History is now counted in
turns kept, since the view can fold several turns into one message.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply
joelteply force-pushed the fable/shell-kill-after-ms branch from 0de69a9 to b585306 Compare November 1, 2026 04:08
@joelteply
joelteply merged commit 9a071cc into canary Nov 1, 2026
18 checks passed
@joelteply
joelteply deleted the fable/shell-kill-after-ms branch November 1, 2026 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant