Skip to content

perf(api): coalesce and safely cache version resolution - #8301

Merged
diegosouzapw merged 1 commit into
cheaper-inference:release/v3.8.49from
RaviTharuma:perf/8278-version-singleflight-cache
Jul 24, 2026
Merged

diegosouzapw merged 1 commit into
cheaper-inference:release/v3.8.49from
RaviTharuma:perf/8278-version-singleflight-cache

Conversation

@RaviTharuma

Copy link
Copy Markdown
Contributor

Summary

  • coalesce concurrent latest-version lookups and cache successful metadata for a bounded TTL
  • preserve explicit no-cache/no-store refresh semantics and invalidate after successful updates
  • bound upstream metadata bodies and emit private ETag-aware GET responses

Tests

  • npx eslint src/lib/system/versionCheck.ts src/app/api/system/version/route.ts tests/unit/system-version-cache-8278.test.ts tests/unit/system-version-check-4100.test.ts --no-cache --suppressions-location config/quality/eslint-suppressions.json
  • node --import tsx/esm --import ./open-sse/utils/setupPolyfill.ts --import ./tests/_setup/isolateDataDir.ts --test --test-force-exit tests/unit/system-version-cache-8278.test.ts tests/unit/system-version-check-4100.test.ts (19 passed)
  • git diff --check

Closes #8278

🤖 Generated with Claude Code

@RaviTharuma

Copy link
Copy Markdown
Contributor Author

CI note: the failing fast-path shards include repository-wide baseline failures outside this PR’s changed files (for example DashScope video assertions appear on multiple unrelated PRs). The focused tests listed in this PR body pass locally. I am still checking for any failure attributable to this patch.

@RaviTharuma

Copy link
Copy Markdown
Contributor Author

Ownership/status update:

No PR-attributable fix is pending. The PR is ready for maintainer review/merge despite the known baseline failures.

Co-Authored-By: Claude <noreply@anthropic.com>
@RaviTharuma
RaviTharuma force-pushed the perf/8278-version-singleflight-cache branch from 16f03a5 to 7ccb24d Compare July 23, 2026 18:18
@RaviTharuma

Copy link
Copy Markdown
Contributor Author

Rebased the single focused commit onto the current release/v3.8.49 tip and safely force-pushed with an explicit lease.

  • New base: c525a0f452a725ca59af29ad39dd60584a7f5643
  • New head: 7ccb24da2
  • Commits above base: 1 (perf(api): singleflight version lookups (#8278))
  • Minimal diff remains 4 files: 267 insertions, 9 deletions
  • Focused tests: 19 passed, 0 failed
  • Focused ESLint: passed
  • git diff --check: passed

No unrelated baseline failures were modified.

@diegosouzapw
diegosouzapw merged commit 8a2a3d4 into cheaper-inference:release/v3.8.49 Jul 24, 2026
5 checks passed
@diegosouzapw

Copy link
Copy Markdown
Collaborator

Merged into release/v3.8.49 — thanks @RaviTharuma! Validated via local merge-train (32-core .113) + a per-file discriminator confirming zero regressions vs the pure release tip; CI reds on this PR were pre-existing base-red drift (tracked separately). 🙏

@diegosouzapw diegosouzapw mentioned this pull request Jul 28, 2026
HouMinXi pushed a commit to HouMinXi/OmniRoute that referenced this pull request Aug 2, 2026
…aper-inference#8301)

Co-authored-by: Ravi Tharuma <RaviTharuma@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
@RaviTharuma
RaviTharuma deleted the perf/8278-version-singleflight-cache branch September 23, 2026 19:38
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
…aper-inference#8301)

Co-authored-by: Ravi Tharuma <RaviTharuma@users.noreply.github.com>
Co-authored-by: Claude <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.

feat(api): coalesce and safely cache /api/system/version resolution

2 participants