Skip to content

Use stronger GLM Flash reasoning defaults - #1245

Merged
ross0x01 merged 1 commit into
mainfrom
codex/glm-flash-default-agent-reasoning
Sep 3, 2026
Merged

Use stronger GLM Flash reasoning defaults#1245
ross0x01 merged 1 commit into
mainfrom
codex/glm-flash-default-agent-reasoning

Conversation

@ross0x01

@ross0x01 ross0x01 commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • let every Agent request routed to GLM 5.3 Flash inherit the provider default reasoning, including free, paid Standard, Standard vision, and Pro vision routes
  • raise Ask GLM 5.3 Flash vision from low to high reasoning
  • keep context compaction pinned to low reasoning
  • bypass scoped reasoning overrides for Agent GLM Flash so the all-user policy is uniform

Why

OpenRouter currently reports max as the GLM 5.3 Flash default. Agent benefits from the model default for long-horizon tool use, while Ask vision uses high as a balance between image-analysis quality and response latency. Context compaction remains a bounded summarization task and does not need stronger reasoning.

This is intentionally an all-user behavior change with no feature flag or experiment split.

Validation

  • full pre-commit Jest suite: 438 suites, 4,546 tests
  • focused provider-routing suite: 124 tests
  • adjacent compaction and Agent multi-step suites: 84 tests
  • TypeScript typecheck
  • ESLint and Prettier
  • git diff check

Manual verification

  1. In Agent Standard, submit a text request and inspect provider request diagnostics. The request should omit the reasoning configuration and GLM Flash should use its provider default.
  2. In Agent Standard and Pro, submit an image request. Both GLM Flash vision requests should omit the reasoning configuration.
  3. In Ask Standard, submit an image request. The request should send reasoning enabled with high effort.
  4. Trigger context compaction and confirm its dedicated request still sends low reasoning.

No visual UI files changed; automated validation is sufficient for rendering.

Summary by CodeRabbit

  • Bug Fixes
    • Updated AI model routing so GLM Flash agent requests use provider-default reasoning behavior.
    • Adjusted reasoning levels for GLM Flash vision and Ask modes.
    • Removed certain free and agent models from high-reasoning routes to improve model selection consistency.

@vercel

vercel Bot commented Sep 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
hackerai Ready Ready Preview Sep 3, 2026 3:27am UTC

Request Review

@coderabbitai

coderabbitai Bot commented Sep 3, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: 8a87b1bf-7901-4b17-ad9b-631e5499a140

📥 Commits

Reviewing files that changed from the base of the PR and between b442ee5 and 9b56a1d.

📒 Files selected for processing (2)
  • lib/api/__tests__/chat-stream-helpers-fallback.test.ts
  • lib/api/chat-stream-helpers.ts

Included review availability: 1 review is currently available. Your included PR review attempts over the past 7 days set your current allowance at 4 reviews per hour.


📝 Walkthrough

Walkthrough

The change updates GLM Flash reasoning routes. Agent routes use provider-default reasoning and ignore overrides. Standard GLM Flash vision routes use high reasoning. Fallback tests cover free and paid Agent routes.

Changes

GLM Flash reasoning routing

Layer / File(s) Summary
Reasoning route classification and provider options
lib/api/chat-stream-helpers.ts
Agent models are removed from the high-reasoning list. Agent GLM Flash routes omit the reasoning option. Standard GLM Flash vision routes use high effort.
Fallback and override test coverage
lib/api/__tests__/chat-stream-helpers-fallback.test.ts
Tests cover Ask mode, provider-default reasoning, preserved fallback chains, and ignored reasoning overrides for free and paid Agent routes.

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

Merge Risk: ⚪ Minimal · up to 9b56a

Agent GLM Flash requests now use the provider default regardless of scoped overrides, while Ask vision requests use high reasoning. The updated route coverage matches these behaviors, with no current merge-blocking risk identified.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: updated GLM Flash reasoning defaults across Agent and Ask routes.
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.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/glm-flash-default-agent-reasoning

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

@ross0x01
ross0x01 merged commit 6ba4b49 into main Sep 3, 2026
10 checks passed
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