Skip to content

fix: queue manual refresh while busy#12

Merged
aqua5230 merged 1 commit into
aqua5230:mainfrom
ericweichun:codex/upstream-refresh-queue
May 27, 2026
Merged

fix: queue manual refresh while busy#12
aqua5230 merged 1 commit into
aqua5230:mainfrom
ericweichun:codex/upstream-refresh-queue

Conversation

@ericweichun
Copy link
Copy Markdown
Contributor

Summary

  • queue one manual refresh when the user clicks Refresh while a background refresh is already running
  • clear the in-flight flag in a finally block so UI update failures do not permanently block future refreshes
  • run the queued refresh immediately after the current refresh result is applied

Test plan

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

Notes for reviewer

This only changes explicit manual refresh behavior. Timer and FSEvents refresh calls still coalesce while a refresh is in flight.

Copy link
Copy Markdown
Owner

@aqua5230 aqua5230 left a comment

Choose a reason for hiding this comment

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

Behavior change is solid and the tests are real. One blocker against current main: _applyRefreshResult_ in v0.11.6
(commit ba66688) now also writes self.codex_model, and the ivar declaration on AppDelegate added codex_model.
Could you rebase onto main and make sure the queued-refresh finally block preserves both self.codex_model = result.get("codex_model", "unknown") and the existing language-injection step? After rebase this should be straight to
merge.

@ericweichun ericweichun force-pushed the codex/upstream-refresh-queue branch from 702cab6 to 4dbf7df Compare May 27, 2026 01:03
@ericweichun
Copy link
Copy Markdown
Contributor Author

Updated, thanks. I rebased onto current main and resolved the refresh queue patch around the v0.11.6 state update path. The queued-refresh finally block now preserves both self.codex_model = result.get("codex_model", "unknown") and the existing language injection step before clearing the busy flag and draining one queued refresh.\n\nValidation run locally:\n- .venv/bin/python -m pytest tests/test_menubar.py\n- .venv/bin/python -m ruff check menubar.py tests/test_menubar.py\n- .venv/bin/python -m mypy .

@aqua5230 aqua5230 merged commit 6c300d1 into aqua5230:main May 27, 2026
1 check passed
aqua5230 added a commit that referenced this pull request May 27, 2026
- fix(badge): clear update hint immediately after upgrade past cached latest
- fix(reporter): bucket Codex usage by token_count deltas (#11, @ericweichun)
- fix(reports): tie All Time reports to project range selector (#15, @ericweichun)
- fix(refresh): queue manual refresh while busy (#12, @ericweichun)
- docs(setup): make setup guidance agent-neutral (#16, @ericweichun)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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