Skip to content

Conversation

@zemaj
Copy link

@zemaj zemaj commented Oct 30, 2025

Summary

  • treat cached version.json files written by the upstream openai/codex release checker as stale so the TUI stops advertising 0.50.0
  • write the current release repo (just-every/code) into the cache so future reads can distinguish our fork from upstream data
  • cover the legacy/current cache handling with small unit tests

Testing

  • cargo test -p code-tui read_version_info
  • ./build-fast.sh

Fixes #376.

zemaj added 2 commits October 31, 2025 05:54
- add optional `current_date` field to `EnvironmentContext` so turn context carries ISO dates
- serialize `<current_date>` tags and extend comparisons/tests to tolerate deterministic values
- cover default date formatting with new unit tests
- reject cached version.json written by the upstream repo so we don't keep prompting for 0.50.0
- stamp new cache entries with the just-every/code origin to avoid future mixups
- add regression tests covering legacy and current cache formats
Copy link
Author

@zemaj zemaj left a comment

Choose a reason for hiding this comment

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

Summary:

  • Reject legacy openai/codex cache entries and persist release_repo: just-every/code so stale metadata no longer triggers repeated update prompts.
  • Added serialization + load tests to prove stale caches are ignored, fresh caches load, and release_repo is written back out.

Tests:

  • cargo test -p code-tui read_version_info_rejects_legacy_repo_cache -- --nocapture
  • cargo test -p code-tui read_version_info_accepts_current_repo_cache -- --nocapture
  • cargo test -p code-tui serialized_version_info_includes_release_repo -- --nocapture
  • ./build-fast.sh

Risks:

  • End-to-end fetch path still depends on live GitHub; consider adding integration coverage or retries if API quota issues surface.

Copy link
Author

@zemaj zemaj left a comment

Choose a reason for hiding this comment

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

Summary:

  • Add TTL-aware caching with clock-skew tolerance, dedupe concurrent update checks via a global async mutex, and switch to atomic temp-file writes so version.json never corrupts and stale legacy caches are ignored.
  • Extend updates.rs with async tests that cover stale refetches, fresh-cache short-circuiting, concurrent dedup, malformed JSON recovery, and path/permission edge cases.
  • Confirm background callers still succeed and documented the new behavior/regressions in reports/pr_385_review.md.

Validation:

  • cargo test -p code-tui --lib updates::
  • ./build-fast.sh

Risks / Follow-ups:

  • Refresh still depends on live GitHub responses; consider introducing retries or a mockable client for hermetic testing.
  • UI snapshot coverage for update toast dedupe is still pending; future PR may add VT100 assertions.

@zemaj zemaj merged commit 5764da6 into main Nov 7, 2025
14 checks 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.

Upgrade prompt compares to upstream Codex (0.50.0) instead of code's latest (0.4.4)

2 participants