Skip to content

Conversation

pakrym-oai
Copy link
Collaborator

@pakrym-oai pakrym-oai commented Sep 26, 2025

Adds new event for session completed that includes usage. Also ensures we return 1 on failures.

{
  "type": "session.created",
  "session_id": "019987a7-93e7-7b20-9e05-e90060e411ea"
}
{
  "type": "turn.started"
}
...
{
  "type": "turn.completed",
  "usage": {
    "input_tokens": 78913,
    "cached_input_tokens": 65280,
    "output_tokens": 1099
  }
}

# Conflicts:
#	codex-rs/exec/src/exec_events.rs
#	codex-rs/exec/src/experimental_event_processor_with_json_output.rs
#	codex-rs/exec/tests/event_processor_with_json_output.rs
… list test

Previously, the test only asserted ItemCompleted event. Update to also expect a SessionCompleted event with default usage, matching actual event sequence.
@pakrym-oai pakrym-oai marked this pull request as ready for review September 26, 2025 18:28
@pakrym-oai pakrym-oai changed the title Add session complete and exit code Add session completed event and exit code Sep 26, 2025
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

…ted event

- Replace SessionCompletedEvent and session.completed with TurnCompletedEvent and turn.completed in exec_events and processor
- Introduce TurnStartedEvent and turn.started variant in ConversationEvent
- Propagate changes to experimental_event_processor_with_json_output and adjust handling for TaskStarted/TaskComplete
- Update usage summaries and associated tests for turn semantics
@pakrym-oai pakrym-oai changed the title Add session completed event and exit code Add turn started/completed events and correct exit code on error Sep 26, 2025
Comment on lines +352 to +354
if error_seen {
std::process::exit(1);
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do you want to return a special type of Error and handle std::process::exit() higher up?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes, but outside of this PR, there are many std::process::exits in that file that I'd like to clean up.

@pakrym-oai pakrym-oai merged commit cc1b21e into main Sep 26, 2025
19 checks passed
@pakrym-oai pakrym-oai deleted the pakrym/add-session-complete-and-exit-code branch September 26, 2025 23:21
@github-actions github-actions bot locked and limited conversation to collaborators Sep 26, 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.

2 participants