Skip to content

Commit 471cdee

Browse files
committed
fix(cursor): resolve Check type errors on native Task branch
- finishLiveTasks now declares the ProviderAdapterRequestError channel carried by makeEventStamp instead of claiming Effect<void>. - acp-mock-agent delayed completion uses Effect.forkDetach + Effect.sleep instead of setTimeout inside Effect.sync (effect/globalTimersInEffect).
1 parent f5056c4 commit 471cdee

2 files changed

Lines changed: 17 additions & 13 deletions

File tree

‎apps/server/scripts/acp-mock-agent.ts‎

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -656,18 +656,22 @@ const program = Effect.gen(function* () {
656656
if (!hangPromptForever) {
657657
const completeAfterMs =
658658
Number.isFinite(promptDelayMs) && promptDelayMs > 0 ? promptDelayMs + 200 : 80;
659-
yield* Effect.sync(() => {
660-
setTimeout(() => {
661-
writeJsonRpcNotification("session/update", {
662-
sessionId: requestedSessionId,
663-
update: {
664-
sessionUpdate: "tool_call_update",
665-
toolCallId,
666-
status: "completed",
667-
},
668-
});
669-
}, completeAfterMs);
670-
});
659+
yield* Effect.forkDetach(
660+
Effect.sleep(`${completeAfterMs} millis`).pipe(
661+
Effect.andThen(
662+
Effect.sync(() => {
663+
writeJsonRpcNotification("session/update", {
664+
sessionId: requestedSessionId,
665+
update: {
666+
sessionUpdate: "tool_call_update",
667+
toolCallId,
668+
status: "completed",
669+
},
670+
});
671+
}),
672+
),
673+
),
674+
);
671675
}
672676
if (hangPromptForever) {
673677
return yield* Effect.never;

‎apps/server/src/provider/Layers/CursorAdapter.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ export function makeCursorAdapter(
416416
const finishLiveTasks = (
417417
ctx: CursorSessionContext,
418418
status: "failed" | "stopped",
419-
): Effect.Effect<void> =>
419+
): Effect.Effect<void, ProviderAdapterRequestError> =>
420420
Effect.gen(function* () {
421421
for (const [toolCallId, live] of ctx.liveTasks) {
422422
yield* offerRuntimeEvent({

0 commit comments

Comments
 (0)