Skip to content

feat: persist and inherit per-thread multi-agent runtime#25708

Closed
jif-oai wants to merge 5 commits into
mainfrom
jif/ma-persistence-and-catalog
Closed

feat: persist and inherit per-thread multi-agent runtime#25708
jif-oai wants to merge 5 commits into
mainfrom
jif/ma-persistence-and-catalog

Conversation

@jif-oai

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

Copy link
Copy Markdown
Collaborator

Why

multi_agent_version was effectively a live feature-flag decision. That meant a thread could switch runtimes when it was resumed, forked, or spawned under different config than the one that created it, and it made model-catalog runtime selectors unreliable if the user changed models before the first real turn. The result was drift in tool surfacing, interrupt history markers, usage-hint filtering, and thread concurrency limits.

What changed

  • Added MultiAgentVersion to rollout SessionMeta and model-catalog ModelInfo, plus helpers to recover it from stored history.
  • Resolve the runtime from the selected model on the first real turn, persist it once for non-ephemeral threads, and treat legacy resumed/forked histories with no recorded runtime as V1.
  • Thread start/resume/fork/spawn and agent-job worker flows now inherit the resolved runtime and use it consistently for tool gating, usage-hint behavior, parent notifications, interrupt markers, and max-thread calculations.
  • Added ThreadStore::set_multi_agent_version_if_unset so older rollouts can be backfilled without rewriting thread history wholesale.

Testing

  • Added coverage in core/tests/suite/model_runtime_selectors.rs, app-server/tests/suite/v2/thread_resume.rs, app-server/tests/suite/v2/thread_fork.rs, core/src/session/tests.rs, and thread-store/src/local/mod.rs.

@jif-oai jif-oai requested a review from a team as a code owner June 1, 2026 22:35
@jif-oai jif-oai changed the title feat: ma persistence and catalog feat: persist and inherit per-thread multi-agent runtime Jun 1, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f8aa631734

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

