#1129, add usage update in ACP mode

This commit is contained in:
tanzhenxin
2025-12-09 09:58:19 +08:00
parent efbf50554d
commit d7b9466516
15 changed files with 279 additions and 28 deletions

View File

@@ -279,10 +279,14 @@ export class ToolCallEmitter extends BaseEmitter {
string,
unknown
>;
const outputField = resp['output'];
const errorField = resp['error'];
const responseText =
(resp['output'] as string) ??
(resp['error'] as string) ??
JSON.stringify(resp);
typeof outputField === 'string'
? outputField
: typeof errorField === 'string'
? errorField
: JSON.stringify(resp);
result.push({
type: 'content',
content: { type: 'text', text: responseText },