Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): preserve Claude final-result API error text #19136

MergedMarve10s(GitHub profile, opens in a new tab)merged 6 commits intomain fromrefs/pull/19136/headmerged by juliusmarminge View on GitHub

Showing 2 changed files with 100 additions and 3 deletions.

x
0 of 2 viewed, 2 left
93 additions and 2 deletionsapps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.tsModified
View file
@@ -3611,6 +3611,97 @@
+ it.effect.each([
+ {
+ name: "an unflagged result with surrounding whitespace",
+ isError: false,
+ result: " API Error: 400 Request rejected by a safeguard.\n",
+ expected: "API Error: 400 Request rejected by a safeguard.",
+ },
+ {
+ name: "a secret crossing the truncation boundary",
+ isError: true,
+ result: `API Error: 400 ${"x".repeat(440)} {"token":"${"synthetic-secret".repeat(100)}"} ${"y".repeat(100)}`,
+ expected: `API Error: 400 ${"x".repeat(440)} {"token":"[REDACTED]"} `.padEnd(500, "y"),
+ },
+ {
+ name: "ordinary assistant text",
+ isError: true,
+ result: "I found three files.",
+ expected: "Claude gave up after repeated API errors.",
+ },
+ {
+ name: "a listed non-diagnostic error",
+ isError: true,
+ result: "API Error: 400 Request rejected.",
+ errors: ["[ede_diagnostic] internal detail", "Tool execution failed: EACCES"],
+ expected: "Tool execution failed: EACCES",
+ },