Skip to content

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 #587

Description

@bretttully-vh

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: null while 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

  1. 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/set calls behind an env flag (default off) as a containment patch.
  2. Expose a thread/goal/clear API. 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

  1. Bootstrap the resident triad (three role threads) with the stock resident-ensure.mjs.
  2. Assign no work to reviewer/researcher threads.
  3. Observe rollouts: goal turns start unprompted and re-arm continuously; thread status remains idle throughout.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions