Skip to content

fix(tui): let quit abandon the background update check - #162

Merged
allenhutchison merged 2 commits into
mainfrom
codex/update-check-quit
Oct 28, 2026
Merged

allenhutchison merged 2 commits into
mainfrom
codex/update-check-quit

Conversation

@allenhutchison

@allenhutchison allenhutchison commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Human overview

Quitting Pepper no longer waits for a slow background release lookup to finish. Closing the TUI stops further fallback lookups and discards any late result. Fixes #160.

AI reviewer

  • tui/app.py: run the optional update check on a named daemon thread, following the existing streamed-turn pattern. Asyncio no longer joins this lookup during shutdown. Keep using _post and _on_update_available to drop results once closing begins.
  • _version.py: add an optional should_stop callback. Check it before starting each request and before caching or returning a network result. The active request can finish on its daemon thread; it is not forcibly interrupted.
  • Tests: a child process starts a checker blocked on an event and exits without releasing it, exercising both asyncio and interpreter shutdown. The same regression test timed out after 10 seconds on the original code. Additional tests verify late results are discarded, the app passes its closing state to the default checker, and cancellation prevents the first request or either fallback.
  • README documents that quitting does not wait for the release check. The bundled agent guide is unchanged because this does not change agent commands or their output.
  • No server contract, credential, exit-code, dependency, or update-source changes.
  • Built-in simplify and code-review skills are unavailable in this session. A manual simplification and correctness review found no additional changes needed.

Verification on main at 0f11c70, using the locked dev environment:

  • uv run --no-sync ruff format --check: 122 files already formatted.
  • uv run --no-sync ruff check and uv run --no-sync ty check src/pepper_cli/: passed.
  • uv run --no-sync pytest -q --cov --cov-report=json:coverage-summary.json: 2,531 passed, 2 skipped; 94.98 percent line coverage, passing the unchanged 88 percent floor. NO_COLOR was unset for color-rendering tests and local test-server socket access was enabled. The suite reported the same nine existing pepper-person-stream teardown warnings seen before this fix; no update-check warnings.
  • Coverage adapter/ratchet and git diff --check: passed.

Checklist (repo-specific)

  • uv run ruff format --check and uv run ruff check clean (no new lint ignores)
  • uv run ty check src/pepper_cli/ clean
  • uv run pytest passes; coverage floor in .claude/maintainerd.json not lowered
  • Server-contract changes: N/A; no API usage, wire models, or stream frames changed.
  • No token or credential is logged, printed, or put in a fixture
  • README updated; bundled SKILL.md unaffected because agent commands and output are unchanged

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge, with the previous test-coverage gap addressed.

Summary

Quitting the TUI no longer waits for the background release check.

  • Quitting Pepper no longer waits for its background release check.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[TUI starts] --> B[Daemon thread checks for updates]
  B --> C{App closing?}
  C -->|No| D[Continue lookup and show result]
  C -->|Yes| E[Skip fallback requests and discard result]
  Q[User quits] --> F[TUI exits without joining check thread]
  Q --> C
Loading

Reviews (2) · Last reviewed commit: "test(updates): cover successful response..." · Reviewed by Greptile

@vycari-review

vycari-review Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Vycari Review (shadow)

Shadow round 2 on 838b16f. This comment is non-gating and needs no response: it is collected to measure agreement with the current reviewer. The round's verdict is the Vycari Review (shadow) check run.

Open: P0 0 · P1 0 · P2 0 · confirmed fixed 0 · withdrawn 0

Judge's notes

No candidate findings were raised.

No open findings this round.

Comment thread tests/test_user_agent_and_upgrade.py
@allenhutchison
allenhutchison added this pull request to the merge queue Oct 28, 2026
Merged via the queue into main with commit df37d0b Oct 28, 2026
5 checks passed
@allenhutchison
allenhutchison deleted the codex/update-check-quit branch October 28, 2026 23:17
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.

TUI update check delays quitting while a release lookup is still running

1 participant