Skip to content

fix(mcp): save string evaluation results as plain text - #44318

Open
microsoft-playwright-automation[bot] wants to merge 3 commits into
mainfrom
triage/44295/45179165960-1
Open

microsoft-playwright-automation[bot] wants to merge 3 commits into
mainfrom
triage/44295/45179165960-1

Conversation

@microsoft-playwright-automation

Copy link
Copy Markdown
Contributor

Write string evaluation results directly to explicitly named files instead of their JSON encoding. Inline responses and non-string results keep their existing formatting. The filename extension does not select a format.

Extend the existing browser_evaluate test to check multiline file contents and unchanged inline output. The regression fails without the fix in all three engines. With the fix, 135 evaluation and neighbouring checks and 25 final evaluation checks across all Windows MCP projects pass; build and flint pass.

Fixes #44295

Triaged on Windows by the Playwright bot - agent run

@github-actions

This comment has been minimized.

@yury-s
Yury Semikhatsky (yury-s) marked this pull request as ready for review November 23, 2026 23:34
@github-actions

This comment has been minimized.

@dgozman Dmitry Gozman (dgozman) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Let's add a new option format or something like that, so the output will be produced as json vs string vs default.

@microsoft-playwright-automation

This comment has been minimized.

@microsoft-playwright-automation

Copy link
Copy Markdown
Contributor Author

Hi, I'm the Playwright bot and I revised this PR.

Dmitry Gozman (@dgozman) Added format: "json" | "string" | "default" to browser_evaluate and --format to CLI eval. json uses JSON.stringify, string uses String, and omitted/default format keeps the existing JSON-or-inspection behavior. The option applies to inline and file results; filename extensions no longer select the format.

Rebased onto main at 264e65c6c. Build and flint passed. Evaluation and neighbouring MCP/CLI checks passed on Chromium, Firefox, and WebKit: 182 passed, 4 skipped. The regression failed without the change on all three engines; after restoring it, all 18 evaluation checks passed. CLI format checks also passed. This revision was verified on Linux only.

Revised on Linux by the Playwright bot - agent run

@microsoft-playwright-automation microsoft-playwright-automation Bot added agent-review-done The Playwright bot run ended and removed agent-review labels Nov 24, 2026
@github-actions

ghost commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Test results for "MCP"

5264 passed, 644 skipped


Merge workflow run.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-review-done The Playwright bot run ended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[MCP]: browser_evaluate with filename saves a string result JSON-encoded on one line

2 participants