Skip to content

Keep sub-agent spawns on the provider a live model switch picked - #474

Merged
TheGreatAxios merged 2 commits into
mainfrom
codex-subagent-live-provider
Aug 17, 2026
Merged

Keep sub-agent spawns on the provider a live model switch picked#474
TheGreatAxios merged 2 commits into
mainfrom
codex-subagent-live-provider

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Collaborator

Closes CL-5902.

Problem

Switching models mid-session updated the parent session but not the sub-agent wiring. The provider, model catalog, and settings a spawn reads were three snapshots taken once at session start, each relying on every switch path to remember to refresh it — and the model picker's switch handler refreshed none of them.

Observed live while driving a fleet: the parent moved to a healthy provider, workers kept spawning against the exhausted one, and the only recovery was restarting the session. The same staleness hid mid-session tier settings from workers, and a session that started with no settings could never see any.

Fix

Provider, catalog, and settings all derive from the live session config at spawn time, through a single owner. The mutable snapshots are gone, so there is no cache left for a future switch path to forget.

Verification

  • Full suite 4550 pass / 0 fail; typecheck and build clean.
  • The regression tests were checked against reintroduced snapshot behavior and fail there, so they genuinely guard the fix rather than only exercising the new helper.

Note on scope

This branch is the remainder of the follow-up round after PRs #470–473 landed the same four issues from another session. Everything already on main was dropped; only this fix was unique.

Provider, catalog, and settings were three snapshots seeded once at
session start, each relying on every switch path to remember to
refresh it. A mid-session model switch refreshed none of them, so
workers spawned afterward kept running against the provider the
operator had already switched away from, and tier settings written
mid-session stayed invisible. All three now derive from the live
config binding on each spawn, so no cache is left to go stale.
@linear-code

linear-code Bot commented Aug 10, 2026

Copy link
Copy Markdown

CL-5902

@TheGreatAxios
TheGreatAxios merged commit 2c4643b into main Aug 17, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant