diff --git a/package-lock.json b/package-lock.json index 38d079b76..afa5b11bd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26395,6 +26395,7 @@ "pino-pretty": "^13.1.3", "playwright": "^1.56.1", "qrcode": "^1.5.4", + "strip-ansi": "^7.1.2", "tiny-invariant": "^1.3.3", "uuid": "^9.0.1", "ws": "^8.14.2", @@ -26530,6 +26531,18 @@ "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", "license": "MIT" }, + "packages/server/node_modules/ansi-regex": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, "packages/server/node_modules/body-parser": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.2.0.tgz", @@ -26713,6 +26726,21 @@ "node": ">= 18" } }, + "packages/server/node_modules/strip-ansi": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz", + "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, "packages/server/node_modules/type-is": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/type-is/-/type-is-2.0.1.tgz", diff --git a/packages/app/src/components/grouped-agent-list.tsx b/packages/app/src/components/grouped-agent-list.tsx index 22b2c471b..bec37a987 100644 --- a/packages/app/src/components/grouped-agent-list.tsx +++ b/packages/app/src/components/grouped-agent-list.tsx @@ -743,6 +743,7 @@ const styles = StyleSheet.create((theme) => ({ }, branchBadge: { minWidth: 20, + maxWidth: "30%", height: 20, paddingHorizontal: theme.spacing[2], borderRadius: theme.borderRadius.md, diff --git a/packages/server/package.json b/packages/server/package.json index 0d5739424..de7bc230c 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -46,6 +46,7 @@ "pino-pretty": "^13.1.3", "playwright": "^1.56.1", "qrcode": "^1.5.4", + "strip-ansi": "^7.1.2", "tiny-invariant": "^1.3.3", "uuid": "^9.0.1", "ws": "^8.14.2", diff --git a/packages/server/src/utils/tool-call-parsers.ts b/packages/server/src/utils/tool-call-parsers.ts index 14111d785..b6a66ec29 100644 --- a/packages/server/src/utils/tool-call-parsers.ts +++ b/packages/server/src/utils/tool-call-parsers.ts @@ -1,3 +1,4 @@ +import stripAnsi from "strip-ansi"; import { z } from "zod"; // ---- Principal Parameter Extraction ---- @@ -18,9 +19,9 @@ const PrincipalParamSchema = z.union([ z.object({ filePath: z.string() }).transform((d) => ({ type: "path" as const, value: d.filePath })), z.object({ path: z.string() }).transform((d) => ({ type: "path" as const, value: d.path })), // Command as string - z.object({ command: z.string() }).transform((d) => ({ type: "command" as const, value: d.command })), + z.object({ command: z.string() }).transform((d) => ({ type: "command" as const, value: stripAnsi(d.command) })), // Command as array (Codex sends this) - z.object({ command: z.array(z.string()).nonempty() }).transform((d) => ({ type: "command" as const, value: d.command.join(" ") })), + z.object({ command: z.array(z.string()).nonempty() }).transform((d) => ({ type: "command" as const, value: stripAnsi(d.command.join(" ")) })), // Other text params z.object({ title: z.string() }).transform((d) => ({ type: "text" as const, value: d.title })), z.object({ name: z.string() }).transform((d) => ({ type: "text" as const, value: d.name })),