-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Add new thread items and rewire event parsing to use them #5418
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new thread items and rewire event parsing to use them #5418
Conversation
|
@codex review this |
There was a problem hiding this 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.
…-parsing-to-use-them
…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.
|
@codex review this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
codex/codex-rs/core/src/codex.rs
Lines 1193 to 1197 in e08f5b2
| .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(), ¤t_context) |
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
|
@codex review this |
There was a problem hiding this 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".
…om ReasoningItem and parsing logic
| id: Some("user".to_string()), | ||
| role: "user".to_string(), | ||
| content: vec![ | ||
| ContentItem::InputText { |
There was a problem hiding this comment.
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
… in parse_turn_item and tests
| "type": "message", | ||
| "role": "user", | ||
| "content": [ | ||
| { "type": "input_text", "text": "<environment_context>...</environment_context>" }, |
There was a problem hiding this comment.
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.
Uh oh!
There was an error while loading. Please reload this page.