Skip to content

Comments

fix: token usage reset handling in UI#378

Merged
Dimillian merged 2 commits intomainfrom
codex/github-mention-issue-when-session-tokens-bar-resets,-there
Feb 9, 2026
Merged

fix: token usage reset handling in UI#378
Dimillian merged 2 commits intomainfrom
codex/github-mention-issue-when-session-tokens-bar-resets,-there

Conversation

@Dimillian
Copy link
Owner

Motivation

  • Ensure the UI properly clears or updates thread token usage when the backend sends reset/null tokenUsage payloads so token usage bars reflect resets.

Description

  • Allow thread/tokenUsage/updated handler to accept null payloads by updating the handler signature in src/features/app/hooks/useAppServerEvents.ts and changing the dispatch condition to allow explicit nulls.
  • Accept null in the turn-events handler and pass it through by updating src/features/threads/hooks/useThreadTurnEvents.ts to accept tokenUsage: Record<string, unknown> | null.
  • Normalize token usage inputs to safe default values by updating src/features/threads/utils/threadNormalize.ts so normalizeTokenUsage accepts null | undefined and uses an empty default object internally.

Testing

  • No automated tests were run for this change.

Codex Task

@Dimillian
Copy link
Owner Author

@codex review

@Dimillian Dimillian changed the title Fix token usage reset handling in UI fix: token usage reset handling in UI Feb 9, 2026
@chatgpt-codex-connector
Copy link

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

Failed to set up container
ℹ️ 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".

@Dimillian
Copy link
Owner Author

@codex review

@chatgpt-codex-connector
Copy link

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

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

@Dimillian Dimillian merged commit 5c3508e into main Feb 9, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant