Repository navigation
fix(core): hand chat coding work to the coding agent as a subagent - #1303
Conversation
The main agent started coding work through the coding:coding_task action, which only forwards to summon. The chat showed "Using Coding" and nothing else until the run ended (rome#1272). The main agent now lists coding:coding in allowedSubagents and its prompt points coding work there. The chat shows the coding agent's progress the way it shows other subagents, and a follow-up in the same chat passes the earlier sessionId as resumeSessionId to continue the same session. The coding_task action stays. Routines, workflows, and the dream agent call it, and they cannot delegate to a subagent. Its progress in a calling chat is a separate fix. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
yunfanye
left a comment
There was a problem hiding this comment.
Code Review: ✅ APPROVE
The PR routes chat coding work through the existing subagent mechanism, preserves the action for other callers, and documents session resumption. Both changed files and the relevant loading, execution, ownership checks, and tests were reviewed.
Tests could not run because this checkout lacks dependencies (rstest was unavailable).
Verdict: APPROVE — The change reuses existing subagent infrastructure without introducing actionable correctness or security issues.
No issues found. Code looks good!
Automated review by RomeOS Code Review · commit 1fe65d5 · Full review history
Jessie-QingYu
left a comment
There was a problem hiding this comment.
Code Review: ✅ APPROVE
The PR adds coding:coding to the main agent's allowedSubagents and changes its system prompt so chat coding work goes to the coding subagent instead of coding:coding_task. The coding:coding_task action only forwards to summon. The docs paragraph is updated to match. I checked the parts of the code this touches:
- Subagent tool:
buildSubagentToolsin agent-session.ts exposes aresumeSessionIdfield, andSubagentCompletionreturnssessionIdto the model. The prompt's instruction to pass the earliersessionIdasresumeSessionIdmatches the real interface. - Resume rules:
subagent-execution.tsonly resumes a session of typesubagentwith the same parent chat and project, as the PR describes. - Boot:
deriveCoreRequiredAppsresolvescoding:codingto thecodingapp, which is already inALWAYS_REQUIRED. When the app is missing,agent-loaderdrops the subagent with the "core agent loaded without unknown subagent" warning instead of failing to load. - Behaviour vs.
summon: both paths run the coding agent with its owncoding.yamlconfig, in the caller's project folder, and pass along the shared context. - Other callers: the dream agent, routines and the hook that starts the coding agent through
agentRunnerdon't touch this path. The root-script grant test still holds, becausecodinghasactions: ["*"]but not the explicit root-script grants.
The architecture direction is sound: it reuses the existing subagent mechanism instead of building a second way to report progress, and it keeps the action for callers that can't use a subagent. I found no correctness or security problems. Both findings are about the wording the model sees:
- During the transition, a chat may have earlier coding work that was started through
coding_task. Its session id will be rejected asresumeSessionId, and the prompt doesn't say what to do then. - The prompt's reason for the change ("sees its progress live") overstates what the chip shows today; the PR itself defers live steps to #1302.
Verdict: APPROVE — The change is small and uses the existing subagent mechanism correctly; the coding app is already required, so boot and grant checks hold. The two findings are minor prompt-wording improvements.
2 finding(s) posted as inline comments below.
| Severity | Category | File | Title |
|---|---|---|---|
| P2 | design | packages/core/agents/main.yaml |
No resume guidance for coding sessions started through coding_task |
| P3 | code-quality | packages/core/agents/main.yaml |
Prompt says progress shows live, but the chip only shows Thinking… |
| - coding:coding: Complex coding work, such as building or changing an app | ||
|
|
||
| For complex coding work, you may delegate to the coding agent through the `coding:coding_task` action when it helps. | ||
| Hand coding work to the coding:coding subagent, not the `coding:coding_task` action, so the guardian sees its progress live. For a follow-up on earlier coding work in this chat, pass the coding subagent's earlier `sessionId` as `resumeSessionId`, so it continues the same session. |
There was a problem hiding this comment.
[P2] design — No resume guidance for coding sessions started through coding_task
startSubagent rejects a resumeSessionId unless the stored session has type === "subagent" and the same parent chat. A coding session started through coding_task/summon fails both checks. After the upgrade, a chat that already holds coding work from coding_task will either fail the resume or quietly start a fresh coding session, so the earlier coding context is lost. Add one sentence to the prompt, e.g. "If the earlier coding work in this chat ran through coding:coding_task, continue it with that action and its sessionId instead."
| - coding:coding: Complex coding work, such as building or changing an app | ||
|
|
||
| For complex coding work, you may delegate to the coding agent through the `coding:coding_task` action when it helps. | ||
| Hand coding work to the coding:coding subagent, not the `coding:coding_task` action, so the guardian sees its progress live. For a follow-up on earlier coding work in this chat, pass the coding subagent's earlier `sessionId` as `resumeSessionId`, so it continues the same session. |
There was a problem hiding this comment.
[P3] code-quality — Prompt says progress shows live, but the chip only shows Thinking…
The PR defers live steps to #1302: while the subagent runs, the chip shows only "Thinking…". Saying the guardian "sees its progress live" overstates this. A neutral reason avoids the model repeating that claim to the guardian, for example: "so the chat links and shows the coding run".
What this PR does
The main agent handed coding work to the coding agent through the
coding:coding_taskaction, which only forwards tosummon. While a coding task ran, the chat showed "Using Coding" and nothing else until it returned, so a multi-minute hand-off looked stuck (#1272).The main agent now delegates coding work to
coding:codingas a regular subagent. The chat shows the same subagent chip it shows for other subagents: "Thinking…" while it runs, steps and duration when it ends, and a click opens the coding agent's trace. A follow-up in the same chat continues the same coding session.Closes #1272.
Design & Invariants
coding:coding_taskaction stays. Routines, workflows, and the dream agent call it, and they cannot call a subagent. Removing it would break every stored routine that names it. Its own progress in a calling chat is separate work.Alternative considered: keep the action and make any action-started agent report into the calling chat. That covers routines too, but keeps two hand-off paths for chat. The 2026-10-22 sync chose the subagent path, and the action path stays as follow-up work.
Test plan
execute_action. The chip shows "coding Thinking…" 9 s after send and "coding 1 step · 7.6s" at the end.mainlists the coding subagent once the coding app has loaded. Before that, boot logs "core agent loaded without unknown subagent coding:coding" a few times, which is the existing skip-until-the-app-loads behavior.summon, so it still shows no progress. New chats are fine. Tracked in codex: a resumed chat keeps its first tool list, so subagents added later never reach the agent #1301.Exercised in
pnpm dev:all(provider openai / gpt-6.1-sol, headless Chrome at 1440×900), plus the core-required, agent-loader, agent-grants, and subagent-execution unit tests. Claude was not run.Screenshots (desktop)
Not in this PR
coding:coding_taskrequest).🤖 Generated with Claude Code