fix: disable tool approve for old claude code version

This commit is contained in:
d-kimsuon
2025-10-14 12:18:29 +09:00
parent b483e7e918
commit a88ad89972
4 changed files with 53 additions and 60 deletions

View File

@@ -19,7 +19,7 @@ export class ClaudeCodeExecutor {
? resolve(executablePath)
: execSync("which claude", {}).toString().trim();
this.claudeCodeVersion = ClaudeCodeVersion.fromCLIString(
execSync(`${this.pathToClaudeCodeExecutable} --version`, {}).toString()
execSync(`${this.pathToClaudeCodeExecutable} --version`, {}).toString(),
);
}
@@ -27,11 +27,11 @@ export class ClaudeCodeExecutor {
return {
enableToolApproval:
this.claudeCodeVersion?.greaterThanOrEqual(
new ClaudeCodeVersion({ major: 1, minor: 0, patch: 82 })
new ClaudeCodeVersion({ major: 1, minor: 0, patch: 82 }),
) ?? false,
extractUuidFromSDKMessage:
this.claudeCodeVersion?.greaterThanOrEqual(
new ClaudeCodeVersion({ major: 1, minor: 0, patch: 86 })
new ClaudeCodeVersion({ major: 1, minor: 0, patch: 86 }),
) ?? false,
};
}