Skip to content

test(claude-web): anchor on the alias wiring, not on how the map builds it - #11585

Merged
diegosouzapw merged 2 commits into
cheaper-inference:release/v3.8.51from
ntdat812:fix/claude-web-anchor-lazy-map
Aug 26, 2026
Merged

diegosouzapw merged 2 commits into
cheaper-inference:release/v3.8.51from
ntdat812:fix/claude-web-anchor-lazy-map

Conversation

@ntdat812

Copy link
Copy Markdown
Contributor

Summary

tests/unit/claude-web-transport.test.ts checks that the Claude Web executor carries no
execution-time dependency on the standalone Turnstile solver. Two of its assertions are
anchors — there to prove the file read resolved to the real barrel, so the negative guards
below them cannot pass against a moved or emptied file. They were pinned to the exact
construction spelling:

assert.match(indexSource, /"claude-web": new ClaudeWebExecutor\(\)/);
assert.match(indexSource, /"cw-web": new ClaudeWebExecutor\(\)/);

#11421 made the executor barrel lazy. The values are now
() => import("./claude-web.ts").then((m) => new m.ClaudeWebExecutor()), so neither anchor
matches any more. The wiring they guard did not change — only how the map constructs executors.

This is a base-red gate. The test fails on release/v3.8.51 itself, so every open PR
inherits the failure in Unit Tests fast-path (1/4) no matter what it touches.

The anchors now match the alias key and the class name and let the construction between them be
spelled either way:

assert.match(indexSource, /"claude-web":.*ClaudeWebExecutor/);
assert.match(indexSource, /"cw-web":.*ClaudeWebExecutor/);

. does not match a newline without the s flag, so each stays confined to its own entry.

Related Issues

Validation

  • Change type: other (test-only)
  • Focused tests and category gates from the golden path
  • npm run lint — clean (eslint exit 0)
  • Reconciled with the current active release base — branched from origin/release/v3.8.51
    at 6eb7bf0ba9
  • Production-code changes include a new or updated automated test in this PR — n/a, no
    production code changed
# on 6eb7bf0ba9, unmodified
$ node --test tests/unit/claude-web-transport.test.ts
# tests 9 / pass 8 / fail 1     <- not ok 2, "Claude Web executor transport orchestration"

# with this change
# tests 9 / pass 9 / fail 0

The loosened anchor still catches a real break. A looser assertion is only worth having if
it still fails when the thing it guards is actually gone, so I checked that rather than assuming
it: repointing one alias at a different executor —

-  "cw-web": () => import("./claude-web.ts").then((m) => new m.ClaudeWebExecutor()), // Alias
+  "cw-web": () => import("./default.ts").then((m) => new m.DefaultExecutor()), // Alias

— turns the test red again (pass 8 / fail 1), and restoring it turns it green. The guarantee is
unchanged; only the spelling it tolerates is wider.

Tests Added Or Updated

  • tests/unit/claude-web-transport.test.ts — two anchor assertions relaxed. No production code
    changed.

Coverage Notes

No src/, open-sse/, electron/ or bin/ change, so coverage is unmoved.

Reviewer Notes

@ntdat812
ntdat812 requested a review from diegosouzapw as a code owner August 26, 2026 02:38
…ds it

`tests/unit/claude-web-transport.test.ts` asserts that `claude-web` and
`cw-web` are wired to `ClaudeWebExecutor` in the executor barrel. It pinned
that on the exact construction spelling:

    /"claude-web": new ClaudeWebExecutor\(\)/

cheaper-inference#11421 made the barrel lazy — the values are now
`() => import("./claude-web.ts").then((m) => new m.ClaudeWebExecutor())` — so
both anchors stopped matching. The wiring they guard is unchanged; only how the
map constructs executors moved.

This is a base-red gate: the test fails on `release/v3.8.51` itself, so every
open PR inherits the failure in `Unit Tests fast-path (1/4)` regardless of what
it changes.

The anchors now match the alias key and the class name and let the construction
in between be spelled either way. Verified they still fail on a real break:
repointing `cw-web` at `DefaultExecutor` turns the test red, and restoring it
turns it green.

Refs cheaper-inference#11421
@ntdat812

Copy link
Copy Markdown
Contributor Author

CI on this PR is red, and I do not think any of it is mine. Recording the check rather than
leaving it to be re-derived.

The same six gates fail — Docs Gates (fast-path), Fast Quality Gates,
No new ESLint warnings, and three of the four Unit Tests fast-path shards — on every open
pull request against release/v3.8.51 that I can see, including #11577, #11580 and #11582,
which are not mine and touch entirely different files. The failing unit tests
(db-cleanup, db-settings-crud, cursor-renewal, kiro-multi-account-isolation,
openrouter-provider-stats, namespace-tool-identity-integration,
t31-t33-t34-t38-model-specs, authz/route-guard-version-get-exemption) have no overlap with
this diff.

Locally, at the base commit this branch is rebased onto (6eb7bf0ba9), the focused tests for
this change pass and the before/after evidence in the description reproduces.

Happy to rebase again whenever the base is green — it has moved 45 commits since I opened this,
so I would rather rebase once against a known-good tip than keep chasing it. Related: #9282.

@diegosouzapw
diegosouzapw merged commit fe12208 into cheaper-inference:release/v3.8.51 Aug 26, 2026
10 of 16 checks passed
diegosouzapw pushed a commit that referenced this pull request Aug 26, 2026
Merged via /merge-batch (lote 2026-08-26 batch 2, v3.8.51). 7 conflitos, todos triviais/duplicados (mesmos base-reds já corrigidos por PRs paralelas mergeadas neste lote — #11580/#11582/#11583/#11585/#11588/#11589/#11590/#11591/#11609): mantida a versão já validada nesses casos. Validado: 68/68 testes passando. Obrigado por resolver os base-reds.
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
…ds it (cheaper-inference#11585)

Merged via /merge-batch (lote 2026-08-26, v3.8.51). Boarded no worktree combinado junto com outras ~30 PRs; validação única: typecheck/complexity/cognitive-complexity/changelog-integrity verdes, file-size rebaseado onde necessário (crescimento legítimo), lint com os mesmos 228 achados pré-existentes confirmados via sonda contra o tip puro (não introduzidos por este lote), e ~370 testes focados (unit + vitest) passando. Obrigado pela contribuição.
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
…per-inference#11608)

Merged via /merge-batch (lote 2026-08-26 batch 2, v3.8.51). 7 conflitos, todos triviais/duplicados (mesmos base-reds já corrigidos por PRs paralelas mergeadas neste lote — cheaper-inference#11580/cheaper-inference#11582/cheaper-inference#11583/cheaper-inference#11585/cheaper-inference#11588/cheaper-inference#11589/cheaper-inference#11590/cheaper-inference#11591/cheaper-inference#11609): mantida a versão já validada nesses casos. Validado: 68/68 testes passando. Obrigado por resolver os base-reds.
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.

2 participants