Use default behavior for bypassPermissions mode (#75)

They updated the types to allow us to just pass this through now. So we
shouldn't have to have the special casing here.
This commit is contained in:
Ben Brandt
2025-09-29 23:13:12 +02:00
committed by GitHub
parent 2aa181be27
commit 71e745d5fb

View File

@@ -377,16 +377,11 @@ export class ClaudeAcpAgent implements Agent {
switch (params.modeId) {
case "default":
case "acceptEdits":
case "bypassPermissions":
case "plan":
this.sessions[params.sessionId].permissionMode = params.modeId;
await this.sessions[params.sessionId].query.setPermissionMode(params.modeId);
return {};
case "bypassPermissions":
// For some reason, the SDK doesn't support setting the mode to `bypassPermissions`
// so we do it ourselves
this.sessions[params.sessionId].permissionMode = "bypassPermissions";
await this.sessions[params.sessionId].query.setPermissionMode("acceptEdits");
return {};
default:
throw new Error("Invalid mode");
}