Repository navigation
fix(providers): validate Z.ai web auth semantics - #10329
diegosouzapw merged 1 commit into
Conversation
7a706cb to
2367022
Compare
|
Thanks for this — the root cause is spot on: I checked this out locally and ran your new suite plus the existing regression suites you listed:
The implementation follows the existing specialty-validator pattern (same shape as One small, non-blocking note for later: This looks merge-ready to me. Thanks for the thorough root-cause writeup and the live semantic verification notes — makes review a lot faster. |
2367022 to
0069393
Compare
0b347ea
into
cheaper-inference:release/v3.8.50
|
Validated in local merge-train |
Summary
Fix Z.ai web connection testing so it validates the Local Storage session token against Z.ai's authenticated user-settings endpoint instead of relying on the generic
/api/modelsweb-session probe.The dedicated validator preserves literal upstream status codes so callers can distinguish an exact authentication rejection from rate limits, server errors, and other upstream failures.
Root cause
zai-webpreviously fell through to the generic web-cookie validator.That path probes
/api/models, which is primarily a model-catalog endpoint rather than a dedicated authenticated-session endpoint. It also uses the genericAUTH_007handling instead of returning the precise upstream status needed by connection-test failure classification.Z.ai's current OmniRoute credential contract stores only the Local Storage
token, so the validator needs to test the same token-only authentication shape used by the provider.Fix
Added a dedicated
validateZaiWebProvider()that:extractZaiToken()GET /api/v1/users/user/settingsAuthorization: Bearer <token>The specialty validator is registered ahead of the generic web-session fallback.
Live semantic verification
A read-only control was performed before implementation:
This confirmed that
/api/v1/users/user/settingsprovides a reliable token-only authentication signal for the credential format OmniRoute actually stores.Validation
Focused new regression:
tests/unit/zai-web-auth-semantics.test.ts— 4/4 passedExisting web-validation regressions:
provider-validation-web-cookie-auth007.test.tsweb-cookie-validation-proxy-7058.test.tsExisting Z.ai executor suite:
executor-zai-web.test.tsAdditional gates:
npm run typecheck:core— passedgit diff --check— passedNo live OmniRoute stack was modified during implementation.