You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Many commands print the page URL whenever the page changed. For very long URLs, this can eat a considerable of the total agent context for little gain. E.g. an option to disable this would be appreciated.
For our application, we put many loading parameters into the URL, which can include e.g. a list of many dozens of files to load, or an 800char access token. This is very useful to e.g. give an agent a repro case just with a single URL.
One example I saw today (take this with a grain of salt, I don't know much about LLMs, maybe they have some deduplication magic)
One session with a 143k token context in the end
20 calls to playwright-cli (one open, then eval and run-code), of which 12 printed the URL
If you decide to keep this, maybe it can be tuned to happen less often. E.g. it seemed like the first eval after a reload would also print the URL again, even if the eval didn't change anything substantial.
Ran into the same class of problem -- verbose output eating agent context. After testing, most of the noise is already configurable via .playwright/cli.config.json:
This kills the codegen blocks, moves snapshots to file links, and suppresses non-error console events. With this config, screenshot returns a single result line and click/goto return just ### Page + a snapshot file link.
The one thing that isn't configurable is what this issue describes: the ### Page section (URL + title) is always emitted on navigation, with no way to suppress or truncate long URLs. For apps that encode tokens/parameters in the URL, this is the remaining gap.
Would a pageUrl config option (e.g. "truncate" / "omit") be in scope, or would you prefer a more general approach?
I think playwright-cli can detect if it is executed in an interactive shell.
If itself is running in an interactive shell, then it means it is called by users, so it can print more information.
Otherwise, it is triggered by an agent, so it can show only necessary information.
The issue as reported is not fixed, we did include large configurations (and also access tokens in some cases) as URL parameters in regular URLs, not data: urls.
The issue as reported is not fixed, we did include large configurations (and also access tokens in some cases) as URL parameters in regular URLs, not data: urls.
That is correct, but that is the extent we are willing to address this issue to.
Activity
SeanLF commentedon Mar 19, 2026
Ran into the same class of problem -- verbose output eating agent context. After testing, most of the noise is already configurable via
.playwright/cli.config.json:{ "codegen": "none", "outputMode": "file", "console": { "level": "error" } }This kills the codegen blocks, moves snapshots to file links, and suppresses non-error console events. With this config,
screenshotreturns a single result line andclick/gotoreturn just### Page+ a snapshot file link.The one thing that isn't configurable is what this issue describes: the
### Pagesection (URL + title) is always emitted on navigation, with no way to suppress or truncate long URLs. For apps that encode tokens/parameters in the URL, this is the remaining gap.Would a
pageUrlconfig option (e.g."truncate"/"omit") be in scope, or would you prefer a more general approach?SeanLF commentedon Mar 19, 2026
Addendum: for anyone wanting these defaults globally without a per-project config file,
PLAYWRIGHT_MCP_CONFIGenv var works:Tested on v0.1.1. Per-project
.playwright/cli.config.jsontakes precedence when present.fondoger commentedon Mar 20, 2026
I think playwright-cli can detect if it is executed in an interactive shell.
If itself is running in an interactive shell, then it means it is called by users, so it can print more information.
Otherwise, it is triggered by an agent, so it can show only necessary information.
linkej-autodesk commentedon Jun 29, 2026
The issue as reported is not fixed, we did include large configurations (and also access tokens in some cases) as URL parameters in regular URLs, not data: urls.
pavelfeldman commentedon Jun 29, 2026
That is correct, but that is the extent we are willing to address this issue to.