Skip to content

Commit d1a6955

Browse files
fix(mcp): preserve inventory interruption semantics
1 parent f8504a0 commit d1a6955

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

‎apps/server/src/mcp/WorktreeMcpService.ts‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -644,24 +644,24 @@ const make = Effect.gen(function* () {
644644
const candidateResults = yield* Effect.forEach(
645645
recordedPathsToResolve,
646646
(recordedPath) =>
647-
Effect.exit(loadWorktrees(recordedPath)).pipe(
648-
Effect.map((candidateExit) => ({ recordedPath, candidateExit })),
647+
Effect.option(loadWorktrees(recordedPath)).pipe(
648+
Effect.map((candidateInventory) => ({ recordedPath, candidateInventory })),
649649
),
650650
{ concurrency: 8 },
651651
);
652652
let failedCandidateCount = 0;
653-
for (const { recordedPath, candidateExit } of candidateResults) {
654-
if (Exit.isFailure(candidateExit)) {
653+
for (const { recordedPath, candidateInventory } of candidateResults) {
654+
if (Option.isNone(candidateInventory)) {
655655
failedCandidateCount += 1;
656656
continue;
657657
}
658-
const candidateInventory = candidateExit.value;
658+
const candidate = candidateInventory.value;
659659
if (
660-
candidateInventory.repositoryCommonDir === inventory.repositoryCommonDir &&
661-
candidateInventory.currentWorktreeRoot !== null &&
662-
branchByWorkspacePath.has(candidateInventory.currentWorktreeRoot)
660+
candidate.repositoryCommonDir === inventory.repositoryCommonDir &&
661+
candidate.currentWorktreeRoot !== null &&
662+
branchByWorkspacePath.has(candidate.currentWorktreeRoot)
663663
) {
664-
physicalRootByRecordedPath.set(recordedPath, candidateInventory.currentWorktreeRoot);
664+
physicalRootByRecordedPath.set(recordedPath, candidate.currentWorktreeRoot);
665665
}
666666
}
667667
const threadWorkspaces = recordedThreadWorkspaces.map(

0 commit comments

Comments
 (0)