GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(server): cloned projects no longer show the enclosing repository by sliva0 · Pull Request #17047 · pingdotgg/t3code

fix(server): cloned projects no longer show the enclosing repository #17047

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Sign up for GitHub

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sliva0 wants to merge 4 commits into pingdotgg:main from sliva0:fix/clone-repo-detection

Uh oh!

There was an error while loading. Please reload this page.

Closed

fix(server): cloned projects no longer show the enclosing repository #17047

Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit Hold shift + click to select a range
d1c3253
fix(server): cloned projects no longer show the enclosing repository
sliva0 Oct 8, 2026
b1db48c
fix(server): a refreshed repository identity is not overwritten by an…
sliva0 Oct 15, 2026
715dfd8
chore(server): merge main before rebuilding clone enrichment fix
juliusmarminge Oct 19, 2026
537c1a6
fix(server): refresh cloned project enrichment
juliusmarminge Oct 19, 2026
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view
Prev Previous commit
fix(server): refresh cloned project enrichment
  • Loading branch information

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge
juliusmarminge committed Oct 19, 2026
commit 537c1a6f325a5976ba26564e436c9aa721ebbbe5

There are no files selected for viewing

1 change: 1 addition & 0 deletions 1 apps/server/src/orchestration-v2/DelegatedCompletionDelivery.test.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ const layerTest = Layer.mergeAll(RuntimeLayer.layer, RuntimeLayer.layerEventSink
repositoryIdentityResolved: false,
}),
invalidate: () => Effect.void,
refresh: () => Effect.void,
subscribeChanges: Effect.never,
}),
),
Expand Down
1 change: 1 addition & 0 deletions 1 apps/server/src/orchestration-v2/runtimeLayer.test.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,7 @@ const layerSharedApplicationDataPlaneTest = Layer.mergeAll(
repositoryIdentityResolved: false,
}),
invalidate: () => Effect.void,
refresh: () => Effect.void,
subscribeChanges: Effect.never,
}),
),
Expand Down
123 changes: 123 additions & 0 deletions 123 apps/server/src/project/ProjectEnrichmentService.test.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
import * as NodeServices from "@effect/platform-node/NodeServices";
import { assert, it } from "@effect/vitest";
import type { RepositoryIdentity } from "@t3tools/contracts";
import * as Deferred from "effect/Deferred";
import * as Effect from "effect/Effect";
import * as FileSystem from "effect/FileSystem";
import * as Layer from "effect/Layer";
import * as Logger from "effect/Logger";
import * as Path from "effect/Path";
import * as PubSub from "effect/PubSub";
import * as Ref from "effect/Ref";
import { TestClock } from "effect/testing";

import * as ProcessRunner from "../processRunner.ts";
import * as WorkspacePaths from "../workspace/WorkspacePaths.ts";

import * as ProjectEnrichment from "./ProjectEnrichmentService.ts";
Expand Down Expand Up @@ -479,3 +483,122 @@ it.effect(
}).pipe(Effect.provide(layer(layerMetadata)));
}),
);

