[codex] Select multi-agent version from model info#25427
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b52a0177ac
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
95459e6 to
c3c94a7
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c3c94a7d86
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if session_source.is_non_root_agent() { | ||
| None | ||
| } else { | ||
| model_info.multi_agent_version |
There was a problem hiding this comment.
Record model-selected agent version in config locks
When config-lock export/replay is enabled and the remote catalog selects V2 here without the local Feature::MultiAgentV2 flag, the selected version is kept only in the session OnceLock; checked session/config_lock.rs, and the lockfile still serializes features.multi_agent_v2.enabled from config.features only. That means a run that actually exposed V2 tools can export a lock saying V2 is disabled, so replay can still validate after the catalog selector changes and silently run with V1/no multi-agent tools instead of reproducing the original behavior.
Useful? React with 👍 / 👎.
| if session_source.is_non_root_agent() { | ||
| None | ||
| } else { | ||
| model_info.multi_agent_version |
There was a problem hiding this comment.
Avoid rejecting legacy agent limits on catalog V2 rollout
If /models starts returning multi_agent_version: v2 for a model while a user still has the legacy agents.max_threads setting, this line now feeds V2 into effective_agent_max_threads, which returns InvalidRequest whenever agent_max_threads is set. That makes session startup fail purely because server metadata changed, even though the same config remains valid for V1/Collab and the user did not opt into the local V2 feature; the catalog selector should either tolerate/translate the legacy limit or avoid hard-failing existing configs during rollout.
Useful? React with 👍 / 👎.
3448497 to
83733e7
Compare
|
This change is part of the following stack: Change managed by git-spice. |
fc242f4 to
c64b39a
Compare
1e3ffb7 to
78392f2
Compare
c64b39a to
55c8a1f
Compare
78392f2 to
37cfac7
Compare
55c8a1f to
374a4cd
Compare
4711035 to
96b9001
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 28d732dd4d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| conversation_history | ||
| .get_multi_agent_version() | ||
| .or(inherited_multi_agent_version) | ||
| .or(model_info.multi_agent_version) |
There was a problem hiding this comment.
Keep legacy rollouts on their original runtime
When resuming a thread whose rollout predates persisted SessionMeta.multi_agent_version, conversation_history.get_multi_agent_version() is None, so this newly added catalog fallback can lock the thread to whatever /models returns today. If the backend starts advertising multi_agent_version: v2 for a model, an older thread that was created with the V1 multi_agent_v1 tool surface will resume as V2 and expose the plain V2 tools, even though its existing context can contain V1 tool calls/outputs; for these legacy rollouts the safer fallback is the feature-derived runtime that was in effect before model metadata existed, or another compatibility inference from the stored history.
Useful? React with 👍 / 👎.
b988045 to
384d095
Compare
28d732d to
17286f8
Compare
17286f8 to
d6b9156
Compare
Why
#25351 locks the selected multi-agent runtime per thread. Feature flags remain the fallback for fresh threads, but backend model metadata also needs to select the runtime for models that opt into a specific system.
What changed
multi_agent_versionmetadata toModelInfo. Omitted or unrecognized metadata behaves as absent, preserving feature-flag fallback and allowing older clients to tolerate future selector values.V2parent remainsV2when spawning a child whose selected model advertisesV1.Disabledinheritance authoritative for review and guardian delegates, so a model advertisingV2cannot re-enable multi-agent tools for them.Test plan
CI only, per repository workflow.
Added end-to-end remote-model integration coverage using the real
/modelsmock and real agent flows:V2while only theV1feature is enabled; its child model advertisesV1, but the spawned child inherits the parentV2lock.Disabledwhen its selected model advertisesV2.Added deserialization coverage that treats an unknown
multi_agent_versioncatalog value as omitted.Stack
Depends on #25351.