Skip to content

[Bug]: Delegated child ends its turn after starting an async delegate, even when its brief says to keep working #27126

Open

Description

@Artem-B

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server

Steps to reproduce

A child that starts an async delegate_task stops working until that delegate finishes, because the next hint in the result tells it to end its turn. The child's own brief says to keep working, and the child obeys T3's hint over the brief.

  1. Save the script below as setup.sh and run bash setup.sh /tmp/t3-repro. The script makes a 4-commit repo where rebasing feat/lexer onto main stops at one conflict, and writes /tmp/t3-repro/BRIEF.md.
  2. In a T3 thread, start a child with delegate_task: target codex / gpt-6.1-terra (reasoningEffort: xhigh, serviceTier: priority), mode: "async", task "Read /tmp/t3-repro/BRIEF.md and follow it."
  3. The brief tells the child to start an async Haiku check (sleep 120 && echo CHECK OK), then: "The check is advisory: never wait for it. Start the rebase at once."
  4. Read /tmp/t3-repro/log.txt and the child thread. The child logs a timestamp before each step.
setup.sh
#!/usr/bin/env bash
set -euo pipefail
D=$(realpath -m "${1:?usage: setup.sh <dir>}")
mkdir -p "$D/repo"
cd "$D/repo"
git init -q -b main
git config user.email repro@example.com
git config user.name repro
printf 'export function readChar(s: string, i: number) {\n  return s[i];\n}\n' > lex.ts
git add . && git commit -qm "lexer base"
git checkout -qb feat/lexer
printf 'export type Kind = "num" | "str";\n' > kinds.ts
git add . && git commit -qm "add token kinds"
printf '\nexport function lexNumber(s: string, i: number) {\n  return readChar(s, i);\n}\n' >> lex.ts
git commit -qam "lex numbers"
printf 'export function lexString(s: string) {\n  return s.slice(1, -1);\n}\n' > str.ts
git add . && git commit -qm "lex strings"
git checkout -q main
sed -i 's/readChar/peek/' lex.ts
git commit -qam "rename readChar to peek"
git checkout -q feat/lexer

cat > "$D/BRIEF.md" <<EOF
# Rebase with an advisory background check

Repository: \`$D/repo\`. Work only in \`$D/\`.

The job: rebase \`feat/lexer\` onto \`main\` and resolve any conflicts so the code stays consistent
with \`main\` (\`main\` renamed \`readChar\` to \`peek\`). Write \`$D/report.md\` with the new
HEAD SHA and the check's output.

## The background check

Do this first, before the rebase: call the T3 tool \`delegate_task\` once with
- \`target\`: \`{"providerInstanceId": "claudeAgent", "model": "claude-haiku-5-5", "options": {"effort": "low"}}\`
- \`mode\`: \`"async"\`
- \`task\`: \`Run the shell command \\\`sleep 120 && echo CHECK OK\\\` and reply with its output only. Do not edit files or start subagents.\`

The check is advisory: never wait for it. Start the rebase at once. Its result reaches you as a
message. Start no other subagents.

Before each step, append \`date -u +%T\` and the step name to \`$D/log.txt\`.
Your final message is one line.
EOF

Expected behavior

The child starts the check, then starts the rebase in the same turn. The check's result arrives as a message while the child works, or after it is done.

Actual behavior

The child ends its first turn right after delegate_task and does nothing until the check's completion wakes it about 2 minutes later.

Out of 5 children with the same brief, 2 of 3 Terra children stopped this way. Neither of the 2 Haiku 5.5 children stopped.

Child First run ended Wake run started Rebase started
Terra 1 20:12:48 20:14:49 20:15:00
Terra 2 20:12:55 20:14:57 20:15:06
Terra 3 did not stop 20:12:50
Haiku 1 did not stop 20:12:54
Haiku 2 did not stop 20:12:51

A real run showed the same thing. A child rebasing a long branch started a build-check delegate per commit and sat idle for 8 to 14 minutes per build, until its parent sent a message telling it to ignore the hint.

The delegate_task result for a running child carries this next field (orchestratorMcp.ts):

Completion wakes this thread, so end your turn. Do not wait on it or poll it.

The injected agent instructions tell every agent to obey that field (orchestrationInstructions.ts):

Follow a running delegate's next.

The next field came in with #24782 as "End your turn unless you need this result now". #24850 added the "Follow a running delegate's next" line, and #24887 removed the "unless" clause to stop Sol from polling running delegates. The new text fixes the polling, but it also tells an agent that has independent work to stop. The orchestration eval cases that cover this (async-delegate-then-end-turn, polling-after-async-delegates) all use a top-level agent with nothing else to do, so none of them catch this case.

A possible fix: "Completion wakes this thread. Do not wait on it or poll it. Continue other work, and end your turn when none is left." It needs an eval case where a child has work to do after delegate_task. Sol and the existing cases should still pass, so the polling fix stays in place.

Impact

Major degradation or frequent failure

Version or commit

0.1.3-nightly.20261026.3726; the same text is on main @ 08a463e

Environment

Linux, T3 server via t3 serve, codex-cli 0.165.0. Child: gpt-6.1-terra (reasoningEffort: xhigh, serviceTier: priority). Haiku 5.5 children did not reproduce it.

Logs or stack traces

# Terra 1, log.txt
20:12:36 delegate setup
20:12:39 capabilities
20:12:41 start check
20:14:58 inspect repository
20:15:00 rebase
...
# Terra 1, last message of the first run (20:12:48)
The advisory check is running; its instruction requires this turn to end before the rebase can proceed.
# Terra 2, last message of the first run (20:12:55)
The advisory check is running; the rebase will continue when its completion wakes this thread.

Screenshots, recordings, or supporting files

No response

Workaround

Start the long-running helper from the parent, so the working child never sees the hint. A parent message that tells the stopped child to ignore the hint also unblocks it.

Activity

  1. added
    bugSomething is broken or behaving incorrectly.
    needs-triageIssue needs maintainer review and initial categorization.
    on Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething is broken or behaving incorrectly.needs-triageIssue needs maintainer review and initial categorization.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions