debug: add stderr callback to SDK engine for error visibility

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
hailin 2026-02-23 06:34:42 -08:00
parent d40f66ce14
commit db1d0620f2
1 changed files with 3 additions and 0 deletions

View File

@ -109,6 +109,9 @@ export class ClaudeAgentSdkEngine implements AgentEnginePort {
abortController, abortController,
allowDangerouslySkipPermissions: true, allowDangerouslySkipPermissions: true,
permissionMode: 'bypassPermissions', permissionMode: 'bypassPermissions',
stderr: (data: string) => {
this.logger.debug(`SDK stderr (${params.sessionId}): ${data.trim()}`);
},
canUseTool: async (toolName, toolInput, { signal }) => { canUseTool: async (toolName, toolInput, { signal }) => {
const riskLevel = this.classifyToolRisk(toolName, toolInput); const riskLevel = this.classifyToolRisk(toolName, toolInput);