Skip to content

fix(playwright-mcp): no real time in the files Playwright MCP names, and sync_env_clock names a browser on real time - #794

Closed
sarah-chitty-1 wants to merge 1 commit into
mainfrom
sarahchitty/fd-6278-playwright-pretend-clock
Closed

sarah-chitty-1 wants to merge 1 commit into
mainfrom
sarahchitty/fd-6278-playwright-pretend-clock

Conversation

@sarah-chitty-1

@sarah-chitty-1 sarah-chitty-1 commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

What and why

Playwright MCP 0.0.41 names a screenshot or PDF the call leaves unnamed after the real time, and tells the model. An always-on PSI run on a clock armed to 2026-11-01 was told …/playwright-mcp-output/1794091861516/page-2026-11-07T22-57-11-639Z.png, so the agent could read the real date from a tool result. This happens with every agent harness. Linear FD-6278.

What changes

  • One output folder. The image gives Playwright MCP a fixed folder for the files it names itself (--output-dir, PLAYWRIGHT_MCP_OUTPUT_DIR, default /tmp/playwright-mcp-output). No folder is named after the session's real start any more.
  • Counter filenames. The recorder, which sits in front of the MCP port, gives each browser_take_screenshot / browser_pdf_save call that names no file Playwright MCP's own filename argument: page-<n>.<ext>, where the counter skips names already in the folder. A call that names its own file keeps it.
  • The promised warning. FD-5902 said sync_env_clock warns when a clock-armed multi env's website browser is Playwright MCP, but it never did. It now warns, and records the browser as real_time_browsers in the clock configuration.

The page clock stays as FD-5706 left it: the playwright-mcp browser runs on real time, and a task that needs universe time in its browser names the browser computer (browser_envs = ["chromium"]).

Console and network output in 0.0.41 carries no timestamps. Downloads keep the site's own filename, now in the fixed folder.

Tests

  • Unit: 3 new tests (recorder filename injection, counter skipping existing names, the sync_env_clock warning). They fail before the change and pass after.
  • Docker integration (playwright_mcp_local_test.py): 5/5 pass, including a new screenshot-name test. On the old image the same call returns …/1795043420347/page-2026-11-18T23-10-20-891Z.png.

To ship

The image source changes, so ghcr.io/scaleapi/agentenv-playwright-mcp has to be rebuilt and published (CI on release), and the env re-registered where it's pinned. The warning is core-only.

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 5/5

The changes appear safe to merge; no actionable issues were found.

Summary

Removes real-time dates from Playwright MCP’s default output paths and adds a warning when its browser does not follow the environment’s clock.

  • Unnamed Playwright MCP screenshots and PDFs get counter-based filenames.
  • Clock setup now flags Playwright MCP as a real-time browser.

No actionable issues found.

Reviews (1) · Last reviewed commit: "fix(playwright-mcp): no real time in the..." · Reviewed by Greptile

…and sync_env_clock names a browser on real time

Playwright MCP 0.0.41 saves a screenshot or PDF the call leaves unnamed as
<tmpdir>/playwright-mcp-output/<epoch ms of the session>/page-<ISO time>.png and tells
the model so (an always-on PSI run on a clock armed 2026-11-01 was told
.../1794091861516/page-2026-11-07T22-57-11-639Z.png). Now:

- the image gives Playwright MCP one folder for the files it names itself
  (--output-dir, PLAYWRIGHT_MCP_OUTPUT_DIR, /tmp/playwright-mcp-output), so no folder is
  named after the session's real start;
- the recorder, which fronts the MCP port, gives each browser_take_screenshot or
  browser_pdf_save call that names no file Playwright MCP's own filename argument,
  page-<n>.<ext>, n a counter skipping names already in the folder. A call that names
  its file keeps it.

The page clock stays as FD-5706 left it: the playwright-mcp browser is on real time,
and a task that needs universe time in its browser names the browser computer
(browser_envs = ["chromium"]), whose Playwright MCP and Chromium follow the clock.
FD-5902 said sync_env_clock warns when a clock-armed multi env's website browser is
Playwright MCP; it didn't, so it now warns and records it in the clock configuration
(real_time_browsers).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sarah-chitty-1
sarah-chitty-1 requested a review from a team as a code owner November 18, 2026 23:17
@sarah-chitty-1

Copy link
Copy Markdown
Collaborator Author

Closing: PSI always-on tasks are moving to the chromium browser computer, which follows the universe clock and names screenshots by frame id (f1, f2), so this Playwright-side fix isn't needed for us.

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.

1 participant