Skip to content
Open
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
2 changes: 1 addition & 1 deletion apps/server/src/provider/Layers/ClaudeAdapter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ describe("ClaudeAdapterLive", () => {

const createInput = harness.getLastCreateQueryInput();
assert.deepEqual(createInput?.options.settingSources, ["user", "project", "local"]);
assert.equal(createInput?.options.permissionMode, undefined);
assert.equal(createInput?.options.permissionMode, "default");
assert.equal(createInput?.options.allowDangerouslySkipPermissions, undefined);
}).pipe(
Effect.provideService(Random.Random, makeDeterministicRandomService()),
Expand Down
6 changes: 4 additions & 2 deletions apps/server/src/provider/Layers/ClaudeAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import {
TurnId,
type UserInputQuestion,
ClaudeCodeEffort,
RuntimeMode,
} from "@t3tools/contracts";
import {
applyClaudePromptEffortPrefix,
Expand Down Expand Up @@ -2693,7 +2694,8 @@ const makeClaudeAdapter = Effect.fn("makeClaudeAdapter")(function* (
? modelSelection.options.thinking
: undefined;
const effectiveEffort = getEffectiveClaudeCodeEffort(effort);
const runtimeModeToPermission: Record<string, PermissionMode> = {
const runtimeModeToPermission: Record<RuntimeMode, PermissionMode> = {
"approval-required": "default",
"auto-accept-edits": "acceptEdits",
"full-access": "bypassPermissions",
};
Expand All @@ -2709,7 +2711,7 @@ const makeClaudeAdapter = Effect.fn("makeClaudeAdapter")(function* (
pathToClaudeCodeExecutable: claudeBinaryPath,
settingSources: [...CLAUDE_SETTING_SOURCES],
...(effectiveEffort ? { effort: effectiveEffort } : {}),
...(permissionMode ? { permissionMode } : {}),
permissionMode,
...(permissionMode === "bypassPermissions"
? { allowDangerouslySkipPermissions: true }
: {}),
Expand Down
Loading