Skip to content

refactor(protocol): map canonical tool items to legacy events - #31296

Merged
owenlin0 merged 1 commit into
mainfrom
owen/canonical-turn-item-legacy-fanout
Jul 7, 2026
Merged

refactor(protocol): map canonical tool items to legacy events#31296
owenlin0 merged 1 commit into
mainfrom
owen/canonical-turn-item-legacy-fanout

Conversation

@owenlin0

@owenlin0 owenlin0 commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Description

This PR adds legacy EventMsg mappings for the TurnItem types introduced in #30282:

  • CommandExecution
  • DynamicToolCall
  • CollabAgentToolCall
  • SubAgentActivity

When their producers move to canonical ItemStarted / ItemCompleted, raw core event consumers can still receive the existing begin/end-style events. The canonical item lifecycle remains the live source of truth.

We also record the mapped legacy events in rollout trace so the producer migration preserves the existing tool-runtime trace entries.

Why

This is the compatibility layer for the follow-up producer migrations. Splitting it out first keeps each producer PR small and keeps the legacy mapping in one place.

What changed

  • Added TurnItem → legacy EventMsg mappings in protocol/src/legacy_events.rs.
  • Added the command execution status conversion used by the exec mapping.
  • Added focused coverage for command execution and dynamic tool mappings.

@owenlin0 owenlin0 changed the title refactor(protocol): fan canonical tool items into legacy events refactor(protocol): map canonical tool items to legacy events Jul 6, 2026
@owenlin0
owenlin0 marked this pull request as ready for review July 6, 2026 22:12
@owenlin0
owenlin0 requested a review from a team as a code owner July 6, 2026 22:12

@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: e09a5e8db1

ℹ️ 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/protocol/src/legacy_events.rs
Comment thread codex-rs/protocol/src/legacy_events.rs
@owenlin0
owenlin0 merged commit b9b934e into main Jul 7, 2026
35 checks passed
@owenlin0
owenlin0 deleted the owen/canonical-turn-item-legacy-fanout branch July 7, 2026 03:42
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 7, 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.

2 participants