From 587cddee547f35402a32548588b50a3d9748a69c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 17 Mar 2026 03:01:35 +0000 Subject: [PATCH 1/2] Initial plan From 5d018a0e9aa38b7a42826142c96544f4aa56c37e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 17 Mar 2026 03:26:10 +0000 Subject: [PATCH 2/2] fix: fix Multi-Device Docs Tester workflow failures (#21326) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Root causes from run #23175727517: 1. `npm run preview` returned 404 for `/gh-aw/` (Astro Starlight hybrid routing) 2. Playwright timed out at 60s due to Vite dev server loading many ES modules 3. Max-turns (50) too low for 10-device testing after debug overhead Fixes: - shared/docs-server-lifecycle.md: switch to `npm run dev`, verify /gh-aw/ returns 200 - daily-multi-device-docs-tester.md: max-turns 50→80, tools.timeout 120s, remove build step, add domcontentloaded guidance Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- .../daily-multi-device-docs-tester.lock.yml | 17 +++++----- .../daily-multi-device-docs-tester.md | 29 ++++++++++------ .github/workflows/docs-noob-tester.lock.yml | 2 +- .../workflows/shared/docs-server-lifecycle.md | 34 +++++++++++-------- .github/workflows/unbloat-docs.lock.yml | 2 +- 5 files changed, 49 insertions(+), 35 deletions(-) diff --git a/.github/workflows/daily-multi-device-docs-tester.lock.yml b/.github/workflows/daily-multi-device-docs-tester.lock.yml index 41fb7d02fc6..4653647698f 100644 --- a/.github/workflows/daily-multi-device-docs-tester.lock.yml +++ b/.github/workflows/daily-multi-device-docs-tester.lock.yml @@ -28,7 +28,7 @@ # - shared/docs-server-lifecycle.md # - shared/reporting.md # -# gh-aw-metadata: {"schema_version":"v2","frontmatter_hash":"58b88d7a1cd049b8d277724d179af9359b34e68b8aad2d6a0f8f3133242abce0","strict":true} +# gh-aw-metadata: {"schema_version":"v2","frontmatter_hash":"f5a4802459021b8361db58fb67d33ae472aaffe53fceda01e56ad10d735f2c27","strict":true} name: "Multi-Device Docs Tester" "on": @@ -777,8 +777,8 @@ jobs: # - Bash(ls*) # - Bash(lsof*) # - Bash(npm install*) - # - Bash(npm run build*) - # - Bash(npm run preview*) + # - Bash(npm run dev*) + # - Bash(npx astro*) # - Bash(npx playwright*) # - Bash(pwd) # - Bash(pwd*) @@ -880,23 +880,24 @@ jobs: touch /tmp/gh-aw/agent-step-summary.md # shellcheck disable=SC1003 sudo -E awf --tty --env-all --container-workdir "${GITHUB_WORKSPACE}" --allow-domains "*.githubusercontent.com,*.jsr.io,anthropic.com,api.anthropic.com,api.github.com,api.npms.io,api.snapcraft.io,archive.ubuntu.com,azure.archive.ubuntu.com,bun.sh,cdn.jsdelivr.net,cdn.playwright.dev,codeload.github.com,crl.geotrust.com,crl.globalsign.com,crl.identrust.com,crl.sectigo.com,crl.thawte.com,crl.usertrust.com,crl.verisign.com,crl3.digicert.com,crl4.digicert.com,crls.ssl.com,deb.nodesource.com,deno.land,esm.sh,files.pythonhosted.org,get.pnpm.io,ghcr.io,github-cloud.githubusercontent.com,github-cloud.s3.amazonaws.com,github.com,googleapis.deno.dev,googlechromelabs.github.io,host.docker.internal,json-schema.org,json.schemastore.org,jsr.io,keyserver.ubuntu.com,lfs.github.com,nodejs.org,npm.pkg.github.com,npmjs.com,npmjs.org,objects.githubusercontent.com,ocsp.digicert.com,ocsp.geotrust.com,ocsp.globalsign.com,ocsp.identrust.com,ocsp.sectigo.com,ocsp.ssl.com,ocsp.thawte.com,ocsp.usertrust.com,ocsp.verisign.com,packagecloud.io,packages.cloud.google.com,packages.microsoft.com,playwright.download.prss.microsoft.com,ppa.launchpad.net,pypi.org,raw.githubusercontent.com,registry.bower.io,registry.npmjs.com,registry.npmjs.org,registry.yarnpkg.com,repo.yarnpkg.com,s.symcb.com,s.symcd.com,security.ubuntu.com,sentry.io,skimdb.npmjs.com,statsig.anthropic.com,storage.googleapis.com,telemetry.vercel.com,ts-crl.ws.symantec.com,ts-ocsp.ws.symantec.com,www.npmjs.com,www.npmjs.org,yarnpkg.com" --log-level info --proxy-logs-dir /tmp/gh-aw/sandbox/firewall/logs --enable-host-access --image-tag 0.24.2 --skip-pull --enable-api-proxy \ - -- /bin/bash -c 'export PATH="$(find /opt/hostedtoolcache -maxdepth 4 -type d -name bin 2>/dev/null | tr '\''\n'\'' '\'':'\'')$PATH"; [ -n "$GOROOT" ] && export PATH="$GOROOT/bin:$PATH" || true && claude --print --disable-slash-commands --no-chrome --max-turns 50 --mcp-config /tmp/gh-aw/mcp-config/mcp-servers.json --allowed-tools '\''Bash(cat),Bash(cd*),Bash(curl*),Bash(date),Bash(echo),Bash(grep),Bash(head),Bash(kill*),Bash(ls),Bash(ls*),Bash(lsof*),Bash(npm install*),Bash(npm run build*),Bash(npm run preview*),Bash(npx playwright*),Bash(pwd),Bash(pwd*),Bash(sort),Bash(tail),Bash(uniq),Bash(wc),Bash(yq),BashOutput,Edit,ExitPlanMode,Glob,Grep,KillBash,LS,MultiEdit,NotebookEdit,NotebookRead,Read,Task,TodoWrite,Write,mcp__github__download_workflow_run_artifact,mcp__github__get_code_scanning_alert,mcp__github__get_commit,mcp__github__get_dependabot_alert,mcp__github__get_discussion,mcp__github__get_discussion_comments,mcp__github__get_file_contents,mcp__github__get_job_logs,mcp__github__get_label,mcp__github__get_latest_release,mcp__github__get_me,mcp__github__get_notification_details,mcp__github__get_pull_request,mcp__github__get_pull_request_comments,mcp__github__get_pull_request_diff,mcp__github__get_pull_request_files,mcp__github__get_pull_request_review_comments,mcp__github__get_pull_request_reviews,mcp__github__get_pull_request_status,mcp__github__get_release_by_tag,mcp__github__get_secret_scanning_alert,mcp__github__get_tag,mcp__github__get_workflow_run,mcp__github__get_workflow_run_logs,mcp__github__get_workflow_run_usage,mcp__github__issue_read,mcp__github__list_branches,mcp__github__list_code_scanning_alerts,mcp__github__list_commits,mcp__github__list_dependabot_alerts,mcp__github__list_discussion_categories,mcp__github__list_discussions,mcp__github__list_issue_types,mcp__github__list_issues,mcp__github__list_label,mcp__github__list_notifications,mcp__github__list_pull_requests,mcp__github__list_releases,mcp__github__list_secret_scanning_alerts,mcp__github__list_starred_repositories,mcp__github__list_tags,mcp__github__list_workflow_jobs,mcp__github__list_workflow_run_artifacts,mcp__github__list_workflow_runs,mcp__github__list_workflows,mcp__github__pull_request_read,mcp__github__search_code,mcp__github__search_issues,mcp__github__search_orgs,mcp__github__search_pull_requests,mcp__github__search_repositories,mcp__github__search_users,mcp__playwright__browser_click,mcp__playwright__browser_close,mcp__playwright__browser_console_messages,mcp__playwright__browser_drag,mcp__playwright__browser_evaluate,mcp__playwright__browser_file_upload,mcp__playwright__browser_fill_form,mcp__playwright__browser_handle_dialog,mcp__playwright__browser_hover,mcp__playwright__browser_install,mcp__playwright__browser_navigate,mcp__playwright__browser_navigate_back,mcp__playwright__browser_network_requests,mcp__playwright__browser_press_key,mcp__playwright__browser_resize,mcp__playwright__browser_select_option,mcp__playwright__browser_snapshot,mcp__playwright__browser_tabs,mcp__playwright__browser_take_screenshot,mcp__playwright__browser_type,mcp__playwright__browser_wait_for'\'' --debug-file /tmp/gh-aw/agent-stdio.log --verbose --permission-mode bypassPermissions --output-format stream-json "$(cat /tmp/gh-aw/aw-prompts/prompt.txt)"${GH_AW_MODEL_AGENT_CLAUDE:+ --model "$GH_AW_MODEL_AGENT_CLAUDE"}' 2>&1 | tee -a /tmp/gh-aw/agent-stdio.log + -- /bin/bash -c 'export PATH="$(find /opt/hostedtoolcache -maxdepth 4 -type d -name bin 2>/dev/null | tr '\''\n'\'' '\'':'\'')$PATH"; [ -n "$GOROOT" ] && export PATH="$GOROOT/bin:$PATH" || true && claude --print --disable-slash-commands --no-chrome --max-turns 80 --mcp-config /tmp/gh-aw/mcp-config/mcp-servers.json --allowed-tools '\''Bash(cat),Bash(cd*),Bash(curl*),Bash(date),Bash(echo),Bash(grep),Bash(head),Bash(kill*),Bash(ls),Bash(ls*),Bash(lsof*),Bash(npm install*),Bash(npm run dev*),Bash(npx astro*),Bash(npx playwright*),Bash(pwd),Bash(pwd*),Bash(sort),Bash(tail),Bash(uniq),Bash(wc),Bash(yq),BashOutput,Edit,ExitPlanMode,Glob,Grep,KillBash,LS,MultiEdit,NotebookEdit,NotebookRead,Read,Task,TodoWrite,Write,mcp__github__download_workflow_run_artifact,mcp__github__get_code_scanning_alert,mcp__github__get_commit,mcp__github__get_dependabot_alert,mcp__github__get_discussion,mcp__github__get_discussion_comments,mcp__github__get_file_contents,mcp__github__get_job_logs,mcp__github__get_label,mcp__github__get_latest_release,mcp__github__get_me,mcp__github__get_notification_details,mcp__github__get_pull_request,mcp__github__get_pull_request_comments,mcp__github__get_pull_request_diff,mcp__github__get_pull_request_files,mcp__github__get_pull_request_review_comments,mcp__github__get_pull_request_reviews,mcp__github__get_pull_request_status,mcp__github__get_release_by_tag,mcp__github__get_secret_scanning_alert,mcp__github__get_tag,mcp__github__get_workflow_run,mcp__github__get_workflow_run_logs,mcp__github__get_workflow_run_usage,mcp__github__issue_read,mcp__github__list_branches,mcp__github__list_code_scanning_alerts,mcp__github__list_commits,mcp__github__list_dependabot_alerts,mcp__github__list_discussion_categories,mcp__github__list_discussions,mcp__github__list_issue_types,mcp__github__list_issues,mcp__github__list_label,mcp__github__list_notifications,mcp__github__list_pull_requests,mcp__github__list_releases,mcp__github__list_secret_scanning_alerts,mcp__github__list_starred_repositories,mcp__github__list_tags,mcp__github__list_workflow_jobs,mcp__github__list_workflow_run_artifacts,mcp__github__list_workflow_runs,mcp__github__list_workflows,mcp__github__pull_request_read,mcp__github__search_code,mcp__github__search_issues,mcp__github__search_orgs,mcp__github__search_pull_requests,mcp__github__search_repositories,mcp__github__search_users,mcp__playwright__browser_click,mcp__playwright__browser_close,mcp__playwright__browser_console_messages,mcp__playwright__browser_drag,mcp__playwright__browser_evaluate,mcp__playwright__browser_file_upload,mcp__playwright__browser_fill_form,mcp__playwright__browser_handle_dialog,mcp__playwright__browser_hover,mcp__playwright__browser_install,mcp__playwright__browser_navigate,mcp__playwright__browser_navigate_back,mcp__playwright__browser_network_requests,mcp__playwright__browser_press_key,mcp__playwright__browser_resize,mcp__playwright__browser_select_option,mcp__playwright__browser_snapshot,mcp__playwright__browser_tabs,mcp__playwright__browser_take_screenshot,mcp__playwright__browser_type,mcp__playwright__browser_wait_for'\'' --debug-file /tmp/gh-aw/agent-stdio.log --verbose --permission-mode bypassPermissions --output-format stream-json "$(cat /tmp/gh-aw/aw-prompts/prompt.txt)"${GH_AW_MODEL_AGENT_CLAUDE:+ --model "$GH_AW_MODEL_AGENT_CLAUDE"}' 2>&1 | tee -a /tmp/gh-aw/agent-stdio.log env: ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} - BASH_DEFAULT_TIMEOUT_MS: 60000 - BASH_MAX_TIMEOUT_MS: 60000 + BASH_DEFAULT_TIMEOUT_MS: 120000 + BASH_MAX_TIMEOUT_MS: 120000 DISABLE_BUG_COMMAND: 1 DISABLE_ERROR_REPORTING: 1 DISABLE_TELEMETRY: 1 GH_AW_ASSETS_ALLOWED_EXTS: ".png,.jpg,.jpeg" GH_AW_ASSETS_BRANCH: "assets/${{ github.workflow }}" GH_AW_ASSETS_MAX_SIZE_KB: 10240 - GH_AW_MAX_TURNS: 50 + GH_AW_MAX_TURNS: 80 GH_AW_MCP_CONFIG: /tmp/gh-aw/mcp-config/mcp-servers.json GH_AW_MODEL_AGENT_CLAUDE: ${{ vars.GH_AW_MODEL_AGENT_CLAUDE || '' }} GH_AW_PHASE: agent GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt GH_AW_SAFE_OUTPUTS: ${{ env.GH_AW_SAFE_OUTPUTS }} + GH_AW_TOOL_TIMEOUT: 120 GH_AW_VERSION: dev GITHUB_AW: true GITHUB_STEP_SUMMARY: /tmp/gh-aw/agent-step-summary.md @@ -906,7 +907,7 @@ jobs: GIT_COMMITTER_EMAIL: github-actions[bot]@users.noreply.github.com GIT_COMMITTER_NAME: github-actions[bot] MCP_TIMEOUT: 120000 - MCP_TOOL_TIMEOUT: 60000 + MCP_TOOL_TIMEOUT: 120000 - name: Configure Git credentials env: REPO_NAME: ${{ github.repository }} diff --git a/.github/workflows/daily-multi-device-docs-tester.md b/.github/workflows/daily-multi-device-docs-tester.md index 986e20efe5d..025711298fd 100644 --- a/.github/workflows/daily-multi-device-docs-tester.md +++ b/.github/workflows/daily-multi-device-docs-tester.md @@ -16,16 +16,17 @@ permissions: tracker-id: daily-multi-device-docs-tester engine: id: claude - max-turns: 50 # Prevent runaway token usage (10 devices × ~3 turns + build/setup/report) + max-turns: 80 # 10 devices × ~5 turns each + setup/report overhead strict: true timeout-minutes: 30 tools: + timeout: 120 # Playwright navigation on Astro dev server can take >60s; increase to 120s playwright: version: "v1.56.1" bash: - "npm install*" - - "npm run build*" - - "npm run preview*" + - "npm run dev*" + - "npx astro*" - "npx playwright*" - "curl*" - "kill*" @@ -70,20 +71,19 @@ You are a documentation testing specialist. Your task is to comprehensively test ## Your Mission -Build the documentation site locally, serve it, and perform comprehensive multi-device testing. Test layout responsiveness, accessibility, interactive elements, and visual rendering across all device types. Use a single Playwright browser instance for efficiency. +Start the documentation development server and perform comprehensive multi-device testing. Test layout responsiveness, accessibility, interactive elements, and visual rendering across all device types. Use a single Playwright browser instance for efficiency. -## Step 1: Build and Serve +## Step 1: Install Dependencies and Start Server -Navigate to the docs folder and build the site: +Navigate to the docs folder and install dependencies: ```bash cd ${{ github.workspace }}/docs npm install -npm run build ``` Follow the shared **Documentation Server Lifecycle Management** instructions: -1. Start the preview server (section "Starting the Documentation Preview Server") +1. Start the dev server (section "Starting the Documentation Preview Server") 2. Wait for server readiness (section "Waiting for Server Readiness") ## Step 2: Device Configuration @@ -100,10 +100,18 @@ Test these device types based on input `${{ inputs.devices }}`: Playwright is provided through an MCP server interface, **NOT** as an npm package. You must use the MCP Playwright tools: -- ✅ **Correct**: Use MCP tools like `mcp__playwright__browser_navigate`, `mcp__playwright__browser_run_code`, etc. +- ✅ **Correct**: Use `mcp__playwright__browser_run_code` with `page.goto(..., { waitUntil: 'domcontentloaded' })` - ❌ **Incorrect**: Do NOT try to `require('playwright')` or create standalone Node.js scripts - ❌ **Incorrect**: Do NOT install playwright via npm - it's already available through MCP +**⚠️ CRITICAL: Navigation Timeout Prevention** + +The Astro development server uses Vite, which loads many JavaScript modules per page. Using the default `waitUntil: 'load'` or `waitForLoadState('networkidle')` will cause 60s timeouts because the browser waits for all modules to finish. **Always use `waitUntil: 'domcontentloaded'`** for navigation: + +- ✅ **Correct**: `page.goto(url, { waitUntil: 'domcontentloaded', timeout: 30000 })` +- ❌ **Never use**: `page.waitForLoadState('networkidle')` — causes guaranteed timeouts +- ❌ **Never use**: `mcp__playwright__browser_navigate` for first load — it uses default 'load' wait which times out + **Example Usage:** ```bash @@ -117,10 +125,11 @@ echo "Playwright server URL: http://${SERVER_IP}:4321/gh-aw/" // Use browser_run_code to execute Playwright commands. // IMPORTANT: Replace 172.30.0.20 below with the actual SERVER_IP from the bash command above. // Do NOT use "localhost" — Playwright runs with --network host so its localhost differs. +// ALWAYS use waitUntil: 'domcontentloaded' to prevent timeout on the Vite dev server. mcp__playwright__browser_run_code({ code: `async (page) => { await page.setViewportSize({ width: 390, height: 844 }); - await page.goto('http://172.30.0.20:4321/gh-aw/'); // substitute actual SERVER_IP + await page.goto('http://172.30.0.20:4321/gh-aw/', { waitUntil: 'domcontentloaded', timeout: 30000 }); // substitute actual SERVER_IP return { url: page.url(), title: await page.title() }; }` }) diff --git a/.github/workflows/docs-noob-tester.lock.yml b/.github/workflows/docs-noob-tester.lock.yml index e6b25ce6f44..6cb5a95a1ef 100644 --- a/.github/workflows/docs-noob-tester.lock.yml +++ b/.github/workflows/docs-noob-tester.lock.yml @@ -28,7 +28,7 @@ # - shared/docs-server-lifecycle.md # - shared/reporting.md # -# gh-aw-metadata: {"schema_version":"v2","frontmatter_hash":"67d7121754cd87f039eff5782dd31356426aed9c72c09881a79957f3ab7b9580","strict":true} +# gh-aw-metadata: {"schema_version":"v2","frontmatter_hash":"a505bd34e8d11cbaec46d8455564fc4702abbaaec99657909469c8612780c6e3","strict":true} name: "Documentation Noob Tester" "on": diff --git a/.github/workflows/shared/docs-server-lifecycle.md b/.github/workflows/shared/docs-server-lifecycle.md index 9339f369680..23e9ed94333 100644 --- a/.github/workflows/shared/docs-server-lifecycle.md +++ b/.github/workflows/shared/docs-server-lifecycle.md @@ -2,49 +2,52 @@ # Documentation Server Lifecycle Management # # This shared workflow provides instructions for starting, waiting for readiness, -# and cleaning up the Astro Starlight documentation preview server. +# and cleaning up the Astro Starlight documentation dev server. # # Prerequisites: -# - Documentation must be built first (npm run build in docs/ directory) -# - Bash permissions: npm *, curl *, kill *, echo *, sleep * +# - npm install must have been run in docs/ directory +# - Bash permissions: npm *, npx *, curl *, kill *, echo *, sleep * # - Working directory should be in repository root --- ## Starting the Documentation Preview Server -**Context**: The documentation has been pre-built using `npm run build`. Use the preview server to serve the static build. - -Navigate to the docs directory and start the preview server in the background, binding to all network interfaces on a fixed port: +Navigate to the docs directory and start the development server in the background, binding to all network interfaces on a fixed port: ```bash cd docs -npm run preview -- --host 0.0.0.0 --port 4321 > /tmp/preview.log 2>&1 & +npm run dev -- --host 0.0.0.0 --port 4321 > /tmp/preview.log 2>&1 & echo $! > /tmp/server.pid ``` This will: -- Start the preview server on port 4321, bound to all interfaces (`0.0.0.0`) +- Start the Astro development server on port 4321, bound to all interfaces (`0.0.0.0`) - Redirect output to `/tmp/preview.log` - Save the process ID to `/tmp/server.pid` for later cleanup +**Why `npm run dev` instead of `npm run preview`:** +The `npm run preview` command serves the pre-built static output. However, Astro's Starlight documentation site uses hybrid routing which requires the development server (`astro dev`) to correctly serve all pages at the `/gh-aw/` base URL. Using `npm run preview` returns 404 for `/gh-aw/` paths. + **Why `--host 0.0.0.0 --port 4321` is required:** The agent runs inside a Docker container. Playwright also runs in its own container with `--network host`, meaning its `localhost` is the Docker host — not the agent container. Binding to `0.0.0.0` makes the server accessible on the agent container's bridge IP (e.g. `172.30.x.x`). The `--port 4321` flag prevents port conflicts if a previous server instance is still shutting down. ## Waiting for Server Readiness -Poll the server with curl to ensure it's ready before use: +Poll the server with curl until the `/gh-aw/` path returns HTTP 200: ```bash -for i in {1..30}; do - curl -s http://localhost:4321 > /dev/null && echo "Server ready!" && break - echo "Waiting for server... ($i/30)" && sleep 2 +for i in {1..45}; do + STATUS=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:4321/gh-aw/) + [ "$STATUS" = "200" ] && echo "Server ready at http://localhost:4321/gh-aw/!" && break + echo "Waiting for server... ($i/45) (status: $STATUS)" && sleep 3 done ``` This will: -- Attempt to connect up to 30 times (60 seconds total) -- Wait 2 seconds between attempts -- Exit successfully when server responds +- Attempt to connect up to 45 times (135 seconds total) to allow for Astro dev server startup +- Check that `/gh-aw/` specifically returns HTTP 200 (not just that the port is open) +- Wait 3 seconds between attempts +- Exit successfully when the docs site is fully accessible ## Playwright Browser Access @@ -94,3 +97,4 @@ This will: - For Playwright browser tools, use the container bridge IP (see "Playwright Browser Access" section above) - Always clean up the server when done to avoid orphan processes - If the server fails to start, check `/tmp/preview.log` for errors +- No `npm run build` step is required before starting the dev server diff --git a/.github/workflows/unbloat-docs.lock.yml b/.github/workflows/unbloat-docs.lock.yml index f4cf3b19847..d4c5f7596f8 100644 --- a/.github/workflows/unbloat-docs.lock.yml +++ b/.github/workflows/unbloat-docs.lock.yml @@ -29,7 +29,7 @@ # - shared/mcp/qmd-docs.md # - shared/reporting.md # -# gh-aw-metadata: {"schema_version":"v2","frontmatter_hash":"1ea348ceeae0c5a3a49a003b730348485ecc316c50839f51c40457b872a01fb5","strict":true} +# gh-aw-metadata: {"schema_version":"v2","frontmatter_hash":"15a992aab926d7b16a05160a5af9ad70c0da495a3adc087e7022f031176d1c79","strict":true} name: "Documentation Unbloat" "on":