Skip to content

Open-source Grok Bot alternative for named AI teammates. Local-first desktop, web, and mobile clients with per-bot tools, instructions, and memory. Independent fork of T3 Code.

fix(server): extend negative repository identity cache ttl (#2083)

m9d5md90e15d1d7ec
diff --git a/apps/server/src/project/Layers/RepositoryIdentityResolver.test.ts b/apps/server/src/project/Layers/RepositoryIdentityResolver.test.ts
index c6ab7b860..98257b97e 100644
--- a/apps/server/src/project/Layers/RepositoryIdentityResolver.test.ts
+++ b/apps/server/src/project/Layers/RepositoryIdentityResolver.test.ts
@@ -140,7 +140,7 @@ it.layer(NodeServices.layer)("RepositoryIdentityResolverLive", (it) => {
);
it.effect(
- "refreshes cached null identities after the negative TTL when a remote is configured later",
+ "keeps null identities cached across repeated resolves until the negative TTL expires",
() =>
Effect.gen(function* () {
const fileSystem = yield* FileSystem.FileSystem;
@@ -156,8 +156,10 @@ it.layer(NodeServices.layer)("RepositoryIdentityResolverLive", (it) => {
yield* git(cwd, ["remote", "add", "origin", "[email protected]:T3Tools/t3code.git"]);
- const cachedIdentity = yield* resolver.resolve(cwd);
- expect(cachedIdentity).toBeNull();
+ for (const _attempt of [1, 2, 3]) {
+ const cachedIdentity = yield* resolver.resolve(cwd);
+ expect(cachedIdentity).toBeNull();
+ }
yield* TestClock.adjust(Duration.millis(120));
diff --git a/apps/server/src/project/Layers/RepositoryIdentityResolver.ts b/apps/server/src/project/Layers/RepositoryIdentityResolver.ts
index e439fa19a..307123551 100644
--- a/apps/server/src/project/Layers/RepositoryIdentityResolver.ts
+++ b/apps/server/src/project/Layers/RepositoryIdentityResolver.ts
@@ -68,7 +68,7 @@ function buildRepositoryIdentity(input: {
const DEFAULT_REPOSITORY_IDENTITY_CACHE_CAPACITY = 512;
const DEFAULT_POSITIVE_CACHE_TTL = Duration.minutes(1);
-const DEFAULT_NEGATIVE_CACHE_TTL = Duration.seconds(10);
+const DEFAULT_NEGATIVE_CACHE_TTL = Duration.minutes(1);
interface RepositoryIdentityResolverOptions {
readonly cacheCapacity?: number;