Skip to content

fix: always fetch manifest from GitHub, 3s timeout for bad wifi#3272

Merged
louisgv merged 2 commits intoOpenRouterTeam:mainfrom
AhmedTMM:manifest-always-fresh
Apr 12, 2026
Merged

fix: always fetch manifest from GitHub, 3s timeout for bad wifi#3272
louisgv merged 2 commits intoOpenRouterTeam:mainfrom
AhmedTMM:manifest-always-fresh

Conversation

@AhmedTMM
Copy link
Copy Markdown
Collaborator

Summary

  • Remove 1h cache-first path that caused stale manifests (user had 14-day-old cache missing new agents/clouds)
  • Every run now fetches fresh from GitHub with a 3s timeout (down from 10s)
  • Disk cache is only used as an offline fallback when network is unreachable
  • Supersedes fix: always fetch manifest from GitHub, cache is offline-only #3271 which had 10s timeout — too slow on bad wifi

What changed

  • Removed CACHE_TTL (1h) and tryLoadFromDiskCache() — no more cache-first path
  • Reduced FETCH_TIMEOUT from 10s to 3s — manifest.json is ~10KB, loads in <1s on any connection
  • cacheAge() kept only for spawn version display info
  • Cache still written on every successful fetch (offline fallback)

Trade-off

Each spawn run makes a ~10KB fetch to GitHub. On good wifi this adds <500ms. On bad wifi (60% packet loss), the 3s timeout kicks in and falls back to cache — much better than the 10s timeout in #3271.

Test plan

  • 2104 tests pass
  • Biome lint clean
  • Updated test that previously expected cache-first behavior

🤖 Generated with Claude Code

Remove the 1h cache-first path that caused 14-day stale manifests.
Every run now fetches fresh from GitHub (3s timeout). Disk cache is
only used as an offline fallback when the network is unreachable.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Member

@louisgv louisgv left a comment

Choose a reason for hiding this comment

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

Security Review

Verdict: APPROVED - No security issues

Commit: ff0df99

Summary

This PR improves reliability by removing TTL-based disk caching and always fetching fresh manifest from GitHub. The 3s timeout provides fast fallback on bad wifi while disk cache remains as offline-only fallback.

Security Analysis

  • ✅ All existing security protections preserved (stripDangerousKeys, manifest validation)
  • ✅ No new attack surface introduced
  • ✅ Reduces stale cache risk
  • ✅ Version bump follows semantic versioning

Tests

  • bun test: ✅ PASS (2043 pass, 0 fail)
  • biome check: ✅ PASS (0 errors)

-- security/pr-reviewer

@louisgv louisgv added the security-approved Security review approved label Apr 12, 2026
@louisgv louisgv merged commit 9e533fa into OpenRouterTeam:main Apr 12, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

security-approved Security review approved

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants