Skip to content

Changing a plugin's skills replaces every idle Codex thread's runtime at its next turn and kills the thread's background commands #6301

Description

@Pryapus

bb 0.46.0, macOS, Codex provider (gpt-6.1-sol), about 40 Codex threads on one machine.

What happens

Installing a plugin that contributes a skill, or editing that plugin's skills, changes the injected skill catalog hash. At each Codex thread's next new turn, the host daemon's runtime manager compares the environment's skillCatalogHash with the new catalog. If the entry has no active runtime work and no in-flight command for the thread, it calls replaceEntryForSkillCatalog, which shuts down the environment's runtime. The thread's provider bridge and Codex app-server are replaced; the thread resumes from its rollout (thread/identity, then account/updated, then provider.env-resolved).

Every process the agent started from its Codex shell tool goes down with the old app-server, including nohup cmd & watchers. bb does not count these as active runtime work, because they are not bb background tasks. A thread that sits between turns while its watchers run is therefore always replaced.

Evidence (2026-10-25, times UTC)

  • 16:34:46 plugin [email protected] loaded. Thread A rebuilds at 16:53:23, its first new turn after that.
  • 21:46:50 plugin [email protected] loaded (first install, declares a skill). Threads A, B and C rebuild at 21:47:08, 21:56:42 and 22:06:37: each thread's first new turn after the install. Steers into a running turn never rebuilt.
  • 22:07:39 the plugin's skills/ directory changed. Threads C, A and B rebuild again at 22:11:09, 22:12:32 and 22:12:38: again each thread's first new turn after the change.
  • Thread B had run one Codex runtime from 09:26 to 21:56 with no rebuild, across about 35 provider-codex host-plugin-worker restarts. So the worker restarts are not the trigger.
  • The execution settings (model, reasoning level, permission mode, service tier) were identical before and after every rebuild. No provider/error was recorded. Codex pool routing was off. The in-bridge rebuild reasons in provider-codex (rebuildBeforeNextTurnReason, construction signature) do not apply.
  • After each rebuild the thread has a new bridge node process and a new codex app-server, both started in the same second.
  • Background watchers started with nohup in these threads vanished at the rebuild times without recording an exit. In a local probe, a watcher started in its own session (setsid after a double fork) survived a kill of the launching session's process group, while a nohup watcher did not.

Controlled repro (2026-10-26, UTC)

One throwaway Codex thread and one skill-only throwaway plugin; every step a new turn.

  • 03:59:36, new turn with the catalog unchanged: app-server and bridge kept the same pids.
  • 04:00:45, bb plugin install of the skill-only plugin.
  • 04:00:55, next new turn: app-server and bridge both replaced (new pids, started 04:00:56), with the same thread/identity, account/updated, provider.env-resolved sequence as above.
  • A watcher started in its own session survived the replacement.

Expected

A skill catalog change does not kill work a thread is doing between turns. Options, in order of preference:

  1. Apply the new skill roots to the running Codex app-server (skills/extraRoots/set already exists in the bridge) instead of replacing the runtime.
  2. If a replacement is required, treat processes the provider started (the app-server's process tree) as active runtime work, the same as an in-flight command, and keep the retained-catalog path until they exit.
  3. At minimum, show a runtime note on the thread ("runtime replaced after a skill change; background commands started by the agent were stopped").

Workaround

Start long-lived background commands in their own session (setsid after a double fork) so the app-server shutdown does not reach them.

Activity

  1. added theissue type on Oct 26, 2026
  2. added
    host
    providers
    provider-codex
    confirmed-repro
    on Oct 26, 2026
  3. bb-slop-cop commented on Oct 26, 2026

    @bb-slop-cop
    Contributor

    🚨 SLOP COP 🚨 · new-issue-autopilot

    • Classification: Bug · High priority · Medium effort. Applied labels: host, providers, provider-codex, confirmed-repro; no existing classifications were replaced.
    • Report: https://get-bb.github.io/reports/issues/6301.html
    • Verdict: REPRODUCED · high root-cause confidence. Two clean trusted-main checkouts reproduce process termination using the production Codex bridge and a trusted test app-server; this is not a live macOS/Codex shell-tool run.
    • Root cause: idle catalog invalidation shuts down the entire runtime. Provider descendants are absent from active-work accounting and are terminated by process-group cleanup.
    • Evidence: the unchanged-catalog control survives; the changed-catalog survival assertion fails in both runs. All 45 existing manager tests and both complete builds pass.
    • No PR: safely refreshing skills spans daemon catalog lifetime and agent-runtime process/session identity, failing the single-subsystem simple-fix requirement.

    AGENT GENERATED

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-reprohostprovider-codexproviders

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions