Skip to content

test: consolidate Z.AI GLM-5.3 registry catalog tests into a golden table - #2326

Merged
jatmn merged 1 commit into
mainfrom
test/0e4-trim-registry-catalog-tests
Oct 22, 2026
Merged

jatmn merged 1 commit into
mainfrom
test/0e4-trim-registry-catalog-tests

Conversation

@jatmn

@jatmn jatmn commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • 0-E-4 (TA-004, core registry slice): in src/integrations/runtimeMetadata.test.ts, merge the two Z.AI GLM-5.3 descriptor tests into one golden table keyed by route id (zai) that iterates both models (glm-5.3-flash, glm-5.3).
  • Why: the two tests echoed the same descriptor, brand and catalog constants in parallel. This is the D6 trim, done per route without a mass delete.
  • The table still asserts the full runtime capabilities, contextWindow and maxOutputTokens from src/integrations/models/glm.ts. It now also checks resolveModelRuntimeLimits for both models against literal golden values, which the old tests didn't.
  • The other seven 0-E-4 files (registry, routeMetadata, runtimeMetadata.modelLimits, discoveryService, discoveryCache, compatibility, index) are unchanged. Their catalog literals feed routing, auth, parsing, precedence, cache or registry-validation tests, so trimming them would remove behavior coverage. Registry validation is untouched.

Impact

  • user-facing impact: none (test-only).
  • developer/maintainer impact: scoped tests go from 281 to 280 (2 tests become 1). No routing, auth, parsing, error or exclusion test is removed or changed. No exact-set or count snapshot is added.

Loosened assertions (all from the old Flash test)

  1. glmBrand.modelIds[0] === 'glm-5.3-flash' is now a membership check, so the index no longer matters.
  2. glmBrand.modelIds[1] === 'glm-5.3' is now a membership check.
  3. catalog.models[0] matching Flash is now a find-by-id check with the same fields.
  4. catalog.models[1].id === 'glm-5.3' is now find-by-id with the full entry assertions.
  5. "Exactly one Flash catalog entry" is now a presence check. Duplicate ids are still caught by registry is valid after loading all descriptors (index.test.ts), which uses the registry's duplicate-id validation.

Testing

  • I ran the required local preflight.
  • exact commands and results:
    • bun install --frozen-lockfile: ok
    • bun run check: pass
    • bun run typecheck: pass. bun run typecheck:type-tests: pass
    • node bin/openclaude --version and NODE_DISABLE_COMPILE_CACHE=1 node bin/openclaude --version: 0.33.0 (OpenClaude)
    • bun run security:pr-scan -- --base FETCH_HEAD --head HEAD: no suspicious additions
    • git diff --check: clean
  • focused tests: bun test --isolate src/integrations/{registry,routeMetadata,runtimeMetadata,runtimeMetadata.modelLimits,discoveryService,discoveryCache,compatibility,index}.test.ts: 280 pass, 0 fail. bun run integrations:check: artifacts up to date.
  • documented skipped checks, platform limitations, or verified pre-existing failures: website checks don't apply (test-only).

Notes

Summary by CodeRabbit

  • Tests
    • Expanded coverage for Z.AI’s glm-5.3-flash and glm-5.3 models, verifying their catalog details, reasoning and transport settings, and runtime limits of 1,000,000 context tokens and 131,072 output tokens with the Z.AI Coding Plan endpoint.
    • Added checks that the vendor default remains glm-5.2.

@coderabbitai

coderabbitai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: Twigpine/openclaude/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Essentials
  • Run ID: 4d60d3dd-33af-4a97-96ce-272c31427c92
📥 Commits

Reviewing files that changed from the base of the PR and between 19bb39c and f696f10.

📒 Files selected for processing: 1
  • src/integrations/runtimeMetadata.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

📜 Recent review details
⏰ Context from checks skipped due to timeout: 18
  • GitHub Check: unit-tests (7)
  • GitHub Check: unit-tests (2)
  • GitHub Check: unit-tests (6)
  • GitHub Check: unit-tests (4)
  • GitHub Check: unit-tests (8)
  • GitHub Check: unit-tests (3)
  • GitHub Check: unit-tests (1)
  • GitHub Check: unit-tests (5)
  • GitHub Check: launcher-node-floor
  • GitHub Check: smoke-and-tests
  • GitHub Check: launcher-compatibility (24.11.x)
  • GitHub Check: typecheck
  • GitHub Check: dedicated-tests
  • GitHub Check: launcher-compatibility (22)
  • GitHub Check: pr-intent-scan
  • GitHub Check: CodeQL (javascript-typescript)
  • GitHub Check: CodeQL (actions)
  • GitHub Check: Analyze (javascript-typescript)
