Skip to content

fix: apply Codex quota refresh before history scan#31

Merged
aqua5230 merged 1 commit into
aqua5230:mainfrom
ericweichun:codex/fix-immediate-codex-quota-refresh
Jun 6, 2026
Merged

fix: apply Codex quota refresh before history scan#31
aqua5230 merged 1 commit into
aqua5230:mainfrom
ericweichun:codex/fix-immediate-codex-quota-refresh

Conversation

@ericweichun
Copy link
Copy Markdown
Contributor

Summary

  • Apply the interim Codex quota refresh on the main thread synchronously before continuing the heavier project history scan.
  • Keep the full refresh path asynchronous as before.
  • Add test coverage for the interim quota update ordering.

Why

Codex quota loading is fast, but project history refresh can be much heavier because it may scan all-time usage and SQLite logs after a source fingerprint change. Previously the interim Codex quota state was posted to the main thread with waitUntilDone=False, so the background refresh could immediately continue into the heavier history work before the menubar UI had applied the fresh quota. That made Codex usage look stale until a later event or another message caused another refresh.

Test plan

  • .venv/bin/python -m pytest tests/test_menubar.py -q
  • .venv/bin/ruff check menubar.py tests/test_menubar.py
  • .venv/bin/mypy menubar.py tests/test_menubar.py
  • uv run pytest tests/

@aqua5230 aqua5230 merged commit 954d37b into aqua5230:main Jun 6, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants