Skip to content

Conversation

@pakrym-oai
Copy link
Collaborator

@pakrym-oai pakrym-oai commented Oct 20, 2025

  1. Adds AgentMessage, Reasoning, WebSearch items.
  2. Switches the ResponseItem parsing to use new items and then also emit
  3. Removes user-item kind and filters out "special" (environment) user items when returning to clients.

@pakrym-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.

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

…-parsing-to-use-them

# Conflicts:
#	codex-rs/core/src/codex.rs
Drop the ItemCollector abstraction and move item lifecycle event emission into Session. Emit ItemStarted and ItemCompleted events (including legacy events) for each user and agent item directly via new Session methods. Update affected code paths and tests. Remove obsolete item_collector module.
…include reasoning events in initial messages

- Remove unnecessary turn_context param from record_input_and_rollout_usermsg and related invocations.
- Only persist UserMessage events instead of additionally emitting started/completed events during input recording.
- Update resume logic and add test to ensure reasoning events (AgentReasoning/AgentReasoningRawContent) are included in initial_messages after resume.
- Minor cleanup of unused imports.
… ReasoningItem, AgentMessageItem

Refactor event conversion methods from legacy_events to as_legacy_events for clarity and consistency. Update all call sites and tests accordingly. Adapt AgentMessageItem to return Vec<EventMsg> from as_legacy_events. Update event_mapping tests to directly test parse_turn_item and TurnItem variants.
@pakrym-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

.user_prompt(&items);
// attempt to inject input into current task
if let Err(items) = sess.inject_input(items).await {
if let Some(env_item) = sess
.build_environment_update_item(previous_context.as_ref(), &current_context)

P1 Badge Emit user ItemStarted/ItemCompleted for submitted prompts

When a user submits input (Op::UserInput/Op::UserTurn), the handler records the prompt and immediately spawns the task, but it no longer emits ItemStarted/ItemCompleted events for the user message. The previous ItemCollector::started_completed call was removed and nothing replaced it, so clients that rely on these events (e.g. UI, tests waiting for user turn items) will never render the user’s own message and the item stream becomes one‑sided. A TurnItem::UserMessage should be emitted before spawning the task so the event stream stays consistent.

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

…r message event

event_mapping: fix agent message parsing to support multiple content items; add test for agent message parsing
@pakrym-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.

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

id: Some("user".to_string()),
role: "user".to_string(),
content: vec![
ContentItem::InputText {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Input and output text in one message are not supported

@pakrym-oai pakrym-oai marked this pull request as ready for review October 21, 2025 20:49
"type": "message",
"role": "user",
"content": [
{ "type": "input_text", "text": "<environment_context>...</environment_context>" },
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is how env and instruction are actually serialized.

@pakrym-oai pakrym-oai merged commit 3c90728 into main Oct 22, 2025
20 of 21 checks passed
@pakrym-oai pakrym-oai deleted the pakrym/add-new-thread-items-and-rewire-event-parsing-to-use-them branch October 22, 2025 17:14
@github-actions github-actions bot locked and limited conversation to collaborators Oct 22, 2025
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.

3 participants