Skip to content

Derive multi-agent mode from Ultra effort - #29710

Closed
shijie-oai wants to merge 1 commit into
shijie/ultra-reasoning-effortfrom
shijie/derive-ma-mode-from-ultra
Closed

Derive multi-agent mode from Ultra effort#29710
shijie-oai wants to merge 1 commit into
shijie/ultra-reasoning-effortfrom
shijie/derive-ma-mode-from-ultra

Conversation

@shijie-oai

@shijie-oai shijie-oai commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Why

Once Ultra selects proactive delegation, keeping a second client-selected multi-agent mode creates competing sources of truth across thread start, turn overrides, settings updates, resume, fork, and subagent spawn. Deriving the effective mode from the turn makes the lifecycle deterministic and keeps persisted state limited to the model-visible baseline needed for context updates.

Stack

This PR is stacked on #29709 and contains only the effort-derived multi-agent mode behavior and selector cleanup.

What changed

  • Derive eligible V2 turns as proactive for Ultra and explicitRequestOnly otherwise; V1 and ineligible sources remain without a mode instruction.
  • Remove multiAgentMode from experimental app-server thread, turn, settings, resume, and fork contracts.
  • Remove selected-mode state from session configuration, thread snapshots, resume/fork restoration, and subagent spawn plumbing.
  • Continue persisting only the effective mode in TurnContextItem so incremental updates and cold resume can neutralize older instructions correctly.
  • Verify that a spawned V2 child inherits the invoking turn's Ultra effort and derives the proactive hint.
  • Regenerate app-server schemas and consolidate tests around the effort-derived behavior.

Compatibility

MultiAgentMode and the persisted TurnContextItem.multi_agent_mode field remain readable for existing rollouts. This intentionally removes the experimental client-facing multiAgentMode fields.

Verification

  • V2 Ultra sends backend max and proactive instructions; changing to High sends high and appends an explicit-only reset.
  • V1 Ultra sends backend max without multi-agent mode instructions.
  • Cold resume compares the new turn against the persisted effective mode and emits the correct reset.
  • A real V2 spawn from a per-turn Ultra parent sends the child request as backend max with proactive instructions.
  • codex-app-server-protocol schema and serialization coverage.
  • Built the local CLI and exercised a real stdio app-server against a synthetic V1/V2 Ultra catalog, including process restart/cold resume.

@shijie-oai
shijie-oai force-pushed the shijie/ultra-reasoning-effort branch from 5354cf9 to 9cbc0f5 Compare June 23, 2026 20:45
@shijie-oai
shijie-oai force-pushed the shijie/derive-ma-mode-from-ultra branch from ed31d4f to d057a92 Compare June 23, 2026 20:45
Comment on lines -97 to -102
/// Set the initial multi-agent mode for this thread. `none` leaves the
/// multi-agent tools available without injecting mode instructions.
/// Omitted defaults to `explicitRequestOnly`.
#[experimental("thread/start.multiAgentMode")]
#[ts(optional = nullable)]
pub multi_agent_mode: Option<MultiAgentMode>,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dropping it cause experimental - should have no affect on client (i.e. the contract existence or not)

@shijie-oai shijie-oai Jun 23, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At the thread level, we no longer care about the multi-agent-mode, instead at per turn level we will derive it based on the effective reasoning effort at the turn level to calculate the effective multi-agent mode. (what the base PR is doing)

pub(super) provider: ModelProviderInfo,

pub(super) collaboration_mode: CollaborationMode,
pub(super) multi_agent_mode: MultiAgentMode,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At the session level it no longer has to worry about multi-agent mode cause it is not a setting a client can set/supply at this point.

@shijie-oai
shijie-oai force-pushed the shijie/ultra-reasoning-effort branch from 9cbc0f5 to f922892 Compare June 24, 2026 00:01
@shijie-oai
shijie-oai force-pushed the shijie/derive-ma-mode-from-ultra branch from d057a92 to b4dc539 Compare June 24, 2026 00:18
@shijie-oai
shijie-oai force-pushed the shijie/ultra-reasoning-effort branch from f922892 to 21432e9 Compare June 24, 2026 00:33
@shijie-oai
shijie-oai force-pushed the shijie/derive-ma-mode-from-ultra branch from b4dc539 to f8efe5a Compare June 24, 2026 00:33
@shijie-oai
shijie-oai force-pushed the shijie/ultra-reasoning-effort branch from 21432e9 to adeac5e Compare June 24, 2026 00:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant