@devries-cameron20 / t3code-1 / commits / ea4e7c1a60
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

fix(acp): permission answers send the agent's option id unchanged (#35837)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

Julius Marminge committed Nov 14, 2026 at 20:54 UTC ea4e7c1a6042e70341dd9d3de6724f4a1566c761
2 files changed +17 -1
apps/server/src/orchestration-v2/Adapters/AcpAdapterV2.test.ts
+16
@@ -5877,6 +5877,22 @@ describe("AcpAdapterV2", () => {
5877 ],
5878 optionId: "allow-once",
5879 },
5880 + {
5881 + label: "answers Always allow with the agent's option id unchanged when it has spaces",
5882 + options: [
5883 + { optionId: " opaque-choice ", name: "Allow once", kind: "allow_once" },
5884 + { optionId: "reject-once", name: "Reject", kind: "reject_once" },
5885 + ],
5886 + optionId: " opaque-choice ",
5887 + },
5888 + {
5889 + label: "answers Always allow with a whitespace-only option id instead of cancelling",
5890 + options: [
5891 + { optionId: " ", name: "Allow once", kind: "allow_once" },
5892 + { optionId: "reject-once", name: "Reject", kind: "reject_once" },
5893 + ],
5894 + optionId: " ",
5895 + },
5896 ] as const)("$label", ({ options, optionId }) =>
5897 Effect.gen(function* () {
5898 const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner;
packages/provider-acp/src/server/adapter.ts
+1 -1
@@ -1415,7 +1415,7 @@ function selectPermissionOptionId(
1415 decision: Exclude<ProviderApprovalDecision, "cancel">,
1416 ): string | undefined {
1417 const optionIdOfKind = (kind: EffectAcpSchema.PermissionOption["kind"]) =>
1418 - request.options.find((option) => option.kind === kind)?.optionId.trim() || undefined;
1418 + request.options.find((option) => option.kind === kind)?.optionId;
1419 if (decision === "acceptForSession") {
1420 // Agents may offer only allow_once, and answering "cancelled" would stop the turn the user approved.
1421 return optionIdOfKind("allow_always") ?? optionIdOfKind("allow_once");