What Changed#
This PR implements Fix 2 proposed by @mei-the-dev in #2037, taking the smallest cache-only slice of that issue. RepositoryIdentityResolver now keeps null repository identities for 60 seconds instead of 10 seconds. I also tightened the resolver regression test so repeated resolves continue to reuse the cached null identity until the negative TTL expires.
Validated locally with bun run test -- src/project/Layers/RepositoryIdentityResolver.test.ts and bun run typecheck in apps/server.
Why#
In #2037, @mei-the-dev traced the persistent "Some requests are slow" toast back to replay-time repository identity enrichment and called out the 10-second negative TTL as one of the quick-win fixes. This PR implements that specific Fix 2 only: it stretches the negative cache window to 60 seconds so projects without remotes reuse the same null lookup across reconnect churn instead of refreshing every 10 seconds, while keeping behavior localized to the existing cache. The updated test demonstrates the cached null result is stable across repeated resolves and only refreshes after TTL expiry.
UI Changes#
Not applicable.
Checklist#
Note
Low Risk
Small, localized change to cache TTL and its test coverage; main behavioral impact is delaying detection of newly-added remotes for up to 1 minute.
Overview
RepositoryIdentityResolver now caches null (no identity/no remote) lookups for 1 minute instead of 10 seconds, reducing repeated git-remote resolution work during churn.
Updates the late-remote regression test to assert repeated resolve() calls continue returning the cached null identity until the negative TTL elapses, after which the identity is recomputed and returned.
Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 54f6322196e7ce22647ee0969caa492d4cd0cbac. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).
Note
Extend negative repository identity cache TTL from 10 seconds to 1 minute#
Increases DEFAULT_NEGATIVE_CACHE_TTL in RepositoryIdentityResolver.ts from 10 seconds to 1 minute. The test in RepositoryIdentityResolver.test.ts is updated to perform three consecutive resolve calls expecting a null identity before advancing the clock past the new TTL. Behavioral Change: null identities are now cached 6× longer, reducing re-resolution attempts for missing repositories.
Macroscope summarized 54f6322.
Important
Review skipped#
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID:
70e04e2f-4682-4c4e-ba2f-24ecf7135658You can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share