Skip to content

Show what a working child does now, and let the main agent interrupt its current command - #44

Merged
Crokily merged 1 commit into
mainfrom
stuck-child-visibility
Nov 13, 2026
Merged

Crokily merged 1 commit into
mainfrom
stuck-child-visibility

Conversation

@Crokily

@Crokily Crokily commented Nov 12, 2026

Copy link
Copy Markdown
Owner

Why

A child takes the main agent's messages only between its steps. On 2026-11-12 a child hung for 2.5 h in a bash command with no timeout. The main agent sent it "wrap up" and got "Sent to c5". Its wakes showed only c5 "…": working, for 2.7 h, so it could not tell that the message was still waiting. It stopped the child and lost its work, one minute before the hung process was killed by hand.

What changes

What the main agent sees. Wherever a working child is described (the task tool's list, the answer to send, the children lines in place wakes and timed/fallback wakes, the handoff of a new page, pots children), lines now follow that say what the child does now, read from its conversation each time:

Your children working for this place (1):
- c5 "Research web remote desktop": working, for 2.7 h, for slack:#C0CC3M0B1C6
  In bash for 2.5 h: cd /tmp/rdtest && node rfbping.mjs 127.0.0.1 5901
  Last output 2.5 h ago: RFB 003.008
  1 message from you waits until its current tool calls end.
Sent to c5; it takes the message when its current tool calls end.
c5 "Research web remote desktop": working, for 2.7 h, for slack:#C0CC3M0B1C6
  In bash for 2.5 h: cd /tmp/rdtest && node rfbping.mjs 127.0.0.1 5901
  Last output 2.5 h ago: RFB 003.008

Other cases: In codemode for 10 min: … followed by Its script is in bash for 9 min: sleep 999; No output yet.; Its model is answering.; Its model's last request failed (…); it tries again in 20 s.; It is compacting its context. Commands and output lines go on one line and are cut at 150 characters. An output line shows the text after its last carriage return, with terminal escape codes removed.

Where the facts come from: pi-durable's pi.live (the current tool calls, their output, nested calls, generation and retry, compactions), pi.inbox (queued messages), and each running tool task's record (startedAt, and the arguments from its execute checkpoint). Wrappers around bash, screen and codemode keep the time of each running call's last output in memory. That is enough, because a running call never lasts past a restart.

New task action interrupt. It aborts the tool calls a child is in (Harness.abortTask on each running tool task). It waits at most 10 s for them to end, and leaves the child running. bash and screen kill the command's process group, and a codemode call aborts the calls its script made. The child gets the usual "Tool bash was aborted" result with the output so far, takes the messages that waited, and goes on. The answer looks like this: Interrupted c5: ended its bash, which ran 2.5 h (cd /tmp/rdtest && node rfbping.mjs …). It goes on: it sees that the call was aborted, and takes the message from you that waits.

Text that changes. The task tool's description: send no longer says the message "joins its work"; there are new list words and a new interrupt action. One new line in the Children part of the prompt: a child takes messages only between its steps; interrupt ends its tool calls and the child goes on; stop ends the child. The README's children section and the test table in docs/development.md are updated too.

There is no default timeout, and nothing new in bot.json. The inbox, the waker, the outbox and the timers do not change, so spec/ does not change.

Tests

  • test/children.test.ts, two new tests on a real gateway with the fake model. (1) A child hangs in bash after one line of output. pots children, the place wake and the answer to send show the command, its age and its last output. pots children shows the waiting message, and the child takes nothing while the command runs. interrupt ends the command; the hung process is gone (checked by PID, except on Windows). The child's next request has the aborted result and then the waiting message, and its report reaches the channel. (2) The same with the command run from a codemode script.
  • test/children.parts.test.ts: the description on its own (progress lines, escape codes, cutting, nested calls, model retry, compacting, waiting messages, a child that waits or was stopped).

npm run check and the full npm test pass on Linux arm64 (305 passed, 2 skipped).

…its current command

A child takes the main agent's messages only between its steps. When a child hung in a
command, the main agent saw only "working, for 2.7 h", sent "wrap up", got "Sent to c5",
and could not tell that the message was still waiting; it stopped the child and lost its work.

Wherever a working child is described (the task tool's list, the answer to send, the
children lines of place and timed wakes, the handoff of a new page, pots children), it now
says what the child does now: the tool call it is in and for how long, the start of the
command (and the call its script makes), its last line of output and how old that is, its
model answering or trying again, and how many messages from the main agent wait for it.

New task action interrupt: it aborts the tool calls a child is in (bash and screen kill the
command's process group) and leaves the child running; the child sees the aborted result and
takes the messages that waited. The task tool's description and the Children part of the
prompt say how messages reach a working child and what interrupt does.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-12T16:11:54.718041Z d862d7d PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Crokily
Crokily merged commit ef12b92 into main Nov 13, 2026
6 checks passed
@Crokily
Crokily deleted the stuck-child-visibility branch November 13, 2026 06:03
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