Conversation
Revised input/output pricing, reasoning, and tools support for ZAI models to reflect updated specifications. Models impacted include glm-4.5, glm-4.5-air, glm-4.5-x, glm-4.5-airx, glm-4.5-flash, and glm-4-32b-0414-128k.
WalkthroughAdds a comment in an e2e test regarding empty text handling. Updates Z AI model registry: introduces glm-4.5v and revises pricing and capability flags (reasoning/tools/vision/streaming/context) for multiple glm-4.5* providers in zai.ts. No exported API shape changes beyond the new model entry. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Client
participant Gateway
participant ZAI as Z AI Provider
Client->>Gateway: Request with model=glm-4.5v | glm-4.5* …
alt Model supports tools/reasoning/vision
Note over Gateway: Set flags per model (tools/reasoning/vision/streaming)
Gateway->>ZAI: Forward request with capabilities + pricing metadata
ZAI-->>Gateway: Response (streaming if enabled)
else Model without reasoning
Gateway->>ZAI: Forward request (tools as applicable)
ZAI-->>Gateway: Response
end
Gateway-->>Client: Deliver response
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
apps/gateway/src/api.e2e.ts (1)
1274-1276: Avoid empty text parts in multi-part content to reduce flakiness.Some providers reject empty text items in content arrays. If the goal isn't to test this edge case, prefer a single space or drop the segment.
Apply this minimal tweak if you see intermittent 4xx:
- text: "", // empty text – note this may need special handling + text: " ", // intentionally blank but non-empty to avoid provider validation failurespackages/models/src/models/zai.ts (1)
130-142: Zero-priced glm-4.5-flash — decide whether it should be treated as “free”.Test filtering uses the model-level
freeflag, not prices. If you intend Flash to be excluded in non-full runs as a free model, mark it accordingly.Optional change:
{ id: "glm-4.5-flash", name: "GLM-4.5 Flash", family: "glm", deprecatedAt: undefined, deactivatedAt: undefined, + free: true, providers: [
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
apps/gateway/src/api.e2e.ts(1 hunks)packages/models/src/models/zai.ts(6 hunks)
🧰 Additional context used
📓 Path-based instructions (7)
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Use localStorage instead of cookies for client-side data persistence
Files:
apps/gateway/src/api.e2e.tspackages/models/src/models/zai.ts
**/*.{js,ts}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
**/*.{js,ts}: Use drizzle with the latest object syntax for database operations
For read queries, always usedb().query.<table>.findMany()ordb().query.<table>.findFirst()
Files:
apps/gateway/src/api.e2e.tspackages/models/src/models/zai.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/general.mdc)
Never use
as anyor: anyin TypeScript files.
Files:
apps/gateway/src/api.e2e.tspackages/models/src/models/zai.ts
apps/{api,gateway}/**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
.findMany() or db().query.
apps/{api,gateway}/**/*.{ts,tsx}: Use Drizzle with the latest object syntax for database operations
For read queries, use db().query..findFirst()
apps/{api,gateway}/**/*.{ts,tsx}: Use the Hono framework for backend HTTP services in apps/api and apps/gateway
Use Zod for request/response validation in backend routes and handlers
Maintain OpenAPI/Swagger documentation for backend APIsFiles:
apps/gateway/src/api.e2e.tsapps/gateway/**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
In apps/gateway (Hono), always use Hono + Zod + OpenAPI for validation and typesafety
Files:
apps/gateway/src/api.e2e.ts**/*.e2e.ts
📄 CodeRabbit inference engine (CLAUDE.md)
Name end-to-end tests with the .e2e.ts suffix (run by pnpm test:e2e)
Files:
apps/gateway/src/api.e2e.ts**/*.{spec,e2e}.ts
📄 CodeRabbit inference engine (CLAUDE.md)
Use Vitest as the test framework for unit and E2E tests
Files:
apps/gateway/src/api.e2e.ts⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: e2e / run
- GitHub Check: build / run
🔇 Additional comments (3)
packages/models/src/models/zai.ts (3)
14-23: glm-4.5 pricing/capabilities updated — verify reasoning output semantics.Numbers/flags look consistent. If glm-4.5 does not emit explicit reasoning output, set
reasoningOutput: "omit"like 4.5v to keep e2e assertions aligned.
28-50: New glm-4.5v (vision + reasoningOutput: "omit") — LGTM.Configuration matches tests that gate reasoning output on
reasoningOutput !== "omit"and include vision inputs.
61-70: Pricing/tools updates across glm-4.5-air/x/airx and glm-4-32b — looks good.Flags (
tools: true,reasoningon the right variants) align with test filters; no type issues withsatisfies.Also applies to: 84-93, 107-116, 153-162
Revised input/output pricing, reasoning, and tools support for ZAI models to reflect updated specifications. Models impacted include glm-4.5, glm-4.5-air, glm-4.5-x, glm-4.5-airx, glm-4.5-flash, and glm-4-32b-0414-128k.
Summary by CodeRabbit