it.effect("keeps the refreshed identity when a replaced lookup finishes late", () =>
Effect.gen(function* () {
const staleStarted = yield* Deferred.make<void>();
const releaseStale = yield* Deferred.make<void>();
const workerAdvanced = yield* Deferred.make<void>();
const version = yield* Ref.make(1);
const metadataLayer = Layer.merge(
Layer.succeed(RepositoryIdentityResolver.RepositoryIdentityResolver, {
resolve: (workspaceRoot) =>
Effect.gen(function* () {
if (workspaceRoot === "/barrier") {
yield* Deferred.succeed(workerAdvanced, undefined);
return null;
}
const capturedVersion = yield* Ref.get(version);
if (capturedVersion === 1) {
// Let the cache install its pending entry before refresh can replace it.
yield* Effect.yieldNow;
yield* Deferred.succeed(staleStarted, undefined);
yield* Deferred.await(releaseStale);
}
return identity(workspaceRoot, capturedVersion);
}),
}),
Layer.succeed(ProjectFaviconResolver.ProjectFaviconResolver, {
resolvePath: () => Effect.succeed(null),
}),
);

yield* Effect.gen(function* () {
const service = yield* ProjectEnrichment.ProjectEnrichmentService;
const changes = yield* service.subscribeChanges;
yield* service.request("/cloned");
yield* Deferred.await(staleStarted);
yield* Ref.set(version, 2);
yield* service.refresh("/cloned");
const refreshed = yield* PubSub.take(changes);
assert.equal(refreshed.workspaceRoot, "/cloned");
assert.isTrue(refreshed.repositoryIdentityResolved);
assert.deepEqual(refreshed.enrichment.repositoryIdentity, identity("/cloned", 2));

// One worker makes the next root a barrier after the stale lookup's publication.
yield* service.request("/barrier");
yield* Deferred.succeed(releaseStale, undefined);
yield* Deferred.await(workerAdvanced);
for (const change of yield* PubSub.takeAll(changes)) {
if (change.workspaceRoot === "/cloned") {
assert.deepEqual(change.enrichment.repositoryIdentity, identity("/cloned", 2));
}
}
assert.deepEqual((yield* service.peek("/cloned")).repositoryIdentity, identity("/cloned", 2));
}).pipe(Effect.provide(layer(metadataLayer, { concurrency: 1 })));
}),
);

const git = Effect.fnUntraced(function* (cwd: string, args: ReadonlyArray<string>) {
const processRunner = yield* ProcessRunner.ProcessRunner;
const result = yield* processRunner.run({ command: "git", args: ["-C", cwd, ...args] });
assert.equal(result.code, 0, result.stderr);
});