🧰 Additional context used
📓 Path-based instructions: 3
Review provider routing, model selection, env precedence, auth/token handling, OpenAI-compatible shims, retries, proxy behavior, and outbound HTTP behavior with high scrutiny.

⚙️ CodeRabbit configuration file

Files:

  • src/integrations/runtimeMetadata.test.ts
Review tests for meaningful coverage of the changed behavior, isolation of global/env/config state, async cleanup, fake timers, provider profile leaks, and Windows-compatible assumptions.

⚙️ CodeRabbit configuration file

Files:

  • src/integrations/runtimeMetadata.test.ts
Apply the OpenClaude maintainer review rubric from AGENTS.md.

⚙️ CodeRabbit configuration file

Files:

  • src/integrations/runtimeMetadata.test.ts
🔇 Additional comments: 1
src/integrations/runtimeMetadata.test.ts: 1

29-76: LGTM!

Also applies to: 78-82, 84-88, 90-106, 108-118, 120-120

📝 Walkthrough

The separate GLM-5.3 descriptor tests are replaced by shared assertions for glm-5.3-flash and glm-5.3. The tests check descriptor and catalog metadata, the glm-5.2 default, and Coding Plan runtime limits.

Changes: Z.AI GLM-5.3 contract tests

Layer / File(s) Summary
Shared model contract assertions
src/integrations/runtimeMetadata.test.ts
A data-driven test checks both model descriptors, brand membership, static catalog metadata, reasoning and transport settings, and Coding Plan limits of 1,000,000 context tokens and 131,072 output tokens.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Possibly related issues

  • Issue 2303 reports unknown GLM-5.3 context and output limits. These tests cover the static zai descriptor, not the custom dynamic endpoint described by the issue.

Suggested reviewers: chioarub

Merge Risk: ⚪ Minimal · up to f696f

The test consolidation leaves the identified catalog safeguards covered elsewhere. No actionable merge-blocking risk remains after normal checks.

Pre-merge checks: Passed 7
Check name Status Explanation
Description check Passed The description follows the required template. It explains the change and rationale, documents impact, lists testing commands and results, identifies skipped checks, and records the tested provider/mo…
Title check Passed The title is concise, scoped, and accurately describes the consolidation of the Z.AI GLM-5.3 registry catalog tests shown in the diff.
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Risk Surface Disclosed Passed PASS. The PR changes only src/integrations/runtimeMetadata.test.ts; no production auth, routing, permissions, network, startup, plugin, CI, or release code changes. The PR description identifies the…
No Hidden Policy Change Passed PASS. The pull request changes only src/integrations/runtimeMetadata.test.ts. The diff consolidates Z.AI descriptor assertions and adds runtime-limit assertions. It does not change product behavior,…
Full details: Description check

Explanation

The description follows the required template. It explains the change and rationale, documents impact, lists testing commands and results, identifies skipped checks, and records the tested provider/model path. No critical section is missing.

Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1 files.

Full details: Risk Surface Disclosed

Explanation

PASS. The PR changes only src/integrations/runtimeMetadata.test.ts; no production auth, routing, permissions, network, startup, plugin, CI, or release code changes. The PR description identifies the Z.AI provider/model path as test-only and states that user-facing impact is none, so no blocker is introduced.

Full details: No Hidden Policy Change

Explanation

PASS. The pull request changes only src/integrations/runtimeMetadata.test.ts. The diff consolidates Z.AI descriptor assertions and adds runtime-limit assertions. It does not change product behavior, trust-model logic, routing defaults, telemetry or network behavior, or permission policy. No maintainer alignment is required for a hidden policy change.

✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@jatmn jatmn left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

— jatmn's PR Review agent

Reviewed f696f1028ea80fc271b7657dbf2a2335a9aab7ad against merge-base 78445348676d6c5797fc11d89eaaf0157d69de1b (live-base-three-dot). The diff is a single file: src/integrations/runtimeMetadata.test.ts (+89/−84). No scope creep.

Merge readiness

CI at head (f696f1028ea80fc271b7657dbf2a2335a9aab7ad): All required GitHub checks completed successfully, including typecheck, smoke-and-tests, all eight unit-tests shards, dedicated-tests, launcher compatibility, and pr-intent-scan. Commit status: CodeRabbit — Review completed (success). CodeQL aggregate: No new alerts in code changed by this pull request; CodeQL (javascript-typescript) and CodeQL (actions) succeeded. Open code-scanning alerts on the PR ref: 0.

