Skip to content

session: keep startup prewarm aligned with resolved multi-agent runtime#25841

Merged
jif-oai merged 1 commit into
mainfrom
jif/nit-5
Jun 2, 2026
Merged

session: keep startup prewarm aligned with resolved multi-agent runtime#25841
jif-oai merged 1 commit into
mainfrom
jif/nit-5

Conversation

@jif-oai

@jif-oai jif-oai commented Jun 2, 2026

Copy link
Copy Markdown
Collaborator

Why

Follow-up to #25722. Startup prewarm builds a preview TurnContext before the first real turn so it can precompute the initial prompt and tool surface. After the per-thread runtime work landed, that preview path still recomputed multi-agent mode from model_info and feature defaults instead of reusing the runtime the session had already resolved from persisted metadata or inheritance.

That could leave the prewarmed session primed for a different multi-agent mode than the first real turn, which is especially risky because collaboration tool exposure depends on turn_context.multi_agent_version.

What changed

  • In the TurnMultiAgentRuntime::Preview path, prefer Session::multi_agent_version() when it is already known.
  • Only fall back to model_info.multi_agent_version and feature defaults when the session has not resolved a runtime yet.
  • Keep preview mode read-only: this still avoids storing a runtime during startup prewarm.

Testing

  • Not run (small runtime-selection follow-up)

@jif-oai jif-oai requested a review from a team as a code owner June 2, 2026 12:32
@jif-oai

jif-oai commented Jun 2, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@jif-oai jif-oai changed the title nit: small nit session: keep startup prewarm aligned with resolved multi-agent runtime Jun 2, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

Codex Review: Didn't find any major issues. Bravo.

ℹ️ 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".

@jif-oai jif-oai merged commit 3cf6f08 into main Jun 2, 2026
24 of 29 checks passed
@jif-oai jif-oai deleted the jif/nit-5 branch June 2, 2026 12:35
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 2, 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.

1 participant