Skip to content

Persist pending input user events#10656

Merged
aibrahim-oai merged 4 commits intomainfrom
codex/persist-pending-input-events
Feb 4, 2026
Merged

Persist pending input user events#10656
aibrahim-oai merged 4 commits intomainfrom
codex/persist-pending-input-events

Conversation

@aibrahim-oai
Copy link
Collaborator

@aibrahim-oai aibrahim-oai commented Feb 4, 2026

  • Persist user-message events for mid-turn injected input by emitting user message turn items when pending input is recorded.

@aibrahim-oai
Copy link
Collaborator Author

@codex review this

Copy link
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: 155291c737

ℹ️ 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".

@aibrahim-oai
Copy link
Collaborator Author

@codex review

Copy link
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: 9f7810c5c5

ℹ️ 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 on lines +3499 to +3503
sess.record_user_prompt_and_emit_turn_item(
turn_context.as_ref(),
&user_message.content,
response_item,
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve user-input metadata when emitting pending input events

The new path emits UserMessage items for pending input by calling record_user_prompt_and_emit_turn_item with user_message.content derived from parse_turn_item, but parse_user_message rebuilds UserInput from ContentItem and explicitly sets text_elements: Vec::new() (see codex-rs/core/src/event_mapping.rs), dropping UI-only metadata like mention spans and local image paths. This means mid-turn injected input that included mentions or local images will now emit user-message events missing those spans/paths, so the UI can no longer render highlights or local image references for the injected prompt. To preserve the intended metadata (per the comment on record_user_prompt_and_emit_turn_item), the pending input needs to retain the original UserInput rather than reconstructing it from ResponseItem.

Useful? React with 👍 / 👎.

@aibrahim-oai aibrahim-oai enabled auto-merge (squash) February 4, 2026 19:38
@aibrahim-oai aibrahim-oai disabled auto-merge February 4, 2026 19:47
@aibrahim-oai aibrahim-oai merged commit 7a25307 into main Feb 4, 2026
28 of 31 checks passed
@aibrahim-oai aibrahim-oai deleted the codex/persist-pending-input-events branch February 4, 2026 19:47
@github-actions github-actions bot locked and limited conversation to collaborators Feb 4, 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