Repository navigation
Description
Situation
This came from agent-filed user feedback. A parent agent cannot continue a coding session through either the subagent tool or summon. The expected behavior is continuation or an actionable explanation that the session remains busy.
Symptom
The reporter observed codex thread is already bound when resuming a coding subagent after its parent turn ended. Both the subagent tool's resumeSessionId and system:summon with the same Rome sessionId failed.
The source error template is codex thread is already bound: <thread-id>. Parent-turn completion alone is not sufficient to cause this error. The conflicting binding must still exist when another model session opens.
How to reproduce
Not executed during this read-only investigation. The controlled schedule below derives from the code and isolates the remaining shutdown overlap.
- Derived from code: Use an isolated fixture with real
createSessions, recorded sessions, andCodexAppServerManager. Use a fake transport that returns distinct thread IDs on start and the requested ID on resume. - Reporter-provided sequence: Invoke the coding subagent through its native subagent tool. Let its turn and the parent turn complete. Retain the tool's structured
sessionId. - Derived from code: Begin closing the parent. Hold its child-manager shutdown behind a barrier, leaving the real child session and its Codex binding alive. Allow the parent's model event stream to end.
- Derived from code: Reopen the same parent continuity key before releasing that barrier. The early close callback has removed the old parent, so this opens another parent with an empty child manager.
- Reporter-provided operation, code-derived timing: Call the coding subagent tool with the retained
resumeSessionId. It cold-opens the recorded child and reaches the duplicate-binding guard. Independently repeat withsystem:summon, passingagentName: "coding:coding"and the retained ID assessionId. - Derived control: Release shutdown and await disposal before retrying. Also check that a native resume through the original, still-live parent reuses its child instead of opening another binding.
A simpler summon-only control needs no shutdown barrier: resume an idle native child through summon while its original parent still owns it.
Initial triage
- The exception is local, not a provider quota or database error.
openThreadsendsthread/resume, checks the returned ID, then throws if that ID already exists in its binding map. Binding removal waits for unsubscribe completion. Guard and registration, binding release. - Live ownership is manager-local. Each manager has its own session map and acquire locks. Each parent creates a separate child manager. Resume by ID resolves the stored continuity key but only acquires through the receiving manager. Local maps, child manager, resume lookup.
- Both reported surfaces reach that ownership gap. The native tool resumes through its parent's child manager. Summon resumes through the bridge's top-level manager, which does not locate the live child in another manager. Native port, summon acquisition.
- Parent removal precedes child disposal. The model events loop marks the parent closed and calls
onClosed. Explicit close shuts down children afterward. A new parent can therefore acquire the same recorded child while its old owner retains the binding. Early callback, close ordering. - Main contains a related fix, not a complete fix for this path. Closed #2192 and merged #2193, commit
78beb24468ab43636edd509c74527559a3819336, prevent an old callback from evicting a reopened parent. They leave early removal and child-shutdown overlap intact. The regression creates an empty child manager and checks parent reuse, not continuation of a real child during shutdown. Regression coverage. - History contains no matching open duplicate. Closed #246 proposed cross-manager live-turn protection, but PR #251 closed without merging. The current resume path has no such protection. The Codex manager/provider and native subagent resume wiring are unchanged since the reporter build.
Suspected root cause
Confidence: high — Session acquisition coordinates ownership within each manager, while Codex bindings are shared across managers. Early parent removal permits another parent and child manager to open before the old child releases its binding. Both native resume from that reopened parent and summon can then cold-open the same recorded Codex thread. The shared guard correctly rejects the second binding, but Rome provides neither owner-aware reuse nor an actionable closing-state response. This is a code-proven sufficient cause, not a claim that the report establishes the exact production interleaving or that every parent-turn completion causes failure.
Possible fixes
- Keep a parent registered as closing until child shutdown settles. Coordinate the events-loop callback with explicit close so acquisition waits through
closeSettled(). Preserve cleanup when the events loop fails without an explicit close. - Coordinate live session ownership across managers. Route a resume to its existing owner, or return a structured busy/closing response before issuing another provider resume.
- Extend regression coverage with a real child held across parent shutdown and with summon resuming an idle native child. Preserve recorded thread identity and the duplicate-binding guard. Do not overwrite bindings or silently create a replacement worker.
Environment
- Rome 1.1.194, commit
8a71a43a9f27ab14f86de5cbe852d3190f06a31e, built 2026-11-13T16:31:53Z. - Reporter build is 40 commits behind inspected main
b5aa4ec906b8577ff598c1d7f9ac27feff74989e. - Agent-filed bug report from the main agent. No route, browser user agent, viewport, subject, theme, mode, or language supplied. Browser family and viewport class are unknown.
- Database healthy. Twenty apps, with no failed or broken entries.
- Uptime 71,607 seconds. Upgraded since last boot: true. Previous version: 1.1.193. These diagnostics do not establish a restart during the affected work.
- Relay and deposit URL configured. Connected channels: email, Telegram, Discord, agents, Feishu, and webchat. Neither relay nor channel delivery produces this binding error.
Triage confidence: high — The source proves a remaining child-shutdown overlap: the parent leaves its manager before its children release their shared Codex bindings. Both resume surfaces can cold-open that same recorded child, reaching the exact local guard. PR #2193 fixes late parent eviction but leaves this overlap and cross-manager summon acquisition intact. Suggested priority: P2. Estimated size: medium.
Source: Rome Cloud user feedback, submitted 2026-11-14T15:06:05.128394Z, build 1.1.194. Analyzed against b5aa4ec906 (main); reporter build commit 8a71a43, 40 commits behind main. Filed automatically by Feedback Triage.
Activity