Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1511,12 +1511,10 @@ describe("ClaudeAdapterV2 attachments", () => {
Effect.gen(function* () {
if (failOpen) {
failOpen = false;
return yield* Effect.fail(
new ClaudeAdapterV2.ClaudeAgentSdkQueryRunnerError({
method: "open",
cause: "rejected open",
}),
);
return yield* new ClaudeAdapterV2.ClaudeAgentSdkQueryRunnerError({
method: "open",
cause: "rejected open",
});
}
const messages = yield* Queue.unbounded<SDKMessage>();
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7175,7 +7175,7 @@ export const makeCodexAdapterV2 = Effect.fn("makeCodexAdapterV2")(function* (
const terminationResults = yield* terminateTrackedTerminals(interruptTargets);
const failedTermination = terminationResults.find((result) => !result.success);
if (failedTermination !== undefined && !failedTermination.success) {
return yield* Effect.fail(failedTermination.error);
return yield* failedTermination.error;
}
yield* turnTerminalizationPermit.withPermits(1)(
Effect.gen(function* () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1195,7 +1195,7 @@ const make = Effect.gen(function* () {
),
);
}
if (failures[0] !== undefined) return yield* Effect.fail(failures[0]);
if (failures[0] !== undefined) return yield* failures[0];
});

return ThreadManagementService.of({
Expand Down
12 changes: 5 additions & 7 deletions apps/server/src/provider/ProviderAuthService.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,13 +281,11 @@ const makeHarness = Effect.fn("ProviderAuthService.test.makeHarness")(function*
actions.push(`stop:${providerSessionId}`);
yield* input.beforeStop ?? Effect.void;
if (input.stopError) {
return yield* Effect.fail(
new ProviderSessionManager.ProviderSessionReleaseError({
providerSessionId,
reason,
cause: new Error("private process diagnostics"),
}),
);
return yield* new ProviderSessionManager.ProviderSessionReleaseError({
providerSessionId,
reason,
cause: new Error("private process diagnostics"),
});
}
released.push(providerSessionId);
for (const [threadId, list] of sessions) {
Expand Down
14 changes: 6 additions & 8 deletions apps/server/src/storageCleanup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -692,14 +692,12 @@ const make = Effect.gen(function* () {
timeoutMs: 300_000,
});
if (result.exitCode !== 0)
return yield* Effect.fail(
new GitCommandError({
operation: "StorageCleanup.cleanupGit",
command,
cwd,
detail: result.stderr.trim().split(/\r?\n/)[0]?.slice(0, 1000) || "command failed",
}),
);
return yield* new GitCommandError({
operation: "StorageCleanup.cleanupGit",
command,
cwd,
detail: result.stderr.trim().split(/\r?\n/)[0]?.slice(0, 1000) || "command failed",
});
});

const cleanWorktrees = Effect.fn("StorageCleanup.cleanWorktrees")(function* (
Expand Down
30 changes: 12 additions & 18 deletions apps/server/src/ws.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2430,29 +2430,23 @@ export const layerWsRpc = (
) ?? projection.providerThreads.at(-1);
const providerSessionId = providerThread?.providerSessionId ?? null;
if (providerThread === undefined || providerSessionId === null) {
return yield* Effect.fail(
new ProviderUploadFeedbackError({
threadId: input.threadId,
cause: "No provider session has run in this thread yet.",
}),
);
return yield* new ProviderUploadFeedbackError({
threadId: input.threadId,
cause: "No provider session has run in this thread yet.",
});
}
const runtime = Option.getOrNull(yield* providerSessionsV2.get(providerSessionId));
if (runtime === null) {
return yield* Effect.fail(
new ProviderUploadFeedbackError({
threadId: input.threadId,
cause: "The provider session is no longer running. Send a message first.",
}),
);
return yield* new ProviderUploadFeedbackError({
threadId: input.threadId,
cause: "The provider session is no longer running. Send a message first.",
});
}
if (runtime.uploadFeedback === undefined) {
return yield* Effect.fail(
new ProviderUploadFeedbackError({
threadId: input.threadId,
cause: `Provider '${runtime.driver}' does not support feedback uploads.`,
}),
);
return yield* new ProviderUploadFeedbackError({
threadId: input.threadId,
cause: `Provider '${runtime.driver}' does not support feedback uploads.`,
});
}
return yield* runtime.uploadFeedback({
providerThread,
Expand Down
10 changes: 4 additions & 6 deletions packages/client-runtime/src/state/commandPermissions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,10 @@ function makeCommandPermissions<R, E>(
(scope) => Option.isNone(session) || !sessionGrantsScope(session.value, scope),
);
if (missing !== undefined)
return yield* Effect.fail(
new EnvironmentAuthorizationError({
...authScopeRequiredResponse(missing),
message: `This connection requires ${missing}.`,
}),
);
return yield* new EnvironmentAuthorizationError({
...authScopeRequiredResponse(missing),
message: `This connection requires ${missing}.`,
});
}),
);
});
Expand Down
2 changes: 1 addition & 1 deletion packages/provider-opencode/src/server/adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1061,7 +1061,7 @@ export const makeOpenCodeAdapterV2 = Effect.fn("makeOpenCodeAdapterV2")(function
return firstFailure ?? failures.find((failure) => failure !== undefined);
});
const failure = yield* visit(rootId, false);
if (failure) return yield* Effect.fail(failure);
if (failure) return yield* failure;
}, Effect.timeout("15 seconds"));

const updateProviderSession =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ const refused = Effect.fn("gitHubGraphQlClient.refused")(function* (
) {
const reason = error.reason;
if (reason._tag !== "TransportError" && reason._tag !== "ResponseError") {
return yield* Effect.fail(error);
return yield* error;
}
const status = reason.status;
if (reason._tag === "TransportError" && status === undefined) {
Expand Down
1 change: 1 addition & 0 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"namespaceImportPackages": ["@effect/platform-node", "effect"],
"effectFn": ["span", "inferred-span", "suggested-span"],
"diagnosticSeverity": {
"unnecessaryFailYieldableError": "error",
"preferSucceedSomeOrNone": "error",
"effectSucceedWithVoid": "error",
"provideLayerSucceedToProvideService": "error",
Expand Down
Loading