Skip to content

Commit 9a40ecf

Browse files
some-du6eclaude
andcommitted
test(server): trim the project-move test
Co-authored-by: Claude Opus 5.5 <[email protected]>
1 parent 8b875b3 commit 9a40ecf

2 files changed

Lines changed: 10 additions & 36 deletions

File tree

‎apps/server/src/orchestration-v2/Orchestrator.ts‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2945,7 +2945,6 @@ const makeOrchestrator = Effect.fn("orchestrationV2.Orchestrator.layer")(functio
29452945
command.type === "thread.metadata.update" && command.projectId !== thread.projectId
29462946
? command.projectId
29472947
: undefined;
2948-
const movesProject = targetProjectId !== undefined;
29492948
if (targetProjectId !== undefined) {
29502949
const project = yield* projects.get(targetProjectId).pipe(mapDispatchError(command));
29512950
if (Option.isNone(project) || project.value.deletedAt !== null) {
@@ -3147,7 +3146,7 @@ const makeOrchestrator = Effect.fn("orchestrationV2.Orchestrator.layer")(functio
31473146
}
31483147

31493148
const changesWorkspace =
3150-
movesProject ||
3149+
targetProjectId !== undefined ||
31513150
(command.type === "thread.metadata.update" &&
31523151
command.worktreePath !== undefined &&
31533152
command.worktreePath !== thread.worktreePath);
@@ -3477,7 +3476,7 @@ const makeOrchestrator = Effect.fn("orchestrationV2.Orchestrator.layer")(functio
34773476
updatedAt: now,
34783477
};
34793478
// Watches read through the project's checkout, which no longer holds these links.
3480-
return movesProject
3479+
return targetProjectId !== undefined
34813480
? {
34823481
...updated,
34833482
pullRequests: updated.pullRequests?.map((link) =>

‎apps/server/src/orchestration-v2/runtimeLayer.test.ts‎

Lines changed: 8 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1878,18 +1878,13 @@ it.layer(layerTest)("OrchestrationV2LayerLive lifecycle", (it) => {
18781878
const threadId = ThreadId.make("runtime-layer-move-thread");
18791879
const fromProjectId = ProjectId.make("runtime-layer-move-from");
18801880
const toProjectId = ProjectId.make("runtime-layer-move-to");
1881-
for (const [projectId, workspaceRoot] of [
1882-
[fromProjectId, "/workspace/move-from"],
1883-
[toProjectId, "/workspace/move-to"],
1884-
] as const) {
1885-
yield* seedProject({
1886-
projectId,
1887-
title: projectId,
1888-
workspaceRoot,
1889-
defaultModelSelection: null,
1890-
createdAt: "2026-09-07T00:00:00.000Z",
1891-
});
1892-
}
1881+
yield* seedProject({
1882+
projectId: toProjectId,
1883+
title: "Move target",
1884+
workspaceRoot: "/workspace/move-to",
1885+
defaultModelSelection: null,
1886+
createdAt: "2026-09-07T00:00:00.000Z",
1887+
});
18931888
yield* orchestrator.dispatch({
18941889
type: "thread.create",
18951890
createdBy: "user",
@@ -1904,7 +1899,6 @@ it.layer(layerTest)("OrchestrationV2LayerLive lifecycle", (it) => {
19041899
branch: "feature/move",
19051900
worktreePath: "/workspace/move-from-worktree",
19061901
});
1907-
19081902
yield* orchestrator.dispatch({
19091903
type: "thread.pull-request.watch",
19101904
commandId: CommandId.make("runtime-layer-move-watch"),
@@ -1915,35 +1909,20 @@ it.layer(layerTest)("OrchestrationV2LayerLive lifecycle", (it) => {
19151909
watching: true,
19161910
link: { url: "https://github.com/pingdotgg/t3code/pull/1", source: "manual" },
19171911
});
1918-
1919-
const missingProject = yield* orchestrator
1920-
.dispatch({
1921-
type: "thread.metadata.update",
1922-
commandId: CommandId.make("runtime-layer-move-missing"),
1923-
threadId,
1924-
projectId: ProjectId.make("runtime-layer-move-missing-project"),
1925-
})
1926-
.pipe(Effect.flip);
1927-
assert.instanceOf(missingProject, Orchestrator.OrchestratorDispatchError);
1928-
19291912
yield* orchestrator.dispatch({
19301913
type: "thread.metadata.update",
19311914
commandId: CommandId.make("runtime-layer-move-to"),
19321915
threadId,
19331916
projectId: toProjectId,
19341917
});
19351918
const moved = (yield* orchestrator.getThreadProjection(threadId)).thread;
1936-
assert.equal(moved.projectId, toProjectId);
1937-
assert.isNull(moved.branch);
1938-
assert.isNull(moved.worktreePath);
1939-
assert.lengthOf(moved.pullRequests ?? [], 1);
1919+
assert.deepInclude(moved, { projectId: toProjectId, branch: null, worktreePath: null });
19401920
assert.isUndefined(moved.pullRequests?.[0]?.watch);
19411921
const shell = yield* orchestrator.getShellSnapshot();
19421922
assert.equal(
19431923
shell.threads.find((candidate) => candidate.id === threadId)?.projectId,
19441924
toProjectId,
19451925
);
1946-
19471926
yield* orchestrator.dispatch({
19481927
type: "message.dispatch",
19491928
createdBy: "user",
@@ -1965,10 +1944,6 @@ it.layer(layerTest)("OrchestrationV2LayerLive lifecycle", (it) => {
19651944
})
19661945
.pipe(Effect.flip);
19671946
assert.instanceOf(busy, Orchestrator.OrchestratorDispatchError);
1968-
assert.equal(
1969-
(yield* orchestrator.getThreadProjection(threadId)).thread.projectId,
1970-
toProjectId,
1971-
);
19721947
}),
19731948
);
19741949

0 commit comments

Comments
 (0)