!feat(cli): harden non-interactive agent session handling

This commit is contained in:
Adam Weidman
2026-03-20 14:33:57 -04:00
committed by Adam Weidman
parent 24a4a0da1e
commit 7c7150f487
4 changed files with 300 additions and 52 deletions
+2 -1
View File
@@ -6,6 +6,7 @@
import stripAnsi from 'strip-ansi';
import type { SessionMetrics } from '../telemetry/uiTelemetry.js';
import { getErrorType } from '../utils/errors.js';
import type { JsonError, JsonOutput } from './types.js';
export class JsonFormatter {
@@ -42,7 +43,7 @@ export class JsonFormatter {
sessionId?: string,
): string {
const jsonError: JsonError = {
type: error.constructor.name,
type: getErrorType(error),
message: stripAnsi(error.message),
...(code && { code }),
};