Skip to content

Print TUI session info on fatal exits#27417

Merged
etraut-openai merged 5 commits into
mainfrom
etraut/tui-exit-session-id
Jun 11, 2026
Merged

Print TUI session info on fatal exits#27417
etraut-openai merged 5 commits into
mainfrom
etraut/tui-exit-session-id

Conversation

@etraut-openai

@etraut-openai etraut-openai commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

TUI exits printed the resume/session summary only after checking the exit reason. On fatal exits, both CLI wrappers wrote the error and called process::exit(1) immediately, so an active session that ended on a fatal error could skip the session information entirely.

This change prints the normal exit summary before returning the fatal nonzero exit code. If a fatal exit has a known thread id but no resumable rollout hint, it prints Session ID: <id> instead of staying silent. It also flushes stdout before process::exit(1) so the summary line is not lost during process teardown.

Implementation

  • Apply the fatal-exit ordering fix in both codex and standalone codex-tui.
  • Keep normal user-requested exit behavior unchanged.
  • Preserve the existing resume hint when a rollout is resumable, and use the raw thread id only as a fatal-exit fallback.

@etraut-openai etraut-openai marked this pull request as ready for review June 10, 2026 17:21
@etraut-openai etraut-openai changed the title [codex] Print session id for non-resumable TUI exits Print session id for non-resumable TUI exits Jun 10, 2026
@etraut-openai etraut-openai changed the title Print session id for non-resumable TUI exits [codex] Print TUI session info on fatal exits Jun 10, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

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: b522d62eff

ℹ️ 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 thread codex-rs/cli/src/main.rs
@etraut-openai etraut-openai changed the title [codex] Print TUI session info on fatal exits Print TUI session info on fatal exits Jun 10, 2026
…on-id

# Conflicts:
#	codex-rs/tui/src/app.rs
@etraut-openai etraut-openai merged commit 9d88e29 into main Jun 11, 2026
31 checks passed
@etraut-openai etraut-openai deleted the etraut/tui-exit-session-id branch June 11, 2026 16:56
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 11, 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