Skip to content

feat: enable patrol develop on web and harden MCP session#3040

Open
piotruela wants to merge 17 commits into
masterfrom
feat/patrol-web-develop-and-mcp
Open

feat: enable patrol develop on web and harden MCP session#3040
piotruela wants to merge 17 commits into
masterfrom
feat/patrol-web-develop-and-mcp

Conversation

@piotruela
Copy link
Copy Markdown
Collaborator

Summary

Web develop mode

  • Implements patrol develop for web targets — previously blocked. Cold-starts the app on each restart since the web runner can't hot-restart like mobile (web_test_backend.dart, develop.ts, develop_service.dart).
  • Forwards PATROL_LOG entries from the web runner to MCP so test status is observable in develop mode.
  • Adds a timeout to npm/playwright install so a stalled install fails fast instead of hanging the backend.

MCP improvements

  • Adds web screenshot support via Chrome DevTools Protocol, with a 10s WebSocket timeout so a non-responsive browser can't hang the tool (screenshot_service.dart).
  • Surfaces test failure details (error messages, stack traces) in MCP status output instead of just a pass/fail flag (patrol_session.dart).
  • Extracts platform-specific session logic (mobile vs. web exit semantics, stale-callback suppression) into a PlatformSessionBehavior abstraction (platform_session_behavior.dart).
  • Hardens the hot-restart flag with an epoch counter so overlapping restarts can't prematurely lift suppression for each other.

E2E app / tooling

@github-actions github-actions Bot added package: patrol Related to the patrol package (native automation, test bundling) package: patrol_cli Related to the patrol_cli package labels Apr 27, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces web support for the Patrol MCP server and enhances the develop command for web platforms. Key changes include implementing platform-specific session behaviors, adding web screenshot capabilities via the Chrome DevTools Protocol, and improving log surfacing and error handling for web tests. Additionally, the PR includes new web integration tests and updates to the patrol_cli to manage web-specific processes and debugger ports. Feedback includes a critical fix for invalid Dart syntax in patrol_session.dart, a recommendation to remove local absolute paths from configuration files, and suggestions to improve the robustness of WebSocket connections and hot restart suppression logic.

Comment thread packages/patrol_mcp/lib/src/patrol_session.dart
Comment thread .mcp.json Outdated
Comment thread dev/e2e_app/.cursor/mcp.json Outdated
Comment thread packages/patrol_mcp/lib/src/patrol_session.dart
Comment thread packages/patrol_mcp/lib/src/screenshot_service.dart Outdated
@piotruela piotruela force-pushed the feat/patrol-web-develop-and-mcp branch from 6102110 to d3c8398 Compare April 27, 2026 06:51
@piotruela piotruela force-pushed the feat/patrol-web-develop-and-mcp branch from 9e4b472 to cb7bdce Compare April 27, 2026 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: patrol_cli Related to the patrol_cli package package: patrol Related to the patrol package (native automation, test bundling)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant