Skip to content

feat(e2e): route browser tools by role via playwright-test - #45

Merged
wxhou merged 1 commit into
mainfrom
feat/e2e-mcp-tool-routing
Oct 17, 2026
Merged

wxhou merged 1 commit into
mainfrom
feat/e2e-mcp-tool-routing

Conversation

@wxhou

@wxhou wxhou commented Oct 16, 2026

Copy link
Copy Markdown
Owner

What & Why

Sessions often carry two overlapping browser toolsets (our installed playwright-test test-runner MCP + a user-added chrome-devtools-mcp), while the template said only "Browser exploration is tool-agnostic" — leaving tool choice to surface similarity. Two follow-on effects: unstable tool selection, and the fresh-context asymmetry (chrome-devtools rides the user's persistent profile; the test-runner browser is the paused test's fixture context, fresh each launch) being misread as a configuration bug.

Changes

  • templates/e2e-command.md — "tool-agnostic" → role-routing table: generate/execute/repair pinned to playwright-test MCP (sole home of test_*/planner_*/generator_*); exploration prefers it with a chrome-devtools fallback gated on absent / failing-or-hanging (switch, don't retry into the same failure) / CDP-level abilities; ≥5 routes → openspec-pw explore --parallel N; negative-first state prohibition (never switch to gain or reuse state)
  • Step 4 → Session state semantics: fresh context is E2E isolation by design; login via the auth.setup → playwright.config storageState chain; storage-class browser tools are listed by the server but rejected by its paused-test session (measured on playwright 1.63.0: 89 tools, storage capability filtered out, cross-launch localStorage not persisted) — prevents reaching for them off the tool list
  • Healer 2-6 execution fallback trigger widened: MCP not configured or its test tools fail → npx playwright test --grep (same engine, not a tool switch)
  • doctor — new optional storage-state check: config declares storageState but auth state file missing → ⚠ + npx playwright test --project=setup (never blocks; literal-path extraction first, auth.setup.ts layout guard, else silent)
  • README (EN/zh-CN) doctor tables + CHANGELOG synced in the same commit

OpenSpec change: e2e-mcp-tool-routing (specs delta under test-runner-mcp; measured evidence in design D3)

Gates

  • lint / typecheck / build clean
  • 756/756 tests pass (doctor suite: 4 new storage-state cases)
  • No version bump

@wxhou
wxhou force-pushed the feat/e2e-mcp-tool-routing branch from 5ab7253 to a155701 Compare October 16, 2026 06:13
test_* / planner_* / generator_* live only on the playwright-test MCP; exploration
prefers it, chrome-devtools only for absent/broken tools or CDP-level abilities;
login state rides the storageState chain. doctor gains an optional storage-state
check (declared but missing → ⚠ + setup command); README/CHANGELOG same commit.

Tests: 757/757 pass. Lint/typecheck/build clean. No version bump.
@wxhou
wxhou force-pushed the feat/e2e-mcp-tool-routing branch from a155701 to 3d17a7c Compare October 16, 2026 06:13
@wxhou
wxhou merged commit 29618a7 into main Oct 17, 2026
4 checks passed
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