it.layer(NodeServices.layer)("ProjectEnrichmentService with Git", (it) => {
it.effect.each([
{ location: "inside another repository", initialKey: "github.com/example/dotfiles" },
{ location: "outside any repository", initialKey: null },
])("refreshes cached and published clone identity $location", ({ initialKey }) =>
Effect.gen(function* () {
const fileSystem = yield* FileSystem.FileSystem;
const path = yield* Path.Path;
const parent = yield* fileSystem.makeTempDirectoryScoped({
prefix: "t3-project-enrichment-clone-test-",
});
if (initialKey !== null) {
yield* git(parent, ["init"]);
yield* git(parent, ["remote", "add", "origin", "[email protected]:example/dotfiles.git"]);
}
const source = path.join(parent, "source.git");
yield* git(parent, ["init", "--bare", source]);
const destination = path.join(parent, "cloned");
yield* fileSystem.makeDirectory(destination);

const service = yield* ProjectEnrichment.ProjectEnrichmentService;
const changes = yield* service.subscribeChanges;
yield* service.request(destination);
const beforeClone = yield* PubSub.take(changes);
assert.isTrue(beforeClone.repositoryIdentityResolved);
assert.equal(beforeClone.enrichment.repositoryIdentity?.canonicalKey ?? null, initialKey);

yield* git(parent, ["clone", source, destination]);
yield* git(destination, ["remote", "set-url", "origin", "[email protected]:example/t3code.git"]);
yield* service.refresh(destination);

const published = yield* PubSub.take(changes);
assert.equal(published.workspaceRoot, destination);
assert.isTrue(published.repositoryIdentityResolved);
assert.equal(
published.enrichment.repositoryIdentity?.canonicalKey,
"github.com/example/t3code",
);
assert.deepEqual(yield* service.peek(destination), published.enrichment);
assert.deepEqual(yield* service.getAvailable(destination), published.enrichment);
}).pipe(
Effect.provide(
Layer.merge(
ProcessRunner.layer,
layer(
Layer.merge(
RepositoryIdentityResolver.layer.pipe(Layer.provide(NodeServices.layer)),
Layer.succeed(ProjectFaviconResolver.ProjectFaviconResolver, {
resolvePath: () => Effect.succeed(null),
}),
),
),
),
),
),
);
});
16 changes: 14 additions & 2 deletions 16 apps/server/src/project/ProjectEnrichmentService.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export class ProjectEnrichmentService extends Context.Service<
readonly request: (workspaceRoot: string) => Effect.Effect<void>;
readonly getAvailable: (workspaceRoot: string) => Effect.Effect<ProjectEnrichment>;
readonly invalidate: (workspaceRoots: Iterable<string>) => Effect.Effect<void>;
readonly refresh: (workspaceRoot: string) => Effect.Effect<void>;
readonly subscribeChanges: Effect.Effect<
PubSub.Subscription<ProjectEnrichmentChange>,
never,
Expand Down Expand Up @@ -163,9 +164,11 @@ export const make = Effect.fn("ProjectEnrichmentService.make")(function* (

const resolveRepositoryIdentity = Effect.fn("ProjectEnrichmentService.resolveRepositoryIdentity")(
function* (workspaceRoot: string) {
const repositoryIdentity = yield* Cache.get(repositoryIdentityCache, workspaceRoot);
yield* logFailure(workspaceRoot, "repositoryIdentity", repositoryIdentity);
const resolved = yield* Cache.get(repositoryIdentityCache, workspaceRoot);
yield* logFailure(workspaceRoot, "repositoryIdentity", resolved);
const faviconPath = yield* Cache.getSuccess(faviconCache, workspaceRoot);
// Refresh may have replaced the entry while this lookup was running.
const repositoryIdentity = yield* Cache.get(repositoryIdentityCache, workspaceRoot);
const repositoryIdentityResolved = Exit.isSuccess(repositoryIdentity);
yield* PubSub.publish(changes, {
workspaceRoot,
Expand Down Expand Up @@ -290,11 +293,20 @@ export const make = Effect.fn("ProjectEnrichmentService.make")(function* (
);
});

const refresh: ProjectEnrichmentService["Service"]["refresh"] = Effect.fn(
"ProjectEnrichmentService.refresh",
)(function* (workspaceRoot) {
yield* repositoryIdentityResolver.resolve(workspaceRoot, { refresh: true });
yield* invalidate([workspaceRoot]);
yield* resolveRepositoryIdentity(workspaceRoot);
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved

Uh oh!

There was an error while loading. Please reload this page.

});

return ProjectEnrichmentService.of({
peek,
request,
getAvailable,
invalidate,
refresh,
subscribeChanges: PubSub.subscribe(changes),
});
});
Expand Down
3 changes: 2 additions & 1 deletion 3 apps/server/src/ws.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -1227,6 +1227,7 @@ const layerWsRpc = (
const projectSetupScriptRunner = yield* ProjectSetupScriptRunner.ProjectSetupScriptRunner;
const worktreeSetupTracker = yield* WorktreeSetupTracker.WorktreeSetupTracker;
const projectCloneTracker = yield* ProjectCloneTracker.ProjectCloneTracker;
const projectEnrichment = yield* ProjectEnrichmentService.ProjectEnrichmentService;
const repositoryIdentityResolver =
yield* RepositoryIdentityResolver.RepositoryIdentityResolver;
const agentSessionScanner = yield* AgentSessionScanner.AgentSessionScanner;
Expand Down Expand Up @@ -2537,7 +2538,7 @@ const layerWsRpc = (
),
),
onCloned: (project) =>
repositoryIdentityResolver.resolve(project.workspaceRoot, { refresh: true }).pipe(
projectEnrichment.refresh(project.workspaceRoot).pipe(
Effect.andThen(
projectService.update({
commandId: CommandId.make(`project-clone-done:${project.projectId}`),
Expand Down
Loading
Oops, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.