openai / openai/codex-plugin-cc
Buffered thread/started notifications can drop subagent names and log raw thread IDs
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 33.3k
- Forks
- 2.3k
- PR merge metrics
- No merged PRs in 30d
Description
Bug
When a task spawns a subagent early enough, the job log can lose the subagent name and fall back to raw thread IDs like thr_2.
Reproduction
- Run a task that quickly spawns a subagent / collaboration tool turn
- Inspect the resulting job log
- Observe entries like:
Starting subagent thr_2 via collaboration tool: wait.Subagent thr_2 reasoning: ...
Instead of the expected nickname / label (for example design-challenger).
Root Cause
captureTurn() buffers notifications that arrive before the main turn ID is known. During replay, buffered notifications are filtered through belongsToTurn(...).
That works for turn-scoped items, but it is too strict for thread lifecycle notifications like:
thread/startedthread/name/updated
If one of those arrives early for a subagent thread, it can be dropped before label registration happens. Later log rendering then has no thread label and falls back to the raw thread ID.
Impact
- Logs and progress output become harder to understand.
- Subagent labeling is unstable and depends on event timing.
- Any future behavior that depends on stored thread labels can inherit the same race.
Suggested Fix
Replay buffered thread lifecycle notifications unconditionally before applying turn-scoped filtering to the remaining buffered messages.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing captureTurn() and belongsToTurn(...), then inspect how buffered thread/started and thread/name/updated notifications are replayed. Reproduce the early-subagent case and verify that lifecycle notifications register the nickname before job-log rendering, without changing turn-scoped filtering for other messages.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100