Branch freshness: Head is 2 commits behind current main (19bb39c8845a6920bb04ad8d70652ad520861b87). Mergeable with no conflict signal; rebase before merge is optional hygiene for the upgrade-plan stack, not a blocker for this test-only change.

Automated review audit (CodeRabbit / CodeQL): No unaddressed actionable bot findings. CodeRabbit ASSERTIVE run on this head reported no actionable inline comments (LGTM on the golden table). No open PR review threads (PRRT). The embedded cr-comment:v1:9e839c57958d0740d47a9b4f note is praise-only — not a restore request (drift: N/A, no PRRT id).

Golden table vs models/*.ts / vendor sources

On the pinned checkout, every golden row matches production literals exactly:

  • glm-5.3-flash descriptor — matches src/integrations/models/glm.ts (label, classification including vision, capabilities.supportsVision: true, contextWindow 1_000_000, maxOutputTokens 131_072, runtimeMetadataScope: 'catalog', vendorId/brandId/defaultModel).
  • glm-5.3 descriptor — matches glmModel('glm-5.3', …) in the same file (classification without vision, supportsVision: false, same windows/scope).
  • Catalog rows — catalogLabel values GLM-5.3-Flash / GLM-5.3 match src/integrations/vendors/zai.ts label fields; apiName, modelDescriptorId, reasoning levels (low/high/xhigh, zai_compatible), and transportOverrides.openaiShim.enableToolStreaming match.
  • Route metadata — defaultModel: 'glm-5.2' and catalogSource: 'static' match zai.ts.

Five loosened assertions (judgment)

# Old assertion New assertion Verdict
1 glmBrand.modelIds[0] === 'glm-5.3-flash' toContain('glm-5.3-flash') Brittle → OK to drop. No runtime code indexes brand.modelIds; registry cares about membership and duplicate model ids, not brand list order.
2 glmBrand.modelIds[1] === 'glm-5.3' toContain('glm-5.3') Brittle → OK to drop. Same as (1). brands/glm.ts still lists both ids in the intended order on head; only the index pin moved.
3 catalog.models[0] full Flash object find(id === 'glm-5.3-flash') + same field asserts Brittle → OK to drop index pin. Runtime resolution uses id lookup (resolveOpenAIShimRuntimeContext, catalog find). Field-level contract unchanged.
4 catalog.models[1].id === 'glm-5.3' find-by-id + full entry toMatchObject Brittle → OK to drop index pin. Same as (3).
5 flashEntries.length === 1 (exactly one Flash catalog row) presence via find only Brittle → OK to drop. validateIntegrationRegistry() in registry.ts emits Duplicate catalog entry id for duplicate ids within a route; index.test.ts runs full registry validation; registry.test.ts has an explicit duplicate-catalog regression. PR claim verified — duplicates are still caught without this local count.

Not required to restore any of the five for merge. The only user-visible surface that still depends on catalog order is the static model picker (model.tsx iterates catalog.models), but there is no stated product contract that GLM 5.3 variants must occupy indices 0–1 in the zai list (default remains glm-5.2 at a later index). Kimi routes retain stricter order tests elsewhere in runtimeMetadata.test.ts; zai does not.

resolveModelRuntimeLimits coverage

Still holds and is slightly stronger in the golden loop. The consolidated test calls resolveModelRuntimeLimits for both models with zaiVendor.defaultBaseUrl and asserts contextWindow / maxOutputTokens against golden literals. The file already had dedicated it.each blocks for Flash and GLM-5.3 limits (query-string variants, endpoint leakage guards, shim context). No regression — additive wiring in the golden table is consistent with those tests.

Leaving the other seven 0-E-4 files unchanged

Sound. Those suites (registry, routeMetadata, runtimeMetadata.modelLimits, discoveryService, discoveryCache, compatibility, index) embed literals tied to routing, precedence, parsing, cache keys, and cross-route behavior. This PR’s stated slice is D6 trim for the Z.AI GLM-5.3 descriptor/catalog contract only; mass-editing golden tables there would expand scope beyond the upgrade-plan task without improving coverage of the changed hunk.

Findings

🟢 Thanks for the contribution. I do not see any actionable issues from my review.

@jatmn
jatmn marked this pull request as ready for review October 22, 2026 04:10
@jatmn jatmn self-assigned this Oct 22, 2026
@jatmn
jatmn merged commit a8b9fa9 into main Oct 22, 2026
22 checks passed
@jatmn
jatmn deleted the test/0e4-trim-registry-catalog-tests branch October 22, 2026 04:25
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