ci(webviews): replay base reds on the merge parent; room for a slow file's retry
Webview test reds on #27045 (run 40781148854) came from CI, not from the change, which only touched HarnessesScreen.gallery.tsx, harnesses.css and harnesses-hover.test.ts. There were three causes, and this PR fixes all three.
1. react-apps-base-check replayed on the wrong base. It checked out github.event.pull_request.base.sha. That value lags the merge commit's first parent once feat-cmux-next moves. #27045's head shards ran on merge commit 09e00bee, whose parent is f0dc65f8. Its base job replayed on e275db3f, 12 commits older. That older commit doesn't have #27019's 999px workflow-card bars, so agent-pane-no-capsules passed there and its red was charged to #27045 (shard 4, job 123220786884). The base job now checks out the merge commit at depth 2 and detaches at HEAD^1. That is the same base the head shards' prScope diff uses, and the same fix #23534 needed in cmux-next-guards.yml.
2. The serial-retry budget was too short for the slowest file. Head shard 1 (job 123220840265) first ran agent-pane-attach-huge-files alone and got typing p95 32/46/39 ms against limits of 30/36/36. The runner's 120 s retry budget had already spent 60 s retrying code-block-highlight-height, so the huge-files retry was cut off at 60 s. The file needs about 130 s, so the first run's numbers were kept. The base replay ran the same file alone three times (two jobs on 32 vCPU, one on 16 vCPU) and it passed every time. Head shards now get CMUX_WEB_TEST_RETRY_BUDGET=300. The slowest shard (about 32 min on 16 vCPU) still fits in its 40 min.
3. composer-location-strip runs close to the default 120 s per-file limit. Alone, or on 32 vCPU, it takes 67-98 s. On a 16 vCPU shard next to 15 other files it timed out at 120 s, and timeouts are never retried. It now declares // cmux-web-test-timeout: 240. That is a per-file limit, not an excuse: a real timeout still fails.
A note on sharding: adding harnesses-hover.test.ts shifted the index-modulo shard split by one. That moved huge-files, composer-location-strip and code-block-highlight-height from shard 2 to shard 1, and agent-pane-no-capsules from shard 1 to shard 4. The base push run (40783304241) ran shard 2 on 32 vCPU, while #27045's head shards ran on 16 vCPU (the overflow fallback). The shard move only exposed fixes 2 and 3. It isn't the cause on its own, because the huge-files file already runs alone (// cmux-web-test-alone).
The attachment-size-cap work may also edit agent-pane-attach-huge-files.test.ts. This PR does not touch that file.
Tests:
tests/test_webviews_tests_new_reds.py: 2 new tests. The base job must not usepull_request.base.shaand must detach atHEAD^1before installing. Head shards must carry the 300 s retry budget.- Run on a Linux host, all passing:
test_webviews_tests_new_reds.py(22),test_webviews_tests_per_file.py(22),test_ci_blacksmith_linux_failover.py,test_check_paths.py,test_ci_change_areas.py,test_ci_linux_compile_runners.py,test_ci_workflow_run_sources.py,test_cmux_next_checks_workflow.py,test_cmux_next_web_base_push.py,test_supplychain_security.py,test_web_validation.py,test_ci_self_hosted_guard.sh.test_pr_scoped_webviews_checks.pyandtest_cmux_next_fast_gates.pyerror the same way on base, because that host has no environment for them.
Risk: CI only. On a pull request, the base replay now compares against the merge parent instead of the possibly stale base sha. That can turn a former "red on this change" into "red on the base too" only when the merge parent really has the red. The cost is a slower worst case for head shards (up to 3 more minutes of retries).
š¤ Generated with Claude Code
Agent session: agent session
![View with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-dark-v3-3x.png)
![Autofix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png)
Need help on this PR? Tag @codesmith-bot with what you need.
Summary by cubic
Fixes webview test false reds by replaying base tests on the merge parent instead of a stale base SHA, and gives head shards room to retry slow files.
- The base job now checks out the merge commit at depth 2 and detaches at
HEAD^1, the same commit the head shards' diff uses;pull_request.base.shalagged the first parent once the base moved, so the merge parent's own red was charged to the change. - Head shards get
CMUX_WEB_TEST_RETRY_BUDGET=300. The old 120 s default cut offagent-pane-attach-huge-files's retry after a shorter retry used half the budget. composer-location-strip.test.tsdeclares a 240 s per-file timeout; it hit the 120 s limit on a busy 16 vCPU shard, and timeouts are never retried.