Expose thread-level multi-agent mode#28792
Conversation
511fa89 to
1f54314
Compare
f0b05d4 to
5a272c7
Compare
1f54314 to
5d78618
Compare
5a272c7 to
a113393
Compare
5d78618 to
ddb088f
Compare
a113393 to
180fa9b
Compare
ddb088f to
a50ab75
Compare
180fa9b to
07d718f
Compare
a50ab75 to
ec2f4a9
Compare
f4d3cce to
c992e15
Compare
ec2f4a9 to
9ac7c38
Compare
c992e15 to
6a0aad7
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6a0aad7247
ℹ️ 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".
| let multi_agent_mode = | ||
| initial_multi_agent_mode.or_else(|| conversation_history.get_multi_agent_mode()); |
There was a problem hiding this comment.
Preserve selected mode across cold resume
When thread/start.multiAgentMode is supplied, this only seeds the live session; cold resume reconstructs the setting from conversation_history.get_multi_agent_mode(), which reads the persisted effective turn mode rather than the selected thread mode. In inspected app-server resume/fork paths, this means a thread started with proactive can later resume as null if it had no turns or as explicitRequestOnly/null when the selected mode was not applicable or was downgraded for the turn, so clients cannot recover the selected thread-level mode the new lifecycle API promises. Persist and restore the selected mode separately from the effective model-visible mode.
AGENTS.md reference: AGENTS.md:L103-L110
Useful? React with 👍 / 👎.
Why
Once multi-agent mode can be selected per turn, clients also need to choose the initial selection when creating a thread and observe that selection through lifecycle and settings APIs.
The selected value is intentionally distinct from the effective model-visible value: no client selection is represented as
null, even though an eligible multi-agent v2 turn derivesexplicitRequestOnlyas its effective default.What changed
thread/start.multiAgentModeparameter and pass it through thread creation.explicitRequestOnly.thread/startselection to the first turn through the session configuration established at thread creation.multiAgentModefromthread/start,thread/resume,thread/fork, and thread settings, usingnullwhen no mode is selected.Not covered
turn/start; omitted ornullcurrently retains the session's selection.config.tomlpreference.Verification
CARGO_INCREMENTAL=0 just test -p codex-app-server-protocolCARGO_INCREMENTAL=0 just test -p codex-app-server multi_agent_modeThe focused app-server coverage verifies explicit
thread/startinitialization, first-turn prompting, nullable reporting for an omitted selection, and retention of selections that are not currently runtime-eligible.Stack
Stacked on #28685. This PR contains only the thread initialization and lifecycle/settings API layer.