@devries-cameron20 / t3code Mirror · read-only / commits / 365a62aa84
Fork 0

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

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 12:15 UTC

fix(server): Claude knows decline feedback is the user's message (#27871)

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

Julius Marminge committed Nov 14, 2026 at 20:54 UTC 365a62aa84f498894a84e63be988d73a77768803
2 files changed +21 -4
apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.ts
+16
@@ -970,6 +970,22 @@ describe("ClaudeAdapterV2 session permissions", () => {
970 assert.equal(result.decisionClassification, "user_reject");
971 assert.equal(result.message, "User declined tool execution.");
972 assert.equal(result.interrupt, undefined);
973 +
974 + // regression: #27854 bare feedback read to Claude as a tool error, not the user's words
975 + const withFeedback = ClaudeAdapterV2.permissionResultFromDecision({
976 + toolName: "Bash",
977 + decision: "decline",
978 + toolInput: { command: "make" },
979 + toolUseID: "denied-build",
980 + feedback: " Use the dry-run flag first. ",
981 + });
982 + assert.equal(withFeedback.behavior, "deny");
983 + if (withFeedback.behavior !== "deny") return;
984 + assert.equal(withFeedback.decisionClassification, "user_reject");
985 + assert.equal(
986 + withFeedback.message,
987 + "The user declined this tool call and said:\nUse the dry-run flag first.",
988 + );
989 });
990
991 it("forces suggested permission updates to session scope", () => {
apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.ts
+5 -4
@@ -4274,13 +4274,14 @@ export function permissionResultFromDecision(input: {
4274 };
4275 }
4276
4277 + const feedback = input.feedback?.trim();
4278 return {
4279 behavior: "deny",
4279 - message:
4280 - input.feedback?.trim() ||
4281 - (input.decision === "cancel"
4280 + message: feedback
4281 + ? `The user declined this tool call and said:\n${feedback}`
4282 + : input.decision === "cancel"
4283 ? "User cancelled tool execution."
4283 - : "User declined tool execution."),
4284 + : "User declined tool execution.",
4285 toolUseID: input.toolUseID,
4286 decisionClassification: "user_reject",
4287 ...(input.decision === "cancel" ? { interrupt: true } : {}),