Comment thread codex-rs/core/src/session/mod.rs
Comment thread codex-rs/core/src/thread_manager.rs Outdated
Comment thread codex-rs/core/src/session/mod.rs
jif-oai added a commit that referenced this pull request Jun 2, 2026
Stack split from #25708. Original PR intentionally left open. This first
PR adds the multi-agent runtime metadata types and catalog plumbing used
by the rest of the stack.
jif-oai added a commit that referenced this pull request Jun 2, 2026
Stack split from #25708. Original PR intentionally left open. This
second PR persists multi-agent runtime metadata through thread creation,
rollout recording, and thread storage.
jif-oai added a commit that referenced this pull request Jun 2, 2026
Stack split from #25708. Original PR intentionally left open. This third
PR resolves the effective per-thread multi-agent runtime from persisted
metadata, inherited runtime, and current model selection.
jif-oai added a commit that referenced this pull request Jun 2, 2026
Stack split from #25708. Original PR intentionally left open. This
fourth PR adds coverage that remote model multi-agent runtime selectors
override local feature flag defaults.
@jif-oai jif-oai closed this Jun 2, 2026
jif-oai added a commit that referenced this pull request Jun 2, 2026
Stack split from #25708. Original PR intentionally left open. This fifth
PR adds coverage that a remotely selected multi-agent runtime is applied
when the model is selected before the first turn.
dkropachev pushed a commit to dkropachev/codex that referenced this pull request Jun 9, 2026
Stack split from openai#25708. Original PR intentionally left open. This first
PR adds the multi-agent runtime metadata types and catalog plumbing used
by the rest of the stack.
dkropachev pushed a commit to dkropachev/codex that referenced this pull request Jun 9, 2026
Stack split from openai#25708. Original PR intentionally left open. This
second PR persists multi-agent runtime metadata through thread creation,
rollout recording, and thread storage.
dkropachev pushed a commit to dkropachev/codex that referenced this pull request Jun 9, 2026
Stack split from openai#25708. Original PR intentionally left open. This third
PR resolves the effective per-thread multi-agent runtime from persisted
metadata, inherited runtime, and current model selection.
dkropachev pushed a commit to dkropachev/codex that referenced this pull request Jun 9, 2026
Stack split from openai#25708. Original PR intentionally left open. This
fourth PR adds coverage that remote model multi-agent runtime selectors
override local feature flag defaults.
dkropachev pushed a commit to dkropachev/codex that referenced this pull request Jun 9, 2026
Stack split from openai#25708. Original PR intentionally left open. This fifth
PR adds coverage that a remotely selected multi-agent runtime is applied
when the model is selected before the first turn.
dkropachev pushed a commit to dkropachev/codex that referenced this pull request Jun 9, 2026
Stack split from openai#25708. Original PR intentionally left open. This first
PR adds the multi-agent runtime metadata types and catalog plumbing used
by the rest of the stack.
dkropachev pushed a commit to dkropachev/codex that referenced this pull request Jun 9, 2026
Stack split from openai#25708. Original PR intentionally left open. This
second PR persists multi-agent runtime metadata through thread creation,
rollout recording, and thread storage.
dkropachev pushed a commit to dkropachev/codex that referenced this pull request Jun 9, 2026
Stack split from openai#25708. Original PR intentionally left open. This third
PR resolves the effective per-thread multi-agent runtime from persisted
metadata, inherited runtime, and current model selection.
dkropachev pushed a commit to dkropachev/codex that referenced this pull request Jun 9, 2026
Stack split from openai#25708. Original PR intentionally left open. This
fourth PR adds coverage that remote model multi-agent runtime selectors
override local feature flag defaults.
dkropachev pushed a commit to dkropachev/codex that referenced this pull request Jun 9, 2026
Stack split from openai#25708. Original PR intentionally left open. This fifth
PR adds coverage that a remotely selected multi-agent runtime is applied
when the model is selected before the first turn.
dkropachev pushed a commit to dkropachev/codex that referenced this pull request Jun 9, 2026
Stack split from openai#25708. Original PR intentionally left open. This first
PR adds the multi-agent runtime metadata types and catalog plumbing used
by the rest of the stack.
dkropachev pushed a commit to dkropachev/codex that referenced this pull request Jun 9, 2026
Stack split from openai#25708. Original PR intentionally left open. This
second PR persists multi-agent runtime metadata through thread creation,
rollout recording, and thread storage.
dkropachev pushed a commit to dkropachev/codex that referenced this pull request Jun 9, 2026
Stack split from openai#25708. Original PR intentionally left open. This third
PR resolves the effective per-thread multi-agent runtime from persisted
metadata, inherited runtime, and current model selection.
dkropachev pushed a commit to dkropachev/codex that referenced this pull request Jun 9, 2026
Stack split from openai#25708. Original PR intentionally left open. This
fourth PR adds coverage that remote model multi-agent runtime selectors
override local feature flag defaults.
dkropachev pushed a commit to dkropachev/codex that referenced this pull request Jun 9, 2026
Stack split from openai#25708. Original PR intentionally left open. This fifth
PR adds coverage that a remotely selected multi-agent runtime is applied
when the model is selected before the first turn.
dkropachev pushed a commit to dkropachev/codex that referenced this pull request Jun 9, 2026
Stack split from openai#25708. Original PR intentionally left open. This first
PR adds the multi-agent runtime metadata types and catalog plumbing used
by the rest of the stack.
dkropachev pushed a commit to dkropachev/codex that referenced this pull request Jun 9, 2026
Stack split from openai#25708. Original PR intentionally left open. This
second PR persists multi-agent runtime metadata through thread creation,
rollout recording, and thread storage.
dkropachev pushed a commit to dkropachev/codex that referenced this pull request Jun 9, 2026
Stack split from openai#25708. Original PR intentionally left open. This third
PR resolves the effective per-thread multi-agent runtime from persisted
metadata, inherited runtime, and current model selection.
dkropachev pushed a commit to dkropachev/codex that referenced this pull request Jun 9, 2026
Stack split from openai#25708. Original PR intentionally left open. This
fourth PR adds coverage that remote model multi-agent runtime selectors
override local feature flag defaults.
dkropachev pushed a commit to dkropachev/codex that referenced this pull request Jun 9, 2026
Stack split from openai#25708. Original PR intentionally left open. This fifth
PR adds coverage that a remotely selected multi-agent runtime is applied
when the model is selected before the first turn.
dkropachev pushed a commit to dkropachev/codex that referenced this pull request Jun 9, 2026
Stack split from openai#25708. Original PR intentionally left open. This first
PR adds the multi-agent runtime metadata types and catalog plumbing used
by the rest of the stack.
dkropachev pushed a commit to dkropachev/codex that referenced this pull request Jun 9, 2026
Stack split from openai#25708. Original PR intentionally left open. This
second PR persists multi-agent runtime metadata through thread creation,
rollout recording, and thread storage.
dkropachev pushed a commit to dkropachev/codex that referenced this pull request Jun 9, 2026
Stack split from openai#25708. Original PR intentionally left open. This third
PR resolves the effective per-thread multi-agent runtime from persisted
metadata, inherited runtime, and current model selection.
dkropachev pushed a commit to dkropachev/codex that referenced this pull request Jun 9, 2026
Stack split from openai#25708. Original PR intentionally left open. This
fourth PR adds coverage that remote model multi-agent runtime selectors
override local feature flag defaults.
dkropachev pushed a commit to dkropachev/codex that referenced this pull request Jun 9, 2026
Stack split from openai#25708. Original PR intentionally left open. This fifth
PR adds coverage that a remotely selected multi-agent runtime is applied
when the model is selected before the first turn.
dkropachev pushed a commit to dkropachev/codex that referenced this pull request Jun 9, 2026
Stack split from openai#25708. Original PR intentionally left open. This first
PR adds the multi-agent runtime metadata types and catalog plumbing used
by the rest of the stack.
dkropachev pushed a commit to dkropachev/codex that referenced this pull request Jun 9, 2026
Stack split from openai#25708. Original PR intentionally left open. This
second PR persists multi-agent runtime metadata through thread creation,
rollout recording, and thread storage.
dkropachev pushed a commit to dkropachev/codex that referenced this pull request Jun 9, 2026
Stack split from openai#25708. Original PR intentionally left open. This third
PR resolves the effective per-thread multi-agent runtime from persisted
metadata, inherited runtime, and current model selection.
dkropachev pushed a commit to dkropachev/codex that referenced this pull request Jun 9, 2026
Stack split from openai#25708. Original PR intentionally left open. This
fourth PR adds coverage that remote model multi-agent runtime selectors
override local feature flag defaults.
dkropachev pushed a commit to dkropachev/codex that referenced this pull request Jun 9, 2026
Stack split from openai#25708. Original PR intentionally left open. This fifth
PR adds coverage that a remotely selected multi-agent runtime is applied
when the model is selected before the first turn.
dkropachev pushed a commit to dkropachev/codex that referenced this pull request Jun 9, 2026
Stack split from openai#25708. Original PR intentionally left open. This first
PR adds the multi-agent runtime metadata types and catalog plumbing used
by the rest of the stack.
dkropachev pushed a commit to dkropachev/codex that referenced this pull request Jun 9, 2026
Stack split from openai#25708. Original PR intentionally left open. This
second PR persists multi-agent runtime metadata through thread creation,
rollout recording, and thread storage.
dkropachev pushed a commit to dkropachev/codex that referenced this pull request Jun 9, 2026
Stack split from openai#25708. Original PR intentionally left open. This third
PR resolves the effective per-thread multi-agent runtime from persisted
metadata, inherited runtime, and current model selection.
dkropachev pushed a commit to dkropachev/codex that referenced this pull request Jun 9, 2026
Stack split from openai#25708. Original PR intentionally left open. This
fourth PR adds coverage that remote model multi-agent runtime selectors
override local feature flag defaults.
dkropachev pushed a commit to dkropachev/codex that referenced this pull request Jun 9, 2026
Stack split from openai#25708. Original PR intentionally left open. This fifth
PR adds coverage that a remotely selected multi-agent runtime is applied
when the model is selected before the first turn.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant