Skip to content

Stream what a Codex subagent is doing, let Claude message it mid-task, and run it at the effort Claude asks for - #126

Merged
m4rocks merged 4 commits into
mainfrom
subagent-live-and-effort
Nov 18, 2026
Merged

m4rocks merged 4 commits into
mainfrom
subagent-live-and-effort

Conversation

@m4rocks

@m4rocks m4rocks commented Nov 18, 2026

Copy link
Copy Markdown
Owner

Summary

A Codex subagent looked stuck. While it ran, its view showed only the text of its replies and the start of each tool call. Codex's reasoning, plans, tool status and command output were dropped in claudiu --acp, so a run that spent minutes thinking or running commands showed nothing. A message Claude sent to a running Codex subagent also waited until the subagent finished. And Codex always ran at the effort in ~/.codex/config.toml, whatever effort Claude asked for.

  • Streaming: the helper now passes on reasoning, plans, tool status and command output, and the subagent's view streams them. The main conversation gets one line per plan or tool step, plus a startup line that warns the first run may wait on an npm download. Color codes are stripped from command output.
  • Messages mid-task: the mod takes Claude's message to a running Codex subagent through session.receive and writes it to a per-run file under Claudiu's data folder, which the helper polls. The helper sends it to Codex with _session/steering, or as a follow-up prompt in the same ACP session when Codex's turn has ended. The helper acknowledges a message only once Codex has it. Otherwise the mod gives the message back to Claude Code, which sends it as a follow-up the usual way. OpenCode gets the same delivery when its adapter supports steering.
  • Effort: the effort Claude gives in its Agent call reaches Codex as model_reasoning_effort. max becomes xhigh, since Codex has no max. Without one, Codex keeps the user's own config. OpenCode doesn't get it, because its effort is a per-model option of each provider.

Evidence

  • cargo clippy --locked --all-targets -- -D warnings is clean, cargo test --locked passes 515 tests (7 ignored), and claude plugin test mod passes 26.
  • Each of these tests fails without its fix:
    • a message isn't acknowledged when the agent exits before taking it, or refuses the steer and exits;
    • colored output loses its codes;
    • a respawn with a new effort uses it;
    • a first turn that starts before its spawn hook returns still gets its Agent call's effort.
  • Other Rust tests cover reasoning, plans and tool output streaming, steering during a quiet turn, the same-session follow-up, and the inbox rejecting partial, oversized, out-of-order and replayed messages.
  • GPT Sol reviewed the diff over three rounds. Its blockers and shoulds are fixed, apart from the ones listed under Risk.

Risk

  • Nobody has tried this in a live Claude Code session. Steering uses codex-acp 2.6.0's _session/steering extension. If that changes, messages fall back to the queued follow-up.
  • On a long run, the main conversation gets one status line per tool step, which could be noisy.
  • Known gaps, left out of scope:
    • OpenCode's shell output arrives only when a command finishes, because its adapter sends none while it runs;
    • output from tools that run at the same time shares one heading;
    • a message can be lost if the adapter exits right after being sent the follow-up prompt.
  • To undo, revert the branch's commits.

@vercel

vercel Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
claudiu Ready Ready Preview Nov 18, 2026 1:09pm UTC

@m4rocks
m4rocks merged commit f20b573 into main Nov 18, 2026
5 checks passed
@m4rocks
m4rocks deleted the subagent-live-and-effort branch November 18, 2026 13:22

This branch was successfully deployed

1 active deployment
Preview — 91ce2f9c Deployed Nov 18, 2026 by vercel[bot]
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