Skip to content

Preserve model providers when reloading v2 agents - #36906

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/6401d9f0d1c116e9954e3bd193d016f04da5f223
Aug 4, 2026
Merged

Preserve model providers when reloading v2 agents#36906
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/6401d9f0d1c116e9954e3bd193d016f04da5f223

Conversation

@copyberry

@copyberry copyberry Bot commented Aug 4, 2026

Copy link
Copy Markdown

Preserve model providers when reloading v2 agents

Why

Reloading an unloaded v2 agent could inherit the model provider from the
agent that triggered the reload, even though the worker's model was restored
from its persisted thread state.

What changed

  • Restore both the model and model provider from the stored thread when
    reloading a v2 agent.
  • Return an invalid-request error if the stored provider is no longer present
    in the configured provider map.

Testing

Extend the v2 agent reload test to trigger the reload with a different sender
provider and verify that the worker retains its stored provider.

## Why

Reloading an unloaded v2 agent could inherit the model provider from the
agent that triggered the reload, even though the worker's model was restored
from its persisted thread state.

## What changed

- Restore both the model and model provider from the stored thread when
  reloading a v2 agent.
- Return an invalid-request error if the stored provider is no longer present
  in the configured provider map.

## Testing

Extend the v2 agent reload test to trigger the reload with a different sender
provider and verify that the worker retains its stored provider.

GitOrigin-RevId: 6401d9f0d1c116e9954e3bd193d016f04da5f223
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/6401d9f0d1c116e9954e3bd193d016f04da5f223 branch from 6531c15 to d1f14e3 Compare August 4, 2026 15:02
@copyberry
copyberry Bot merged commit d1f14e3 into main Aug 4, 2026
30 of 32 checks passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/6401d9f0d1c116e9954e3bd193d016f04da5f223 branch August 4, 2026 15:03
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 4, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants