Skip to content

Exit nonzero on failed playwright and process execution, accept headless memory sizes - #305

Merged
rgarcia merged 1 commit into
mainfrom
hypeship/cli-exec-exit-memory
Oct 28, 2026
Merged

rgarcia merged 1 commit into
mainfrom
hypeship/cli-exec-exit-memory

Conversation

@rgarcia

@rgarcia rgarcia commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Failed executions now exit nonzero

  • browsers playwright execute used to exit 0 when the response had success: false, so set -e and $? checks carried on after failed browser code.
  • It now exits 1 in both table and JSON output.
  • Table output prints the error once on stderr: the message verbatim, including Playwright's multi-line call log, followed by the stack frames. Before, it printed the stack, which already starts with the message, and then printed the message again as ERROR: error: ....
  • JSON output is unchanged on stdout and adds nothing on stderr.
  • browsers process exec now exits 1 when the remote process exits nonzero. The exit code is already shown in the result, so nothing extra is printed.

Headless memory sizes are accepted

  • --memory on browsers create, browsers pools create and browsers pools update now accepts 1GiB, 2GiB and 4GiB as well as 8GiB and 16GiB.
  • These are the sizes the API supports for headless browsers. Before, the CLI rejected them before sending any request.
  • Which sizes are valid for which browser mode is left to the API, so the CLI no longer keeps its own copy of that rule.

One request instead of two

  • playwright execute and process exec no longer GET the browser before the call.
  • Both endpoints accept an ID or a name, so the lookup only added a control-plane round trip to every call.

Behavior change: scripts that relied on exit 0 after a failed execution will now stop. This is the intended fix, but it is worth a changelog note.

Testing

  • go vet ./... and go test ./... pass.
  • Added or updated tests:
    • nonzero exit for table and JSON output
    • silent errors, so nothing is printed twice
    • stackFrames
    • process exec with a nonzero exit
    • a headless memory size
    • the single execute request
  • QA against staging with the built binary:
    • browsers create --headless --memory 2GiB returned memory: "2GiB".
    • A Playwright timeout, a thrown error and a TypeScript syntax error each printed one ERROR: block with the call log intact and exited 1. JSON output exited 1 with empty stderr. A successful call exited 0.
    • process exec -- 'exit 3' exited 1 in both output modes, and exit 0 exited 0.

@rgarcia
rgarcia requested a review from tnsardesai October 27, 2026 14:03
@rgarcia

rgarcia commented Oct 27, 2026

Copy link
Copy Markdown
Contributor Author

Picked tnsardesai to review: recent commits in cmd; nothing pending

@tnsardesai tnsardesai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rgarcia
rgarcia merged commit a414f9a into main Oct 28, 2026
8 checks passed
@rgarcia
rgarcia deleted the hypeship/cli-exec-exit-memory branch October 28, 2026 01:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants