Skip to content

[fix]: preserve GLM-5.3-Flash max reasoning effort - #6879

Open
runbgp wants to merge 1 commit into
maximhq:devfrom
runbgp:fix/glm53-flash-max-effort
Open

runbgp wants to merge 1 commit into
maximhq:devfrom
runbgp:fix/glm53-flash-max-effort

Conversation

@runbgp

@runbgp runbgp commented Sep 4, 2026

Copy link
Copy Markdown

Summary

Bifrost changes reasoning_effort: "max" to "high" when routing vllm/zai-org/GLM-5.3-Flash through the OpenAI chat-completions integration. The model explicitly supports low, high, and max, with omitted effort defaulting to max (official model card). As a result, explicitly requesting the model's default produces a different outgoing request than omitting it.

This adds GLM-5.3-Flash to the shared converter's max-effort fallback. It preserves explicit max, including namespaced HF IDs, without changing low, high, or omitted effort.

Changes

  • Recognize glm-5.3-flash in acceptsMaxEffort.
  • Add inbound OpenAI → Bifrost vLLM → outgoing OpenAI round-trip tests for bare/namespaced IDs, four effort settings, and both streaming request shapes.
  • Add three provider-harness cases that assert the actual outgoing raw_request.reasoning_effort, including streaming. These do not infer correctness from generated text or token counts.
  • Update the core changelog.

Type of change

  • Bug fix

Affected areas

  • Core (Go)
  • Providers/Integrations

How to test

Verified red before green: the four Go round-trip max subcases failed with actual high; the two HTTP max cases failed with the same mismatch. After the patch, all 16 round-trip subcases pass and the HTTP harness passes all 33 assertions.

make test-core PROVIDER=openai PATTERN=GLM53Flash
cd core
go test ./providers/openai ./providers/vllm ./providers/groq ./providers/cerebras ./providers/ollama ./providers/perplexity ./providers/openrouter ./providers/parasail ./providers/nebius ./providers/xai ./providers/sgl -run 'Test(To|Convert|Normalize|Filter|GLM53|OpenAIChatRequest|OpenAIResponsesRequest|Effort|Accepts)' -count=1

The latter command passes applicable converter tests and compiles the listed shared-converter consumers; some packages have no matching unit tests. The full paid-provider suite was not run.

The collection was structurally validated with augment-provider-harness.mjs and filter-collection.mjs --feature GLM-5.3-Flash. Its three new cases were also run through real Bifrost HTTP servers against a synthetic OpenAI backend: unmodified v2.0.0 versus v2.0.0 with the same narrow core v1.8.3 backport. The isolated gateway enabled client.allow_per_request_raw_override; production does not need that setting.

The backported image built successfully, including UI typechecking. Bounded live vLLM checks confirmed explicit max and omitted effort now agree, while low/high remain available. Streaming tool IDs, typed arguments, reasoning content, finish reasons, and SSE termination survived a two-tool conversation.

Breaking changes

  • No

Related issues

Related to #6162, closed into the broader #6054 provider addition. This is a narrow fix for the already-shipped vLLM path on current dev, limited to the officially released Flash model and with explicit HF namespace and HTTP regressions. It makes no assumptions about future GLM versions or coercion of unsupported effort levels.

Security considerations

No configuration or credential changes. Raw-request inspection is confined to the isolated test gateway with synthetic credentials.

Checklist

  • Read AGENTS.md and the current contribution guides (raising-a-pr.mdx, code-conventions.mdx; the template's README path no longer exists)
  • Added regression tests and updated the changelog
  • Verified relevant Go tests and the backported application build
  • Full CI / paid-provider suite (not run locally)

Affected packages: core/providers/openai and tests/e2e/api provider harness.
@coderabbitai

coderabbitai Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: 6cbb53f2-21bd-4e44-b42c-685454391229

📥 Commits

Reviewing files that changed from the base of the PR and between 03ab391 and 871d8e3.

📒 Files selected for processing (5)
  • core/changelog.md
  • core/providers/openai/glmeffort_test.go
  • core/providers/openai/responses_marshal_test.go
  • core/providers/openai/utils.go
  • tests/e2e/api/collections/provider-harness.json

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Summary

Summary by CodeRabbit

  • Bug Fixes

    • GLM-5.3-Flash now preserves the requested reasoning effort, including “max,” on OpenAI-compatible routes.
    • Reasoning-effort settings remain intact across streaming and non-streaming requests, including namespaced model IDs.
  • Tests

    • Added coverage for reasoning-effort round trips and request-field preservation.
    • Added end-to-end provider checks for GLM-5.3-Flash through vLLM.

Walkthrough

Adds GLM-5.3-Flash support for preserving reasoning_effort: "max" on OpenAI-compatible routes. Unit and provider-harness tests cover model variants, streaming modes, and effort values.

Changes

GLM-5.3-Flash reasoning effort

Layer / File(s) Summary
Model support and conversion tests
core/providers/openai/utils.go, core/providers/openai/responses_marshal_test.go, core/providers/openai/glmeffort_test.go
acceptsMaxEffort recognizes GLM-5.3-Flash. Tests cover normalized model names and OpenAI-to-Bifrost-to-OpenAI request conversion.
Provider harness validation
tests/e2e/api/collections/provider-harness.json, core/changelog.md
The vLLM harness validates max and low effort for streaming and non-streaming requests. The changelog records the fix.

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

Merge Risk: ⚪ Minimal · up to 871d8

This update preserves max reasoning effort for GLM-5.3-Flash OpenAI-compatible requests, including namespaced and streaming forms, without identified current-head merge-blocking risk.

Suggested reviewers: akshaydeo, tejasghatte

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 3 files. (2 skipped: 2… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main bug fix: preserving GLM-5.3-Flash max reasoning effort.
Description check ✅ Passed The description is complete and directly matches the changes. It covers the problem, implementation, tests, affected areas, breaking changes, related issues, security, and the unrun full CI suite.
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.
Full details: Docstring Coverage

Explanation

Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 3 files. (2 skipped: 2 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

Some tools did not complete. Review the errors below.

🔧 Checkov (3.3.11)
tests/e2e/api/collections/provider-harness.json

Checkov skipped this file: it is too large to scan (8908594 bytes)

🔧 ast-grep (0.45.2)
tests/e2e/api/collections/provider-harness.json

ast-grep skipped this file: it is too large to scan (8908594 bytes)


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

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