Skip to content

[codex] Persist multi-agent version metadata#25153

Open
aibrahim-oai wants to merge 1 commit into
mainfrom
codex/persist-multi-agent-system
Open

[codex] Persist multi-agent version metadata#25153
aibrahim-oai wants to merge 1 commit into
mainfrom
codex/persist-multi-agent-system

Conversation

@aibrahim-oai
Copy link
Copy Markdown
Collaborator

@aibrahim-oai aibrahim-oai commented May 29, 2026

Why

The runtime pinning change needs a durable place to store the selected multi-agent system before any behavior changes are introduced.

What changed

  • Add the shared MultiAgentVersion enum with v1 and v2.
  • Add optional version fields to rollout metadata, thread-store metadata, and SQLite.
  • Read and write the value through rollout, thread store, and state DB paths.
  • Read the latest matching rollout metadata value while preserving the canonical thread identity.
  • Add storage round-trip and tolerant protocol coverage. Unknown values collapse to omission.

This PR is structural only. It does not resolve flags or change runtime gates.

Verification

Ran just fmt. Validation is running in online CI.

Stack

  1. This PR: [codex] Persist multi-agent version metadata #25153
  2. Runtime pinning: [codex] Pin multi-agent system per thread #25168
  3. ModelInfo overlay: [codex] Add model multi-agent system overlay #25155

Supersedes #25032.

@aibrahim-oai aibrahim-oai requested a review from a team as a code owner May 29, 2026 21:00
@aibrahim-oai
Copy link
Copy Markdown
Collaborator Author

This change is part of the following stack:

Change managed by git-spice.

Copy link
Copy Markdown
Contributor

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

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: d617fd14cb

ℹ️ 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/thread_manager.rs Outdated
Arc::clone(&self.auth_manager),
agent_control,
session_source,
/*parent_multi_agent_version*/ None,
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.

P2 Badge Preserve stored multi-agent version on resume

When resuming an agent from a thread store whose selector lives in StoredThread.multi_agent_version rather than in a SessionMeta rollout item, passing None here makes Codex::spawn resolve v1/v2 from the current feature flags instead. This already applies to the in-memory/pathless store shape, where creation metadata can carry the selector while the replay history does not, so a resumed thread can switch multi-agent systems despite the stored metadata that resume_single_agent_from_rollout just read.

Useful? React with 👍 / 👎.

Comment on lines +2475 to +2478
RolloutItem::SessionMeta(meta_line)
if meta_line.meta.id == resumed.conversation_id =>
{
Some(meta_line.meta.multi_agent_version)
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.

P2 Badge Skip unpinned metadata entries when resolving version

When a legacy rollout is first pinned, it appends a later SessionMeta with multi_agent_version, but existing compatibility updates such as memory-mode or git updates append another SessionMeta cloned from the original head record, where this field is still omitted. Because this reverse scan stops at that newest SessionMeta even when its value is None, the next resume/fork treats the thread as unpinned and can switch back to whatever the current feature flags say; keep searching for an actual version or ensure metadata-only SessionMeta updates preserve the pinned selector.

Useful? React with 👍 / 👎.

@aibrahim-oai aibrahim-oai force-pushed the codex/persist-multi-agent-system branch from d617fd1 to 88f1739 Compare May 29, 2026 22:33
@aibrahim-oai aibrahim-oai changed the title [codex] Persist multi-agent system per thread [codex] Persist multi-agent version metadata May 29, 2026
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