openai / openai/codex-plugin-cc
Resident roles: charters installed as standing goals make unassigned threads self-run turns (codex >=0.146); please make goal installation opt-in + add thread/goal/clear
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 33.3k
- Forks
- 2.3k
- PR merge metrics
- No merged PRs in 30d
Description
Summary
scripts/lib/resident-ensure.mjs unconditionally installs each resident role charter as a standing thread goal (thread/goal/set) in both startRoleThread and resumeRoleThread. Under codex CLI >= 0.146 (where the app-server auto-starts goal turns from standing objectives), this causes resident role threads to run turns nobody assigned:
- A role charter is a non-terminating objective — it can never be satisfied — so the runtime re-arms a new goal turn within milliseconds of each completion (we observed 2–9 ms).
- Unassigned resident threads (e.g. a reviewer/researcher role that has received no work) self-run autonomous turns indefinitely. In our deployment, idle role threads self-ran for ~2.5 weeks; rollout files grew to ~1.4 MB per thread with zero assignments.
- Worse, a goal turn can start concurrently with an actual assigned task turn on the implementer thread, producing a two-writer hazard inside a single working directory (we observed duplicated edits from overlapping turns in one repo checkout).
- Broker/thread status reports
idle/activeTurnId: nullwhile these goal turns are executing, so the behavior is invisible to normal supervision.
Note the goal-set signature predates 0.146 in our logs — 0.146's auto-start changed the severity, not the mechanism.
Asks
- Make standing-goal installation opt-in (config/env flag), or stop installing role charters as goals entirely — a charter is descriptive context, not a completable objective. We have locally gated both
thread/goal/setcalls behind an env flag (default off) as a containment patch. - Expose a
thread/goal/clearAPI. Today there appears to be no way to remove a standing goal from a thread; that blocks the cleaner end-state of setting a per-task terminal goal at dispatch time and clearing it on completion.
Environment
- codex-cli 0.146.0 (model gpt-5.6-sol), plugin codex@openai-codex v1.0.6, resident triad via the broker daemon
- macOS (Darwin 25.5), Claude Code 2.1.220 host
Repro sketch
- Bootstrap the resident triad (three role threads) with the stock
resident-ensure.mjs. - Assign no work to reviewer/researcher threads.
- Observe rollouts: goal turns start unprompted and re-arm continuously; thread status remains
idlethroughout.
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 in scripts/lib/resident-ensure.mjs and inspect the thread/goal/set calls in startRoleThread and resumeRoleThread. Reproduce the idle resident-thread behavior from the bootstrap steps, then trace the available thread-goal API. Done means role-charter goal installation is opt-in with the stated default and a thread/goal/clear path is exposed or the issue's requested alternative is implemented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- backend, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100