Skip to content

feat(core): emit canonical review mode items - #31473

Merged
owenlin0 merged 1 commit into
mainfrom
owen/stable-review-event-ids
Jul 8, 2026
Merged

feat(core): emit canonical review mode items#31473
owenlin0 merged 1 commit into
mainfrom
owen/stable-review-event-ids

Conversation

@owenlin0

@owenlin0 owenlin0 commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Description

This PR moves review-mode markers onto canonical TurnItem lifecycle:

  • TurnItem::EnteredReviewMode
  • TurnItem::ExitedReviewMode

Core now emits ItemStarted / ItemCompleted for both. The completed items map back into the existing EnteredReviewMode / ExitedReviewMode events, so raw core event consumers and legacy rollout persistence keep seeing the old events.

This is the compatibility layer needed before paginated rollouts persist review markers as ItemCompleted(TurnItem).

Why

Review markers were one of the remaining app-server thread items created directly from legacy events. Giving them canonical items lets paginated history persist stable turn/item IDs without changing legacy rollouts.

What changed

  • Added canonical review-mode TurnItems and switched review flow to emit their lifecycle.
  • Added completed-item → legacy review event mappings with stable turn/item IDs.
  • Switched app-server live notifications to the generic canonical item path and kept legacy replay compatible with old payloads.
  • Updated ThreadHistoryBuilder to replay canonical review items even though review turns still do not emit TurnStarted.

@owenlin0
owenlin0 requested a review from a team as a code owner July 7, 2026 21:36
@owenlin0
owenlin0 force-pushed the owen/stable-review-event-ids branch from fdb84d9 to ec3e03c Compare July 7, 2026 21:43

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

ℹ️ 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/app-server-protocol/src/protocol/thread_history.rs Outdated
@owenlin0
owenlin0 force-pushed the owen/stable-review-event-ids branch from ec3e03c to 089106f Compare July 7, 2026 21:54
@owenlin0 owenlin0 changed the title feat(protocol): preserve stable review item IDs feat(protocol): store turn_id and item_id on review events Jul 7, 2026
@owenlin0
owenlin0 requested a review from pakrym-oai July 7, 2026 22:12
@owenlin0
owenlin0 force-pushed the owen/stable-review-event-ids branch from 089106f to 9aad937 Compare July 7, 2026 22:41
@owenlin0 owenlin0 changed the title feat(protocol): store turn_id and item_id on review events feat(core): emit canonical review mode items Jul 7, 2026
@owenlin0
owenlin0 force-pushed the owen/stable-review-event-ids branch 2 times, most recently from 6f6cfa5 to 42b1ebe Compare July 7, 2026 23:36
},
CoreTurnItem::EnteredReviewMode(review) => ThreadItem::EnteredReviewMode {
id: review.id,
review: review.user_facing_hint,

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.

should we align items?

@owenlin0 owenlin0 Jul 8, 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.

hmm to align the items... we need core to keep ReviewTarget / ReviewOutputEvent so we can map back to the legacy event for compatibility, so the only option is to make the app-server API thread item structured, but that's an API change which I'd like to keep out of scope for now. we can always do it later if we'd like

Comment thread codex-rs/core/src/event_mapping.rs Outdated
Comment thread codex-rs/core/src/review_format.rs Outdated
Comment thread codex-rs/core/Cargo.toml
tracing = { workspace = true, features = ["log"] }
url = { workspace = true }
uuid = { workspace = true, features = ["serde", "v4", "v5"] }
uuid = { workspace = true, features = ["serde", "v4", "v5", "v7"] }

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.

catch em all :D

@owenlin0
owenlin0 force-pushed the owen/stable-review-event-ids branch from 42b1ebe to 68f5cd2 Compare July 8, 2026 03:16
@owenlin0
owenlin0 force-pushed the owen/stable-review-event-ids branch 2 times, most recently from cd0a43b to 22ef76e Compare July 8, 2026 04:03
@owenlin0
owenlin0 merged commit 23aac92 into main Jul 8, 2026
63 of 66 checks passed
@owenlin0
owenlin0 deleted the owen/stable-review-event-ids branch July 8, 2026 16:59
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 8, 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