fix(claude): redact launch arguments from protocol logs

Fixes review: https://github.com/pingdotgg/t3code/pull/2829#discussion_r3471595059

Co-authored-by: codex <[email protected]>
This commit is contained in:
Julius Marmingeandcodex authored and maria-rcks committed 2026-08-03 11:45:08 -04:00
1 parent f2e1dd1e27
commit 597b02dc53
2 files changed
+7 -2

No files matched your search

@@ -497,6 +497,9 @@ describe("ClaudeAdapterV2 native protocol logging", () => {
env: {
ANTHROPIC_API_KEY: "secret",
},
extraArgs: {
"append-system-prompt": "secret launch prompt",
},
canUseTool: (_toolName, input, callbackOptions) =>
Promise.resolve({
behavior: "allow",
@@ -517,7 +520,9 @@ describe("ClaudeAdapterV2 native protocol logging", () => {
cwd: "/workspace",
hasCanUseTool: true,
hasEnvironment: true,
hasExtraArgs: true,
});
assert.notInclude(JSON.stringify(loggedClaudeQueryOptions(options)), "secret launch prompt");
});
});
@@ -344,7 +344,7 @@ export interface ClaudeAgentSdkLoggedQueryOptions {
readonly effort?: ClaudeAgentSdkQueryOptions["effort"];
readonly includePartialMessages?: true;
readonly pathToClaudeCodeExecutable?: ClaudeAgentSdkQueryOptions["pathToClaudeCodeExecutable"];
readonly extraArgs?: ClaudeAgentSdkQueryOptions["extraArgs"];
readonly hasExtraArgs?: true;
readonly allowDangerouslySkipPermissions?: true;
readonly hasCanUseTool?: true;
readonly hasEnvironment?: true;
@@ -436,7 +436,7 @@ export function loggedClaudeQueryOptions(
...(options.pathToClaudeCodeExecutable === undefined
? {}
: { pathToClaudeCodeExecutable: options.pathToClaudeCodeExecutable }),
...(options.extraArgs === undefined ? {} : { extraArgs: options.extraArgs }),
...(options.extraArgs === undefined ? {} : { hasExtraArgs: true }),
...(options.allowDangerouslySkipPermissions === true
? { allowDangerouslySkipPermissions: true }
: {}),