mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #5965] [CLOSED] feat(providers): add Z.AI as a native text provider with GLM 5.3 and GLM 5.3 Flash #7005
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#7005
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/5965
Author: @ghost
Created: 9/8/2026
Status: ❌ Closed
Base:
staging← Head:feat/zai-text-provider📝 Commits (5)
bbd7e6afeat(providers): add Z.AI as a native text provider (#5963)5a24719fix(generate): an empty reply says what the provider reported (#5963)18efc2bfix(client): Z.AI key link label goes through the existing locale key (#5963)d372359fix(generate): the empty-reply sentence quotes the budget that was sent (#5963)e5cccf7Merge branch 'staging' into feat/zai-text-provider📊 Changes
17 files changed (+317 additions, -21 deletions)
View changed files
📝
CHANGELOG.md(+2 -0)📝
docs/connections/providers-reference.md(+7 -0)📝
packages/client/src/components/connections/ConnectionEditor.tsx(+6 -1)📝
packages/client/src/components/panels/ConnectionsPanel.tsx(+1 -0)📝
packages/server/src/db/schema/connections.ts(+1 -0)📝
packages/server/src/routes/connections.routes.ts(+28 -12)📝
packages/server/src/routes/generate.routes.ts(+19 -5)➕
packages/server/src/services/generation/empty-response-reason.ts(+75 -0)📝
packages/server/src/services/generation/generation-parameters.ts(+1 -1)📝
packages/server/src/services/llm/provider-registry.ts(+1 -0)📝
packages/server/src/services/llm/providers/openai.provider.ts(+3 -0)📝
packages/shared/src/constants/model-lists.ts(+16 -1)📝
packages/shared/src/constants/providers.ts(+11 -0)📝
packages/shared/src/schemas/connection.schema.ts(+1 -0)📝
packages/shared/src/types/connection.ts(+1 -0)📝
scripts/regressions/connection-test-parameters.regression.ts(+35 -1)📝
scripts/regressions/provider-compat.regression.ts(+109 -0)📄 Description
Linked issue
Closes #5963
Why this change
ZAI_MODELSlist stopped at 5.2.What changed
zaiadded toAPIProvider, the connection Zod enum, the DB enum,PROVIDERS(Z.AI,https://api.z.ai/api/paas/v4,/models, Bearer auth) andMODEL_LISTS(ZAI_MODELS).glm-5.3andglm-5.3-flashadded toZAI_MODELS(1M context, 128K output).zairouted toOpenAIProviderinprovider-registry.ts; added to the OpenAI-compatible provider lists inconnections.routes.tsandgeneration-parameters.ts; newOpenAIProviderKindmember and error label.resolveProviderReasoningEffortnow promotes a Maximum preset tomaxfor thezaiprovider on GLM 5.2 / 5.3. Before, it lowered Maximum tohighbeforeglm53ReasoningEffortever saw it, so Z.AI'smaxlevel was unreachable. Custom connections toapi.z.aibehave exactly as before (the resolver has no base URL, so only the named provider is promoted).API_KEY_LINKS(https://z.ai/manage-apikey/apikey-list) and an icon-color entry inConnectionsPanel. The link label reuses the existing locale keyconnections.mediaSources.zai.apiKeyLink(same text the image source already shows), so no new hard-coded UI copy.docs/connections/providers-reference.md; a line under[Unreleased]inCHANGELOG.md.scripts/regressions/provider-compat.regression.tspin the resolver promotion (and its non-promotion for Custom), the new model rows, and the native request body with and without a configured effort.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
Verified on macOS arm64: created the Z.AI connection through the picker, sent a roleplay reply through GLM 5.3 with reasoning shown, checked light and dark mode, a narrow viewport, and the bad-key error path.
pnpm checkpassed locally on macOS arm64 (Node 26.4.0, pnpm 10.34.5): stale-client clean, impeccable, localization, format, lint, e2e types, build.node ./scripts/run-regressions.mjs --filter scripts/regressions/provider-compat.regression.tspassed with the new rows in place.GET /modelson the default base URL answered200with a live pay-as-you-go key: ten models,glm-5.3andglm-5.3-flashamong them.Rebase and re-verification (2026-09-11)
staging8906861ac. Two conflicts: the CHANGELOG bullet, and the empty-responseifingenerate.routes.ts, which upstream widened with!roleplayActivity.length && !currentRoleplayMedia.length— kept the upstream condition, this PR's body.pnpm checkgreen;provider-compatandconnection-test-parametersregressions pass.api.z.aiwith a real key. Fetch Models returns the account list includingglm-5.3andglm-5.3-flash. Test Message returns text onglm-5.3(1,024 tokens),glm-5.3-flashandglm-5.2(200). Reasoning Effort on the wire: Low →low, Medium →high, Extra High →high, Maximum →max. A connection capped at 16 output tokens returns "The model used its whole output budget (16 of 16 output tokens, 15 of them reasoning) before writing any visible text…" from Test Message and from a streamed chat reply.d372359f1: the sentence quoted the pre-cap budget when the connection's Max Output Tokens override was lower than the preset ("16 of 4096" while the wire carriedmax_tokens=16).sentOutputBudget()applies the same capBaseLLMProvider.applyMaxTokensCapapplies; pinned inprovider-compat.https://api.z.ai/api/paas/v4, key link "Get your Z.AI API key", default modelglm-5.3.Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)Docs touched:
docs/connections/providers-reference.md,CHANGELOG.md. The[docs-i18n]follow-up issue will be opened once the wording here has survived review. No version bump.UI evidence (if applicable)
Screenshots of the provider picker and the connection editor will be added with the manual verification.
Summary by CodeRabbit
New Features
Bug Fixes
Documentation
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.