Skip to content

Commit 237dedc

Browse files
Sanitize CLI step failure rendering diagnostics
Co-authored-by: Shri Sukhani <shrisukhani@users.noreply.github.com>
1 parent 62515f1 commit 237dedc

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

currentState.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ HyperAgent exposes a TypeScript SDK for browser automation with three primary pa
129129
- Aligned examine-dom action instruction prompt with the actual supported method set (removed guidance implying arbitrary Playwright methods are valid).
130130
- Replay cached-step execution now honors `cdpActions: false` by skipping CDP XPath resolution/runtime initialization and using Playwright-path action execution for that attempt.
131131
- Normalized CLI shutdown failure logging in `cli/index.ts` to use `formatCliError`, avoiding raw unsanitized shutdown diagnostics.
132+
- Normalized CLI per-step failure rendering in `cli/index.ts` so action error messages are sanitized/truncated via `formatCliError` before display.
132133
- Expanded top-level package exports for key workflow/config types at `@hyperbrowser/agent`.
133134
- Removed stale script entry (`build-dom-tree-script`) and improved README usage docs.
134135
- Added canonical single-action debug writer helper (`writePerformDebug`) while preserving deprecated alias compatibility.

src/cli/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,10 +202,11 @@ program
202202
const onStep = (params: AgentStep) => {
203203
const action = params.agentOutput.action;
204204
const output = params.actionOutput;
205+
const failureMessage = formatCliError(output.message);
205206

206207
const actionDisplay = output.success
207208
? ` └── [${chalk.yellow(action.type)}] ${createdAgent.pprintAction(action as ActionType)}`
208-
: ` └── [${chalk.red(action.type)}] ${chalk.red(output.message)}`;
209+
: ` └── [${chalk.red(action.type)}] ${chalk.red(failureMessage)}`;
209210

210211
currentSpinner.succeed(
211212
`[${chalk.yellow("step")}]: ${params.agentOutput.thoughts}\n${actionDisplay}`

0 commit comments

Comments
 (0)