Move item event mapping into app-server-protocol#20299
Merged
Merged
Conversation
…ping # Conflicts: # codex-rs/thread-manager-sample/src/main.rs
bolinfest
approved these changes
Apr 30, 2026
| @@ -0,0 +1,807 @@ | |||
| use crate::protocol::common::ServerNotification; | |||
Collaborator
There was a problem hiding this comment.
I feel like protocol crates would ideally be "types only," but I guess that ship has sailed...
Contributor
|
not sure if you were planning on doing this in a follow-up / intended behavior, but for the new thread-manager-sample code: |
starr-openai
approved these changes
Apr 30, 2026
Collaborator
Author
Yep, deleting that flag in #20471 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Follow-up to #20291.
The v2 item-event-to-notification translation had been embedded in
app-server/src/bespoke_event_handling.rs, which made it hard to reuse anywhere else. This PR moves that stateless mapping into shared protocol code so other entry points can produce the sameServerNotificationpayloads without copying app-server logic.That also lets
thread-manager-sampledemonstrate the same notification surface that the app server exposes, instead of only printing the final assistant message.What changed
item_event_to_server_notificationintocodex-app-server-protocol::protocol::event_mappingcodex-app-server-protocolcodex-core-apiso lightweight consumers can use it without reaching intoapp-server-protocoldirectlyapp-server/src/bespoke_event_handling.rsso it delegates the stateless event-to-notification projection to the shared helperthread-manager-sampleto:codex-core-apiread_onlypermission profile so shell commands can run in the sample without widening permissionsTesting
cargo test -p codex-app-server-protocolcargo test -p codex-core-apicargo test -p codex-app-server bespoke_event_handling::testscargo test -p codex-thread-manager-samplecargo run -p codex-thread-manager-sample -- "briefly explore the repo with pwd and ls, then summarize it"