Skip to content

Conversation

@guidedways
Copy link
Contributor

Summary

  • show live review token usage while /review runs and restore the main session indicator afterward
  • add regression coverage for the footer behavior

Testing

  • just fmt
  • cargo test -p codex-tui

Fixes #5604

@github-actions
Copy link

github-actions bot commented Oct 24, 2025

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@guidedways
Copy link
Contributor Author

I have read the CLA Document and I hereby sign the CLA

@guidedways
Copy link
Contributor Author

recheck

github-actions bot added a commit that referenced this pull request Oct 24, 2025
@guidedways guidedways changed the title Fix(context left after review): review footer context after /review fix(context left after review): review footer context after /review Oct 24, 2025
@guidedways
Copy link
Contributor Author

@codex review

@chatgpt-codex-connector
Copy link
Contributor

Codex Review: Didn't find any major issues. Bravo.

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

@etraut-openai etraut-openai reopened this Nov 8, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Nov 8, 2025
@etraut-openai
Copy link
Collaborator

Github got into a weird state with this PR, so I wasn't able to trigger the CI actions. Closing and reopening appears to have fixed it.

@openai openai unlocked this conversation Nov 8, 2025
youta7 added a commit to youta7/ta-codex that referenced this pull request Nov 10, 2025
@guidedways
Copy link
Contributor Author

@etraut-openai thank you - sorry, somehow your messages did not reach my inbox. Hopeful this can get approved though :)

@etraut-openai
Copy link
Collaborator

@guidedways, I'm not able to merge the latest changes from main into your branch. Can you do that? This should clear up the CI failures.

@etraut-openai etraut-openai added the needs-response Additional information is requested label Nov 17, 2025
@guidedways
Copy link
Contributor Author

@etraut-openai thank you, done!

Comment on lines +1721 to +1722
if self.pre_review_token_info.is_none() {
self.pre_review_token_info = Some(self.token_info.clone());
Copy link
Collaborator

Choose a reason for hiding this comment

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

In what cases would pre_review_token_info be Some(_) when entering review mode?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We need three states (no snapshot yet, snapshot captured but token info was None, snapshot captured with real data), so pre_review_token_info is intentionally an Option<Option<TokenUsageInfo>>. We only set it when it’s currently None, otherwise a history replay or duplicate EnteredReviewMode would overwrite the original snapshot before ExitedReviewMode runs and restores it. I could have wrapped those states in a custom enum, but the nested Option kept this fix localized and works cleanly with take/map.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To clarify further, snapshot captured but token info was None happens when you start Codex CLI and your first prompt is /review (and so there's no token info available)

}

fn restore_pre_review_token_info(&mut self) {
if let Some(saved) = self.pre_review_token_info.take() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

When would we not have a saved token info?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We don't save the info until we actually enter review.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@nornagon-openai Please let me know if these questions can be resolved

@etraut-openai etraut-openai added the needs-response Additional information is requested label Nov 18, 2025
@guidedways
Copy link
Contributor Author

@etraut-openai would be great to have this merged if possible :D I've been making sure changes get merged regularly (33 merges so far)

@etraut-openai etraut-openai removed the needs-response Additional information is requested label Nov 19, 2025
@nornagon-openai nornagon-openai enabled auto-merge (squash) November 19, 2025 22:36
@nornagon-openai nornagon-openai merged commit 692989c into openai:main Nov 19, 2025
25 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Nov 19, 2025
@etraut-openai
Copy link
Collaborator

Merge complete. Thanks again for your contribution, @guidedways!

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.

Context left does not update after a /review finishes

4 participants