Conversation
…/emittance-mergefix # Conflicts: # codex-rs/core/tests/suite/items.rs
dylan-hurd-oai
left a comment
There was a problem hiding this comment.
I think something in lifecycle of ResponseInputItem > ResponseItem and stamping metadata onto the object is not adding up here for me. Let's think about how to make this cleaner - e.g. how can we structure this to avoid unnecessary repeated stampings? feels like we should align this more closely with the creation of ResponseItem.
codex-rs/core/src/codex.rs
Outdated
| let mut metadata_value = metadata.take().unwrap_or_default(); | ||
| metadata_value.user_message_type = Some(kind); | ||
| *metadata = Some(metadata_value); | ||
| } |
There was a problem hiding this comment.
Let's move this into a separate file please 🙏
codex-rs/core/src/state/turn.rs
Outdated
| #[derive(Debug, Clone)] | ||
| pub(crate) struct PendingInputItem { | ||
| pub(crate) input: ResponseInputItem, | ||
| pub(crate) user_message_type: Option<UserMessageType>, |
There was a problem hiding this comment.
@owenlin0 for thoughts here - should we just add metadata to ResponseInputItem?
codex-rs/core/src/codex.rs
Outdated
| turn_context.as_ref(), | ||
| &input, | ||
| response_item, | ||
| Some(UserMessageType::Prompt), |
There was a problem hiding this comment.
We've already attached the metadata above - why do we need to add it to the method here?
…emittance # Conflicts: # codex-rs/core/src/codex.rs
|
Closing this pull request because it has had no updates for more than 14 days. If you plan to continue working on it, feel free to reopen or open a new PR. |
Testing
INFO | 2026-03-12 15:12:27 | codex_backend.routers.responses | responses.create_response:459 | Responses input metadata probe for session 019ce41b-a59d-7e61-ad3d-052b69082252: [{'index': 2, 'type': 'message', 'role': 'user', 'user_message_type': 'prompt', 'metadata_keys': ['user_message_type']}] |