Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): import agent sessions from a project's linked worktrees #18198

Closedn4mr3g(GitHub profile, opens in a new tab)wants to merge 14 commits intomain fromrefs/pull/18198/headopened View on GitHub

Showing 4 changed files with 174 additions and 2 deletions (loading 1).

x
0 of 4 viewed, 4 left
3 additions and 0 deletionsapps/server/src/project/AgentSessionImporter.test.tsModified
View file
@@ -83,6 +83,7 @@
{ role: "assistant" as const, text: "Fixed", createdAt: timestamp },
],
},
+ worktree: { path: "/workspace/project-feature", branch: "feature" },
} satisfies AgentSessionScanner.AgentSessionRecentThread;
​
@@ -334,6 +335,8 @@
expect(notices).toEqual([]);
expect(records.thread.historyOrigin).toBe("v1_import");
+ expect(records.thread.worktreePath).toBe("/workspace/project-feature");
+ expect(records.thread.branch).toBe("feature");
expect(records.thread.activeProviderThreadId).toBe(records.providerThreads[0]?.id);
expect(records.providerThreads[0]?.nativeThreadRef?.nativeId).toBe(nativeId(source));
expect(Option.getOrThrow(yield* runtimes.getByThreadId({ threadId }))).toMatchObject({
2 additions and 2 deletionsapps/server/src/project/AgentSessionImporter.tsModified
View file
@@ -325,8 +325,8 @@
modelSelection: { instanceId: thread.providerInstanceId, model },
runtimeMode,
interactionMode: DEFAULT_PROVIDER_INTERACTION_MODE,
- branch: null,
- worktreePath: null,
+ branch: outcome.worktree?.branch ?? null,
+ worktreePath: outcome.worktree?.path ?? null,