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 24, 22:45 UTC
[codex] Sanitize text generation CLI errors (#3431)
Co-authored-by: codex <codex@users.noreply.github.com>
Julius Marminge committed
Jun 20, 2026 at 12:33 UTC
621616268af212c9550aecc883b75beb42b3c1bd
2 files changed
+13
-1
apps/server/src/textGeneration/TextGenerationPrompts.test.ts
+12
@@ -190,4 +190,16 @@ describe("normalizeCliError", () => {
190
expect(result).toBeInstanceOf(TextGenerationError);
191
expect(result.detail).toBe("fallback");
192
});
193
+
194
+ it("does not expose CLI failure details in the public error message", () => {
195
+ const result = normalizeCliError(
196
+ "codex",
197
+ "generateCommitMessage",
198
+ new Error("request failed with access_token=secret-token"),
199
+ "Failed to generate a commit message",
200
+ );
201
+
202
+ expect(result.detail).toBe("Failed to generate a commit message");
203
+ expect(result.message).not.toContain("secret-token");
204
+ });
205
});
apps/server/src/textGeneration/TextGenerationUtils.ts
+1
-1
@@ -99,7 +99,7 @@ export function normalizeCliError(
99
}
100
return new TextGenerationError({
101
operation,
102
- detail: `${fallback}: ${error.message}`,
102
+ detail: fallback,
103
cause: error,
104
});
105
}