@@ -62,7 +62,7 @@ func indentLines(s, prefix string) string {
6262// - language (string) "javascript" | "typescript" | "python" (default "javascript")
6363// - script (string, required) the user's Playwright script
6464// - output_format (string) "json" | "text" (default "text")
65- // - env (map[string]string) environment variables
65+ // - env (map[string]any) environment variables (keys and values coerced to strings by docker/run)
6666// - pull (string) image pull policy passed to docker/run
6767// - memory (string) memory limit (default "1g")
6868// - _credential (any) passed to docker/run for Docker daemon access
@@ -116,7 +116,7 @@ func (c *BrowserRunConnector) Execute(ctx context.Context, params map[string]any
116116 containerImage = playwrightNodeImage
117117 wrapperScript = buildJSWrapper (script )
118118 // Same as JS but with TypeScript type-stripping enabled.
119- containerCmd = []string {"sh" , "-c" , "npm install --no-save --silent playwright@" + playwrightVersion + " 2>/dev/null && node --experimental-strip-types" }
119+ containerCmd = []string {"sh" , "-c" , "npm install --no-save --silent playwright@" + playwrightVersion + " && node --experimental-strip-types" }
120120 case "python" :
121121 containerImage = playwrightPythonImage
122122 wrapperScript = buildPythonWrapper (script )
@@ -160,8 +160,9 @@ func (c *BrowserRunConnector) Execute(ctx context.Context, params map[string]any
160160 "stderr" : result ["stderr" ],
161161 }
162162
163- // Optionally parse stdout as JSON.
164- if outputFormat == "json" {
163+ // Optionally parse stdout as JSON — but only when the script succeeded.
164+ // On failure, return exit_code/stderr as-is for continue_on_error consumers.
165+ if outputFormat == "json" && result ["exit_code" ] == int64 (0 ) {
165166 stdout , _ := result ["stdout" ].(string )
166167 stdout = strings .TrimSpace (stdout )
167168 if stdout != "" {
0 commit comments