Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): import sessions from linked worktrees into their worktree #33401

Closeddominikzabcik(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/33401/headopened View on GitHub

Showing 5 changed files with 32 additions and 8 deletions (loading 3).

x
0 of 5 viewed, 5 left
29 additions and 6 deletionsapps/server/src/project/AgentSessionImporter.test.tsModified
View file
@@ -1,5 +1,6 @@
import { expect, it } from "@effect/vitest";
import {
+ type AgentSessionImportSource,
type AgentSessionSource,
type ServerSettingsError,
EventId,
@@ -82,6 +83,7 @@
{ role: "user" as const, text: "Fix it", createdAt: timestamp },
{ role: "assistant" as const, text: "Fixed", createdAt: timestamp },
],
+ worktree: null as AgentSessionScanner.AgentSessionThread["worktree"],
},
} satisfies AgentSessionScanner.AgentSessionRecentThread;
@@ -181,6 +183,7 @@
const events = yield* EventStore.EventStoreV2;
const projections = yield* ProjectionStore.ProjectionStoreV2;
const published: Array<ApplicationStoredEvent> = [];
+ const completedSources: Array<ReadonlyArray<AgentSessionImportSource>> = [];
const withTransaction: typeof sql.withTransaction = (effect) =>
beforeTransaction.pipe(Effect.andThen(sql.withTransaction(effect)));
const importSql = new Proxy(sql, {
@@ -218,7 +221,10 @@
yield* ProviderSessionRuntime.ProviderSessionRuntimeRepository,
Layer.mock(AgentSessionScanner.AgentSessionScanner)({
- recentThreads: () => Stream.fromIterable(candidates),