feat: 更新 SmartContentFormatter,确保格式化内容始终返回可显示的字符串

This commit is contained in:
catlog22
2026-01-11 22:37:44 +08:00
parent 7f3033b1c1
commit 37614a3362
7 changed files with 100 additions and 39 deletions

View File

@@ -565,8 +565,8 @@ export async function handleCliRoutes(ctx: RouteContext): Promise<boolean> {
parentExecutionId,
stream: true
}, (unit) => {
// CliOutputUnit handler: use SmartContentFormatter for intelligent formatting
const content = SmartContentFormatter.format(unit.content, unit.type) || JSON.stringify(unit.content);
// CliOutputUnit handler: use SmartContentFormatter for intelligent formatting (never returns null)
const content = SmartContentFormatter.format(unit.content, unit.type);
// Append to active execution buffer
const activeExec = activeExecutions.get(executionId);