Skip to content

fix: send max_tokens to Alibaba Model Studio instead of max_completion_tokens - #127135

Closed
ntdat812 wants to merge 5 commits into
openclaw:mainfrom
ntdat812:fix/modelstudio-max-tokens-127119
Closed

ntdat812 wants to merge 5 commits into
openclaw:mainfrom
ntdat812:fix/modelstudio-max-tokens-127119

Conversation

@ntdat812

@ntdat812 ntdat812 commented Aug 21, 2026 •

Copy link
Copy Markdown

Closes #127119

What Problem This Solves

Fixes an issue where users on any Alibaba Cloud Model Studio provider (qwen, dashscope, modelstudio) would have their output-token cap sent under a field the vendor does not document. Model Studio's OpenAI-compatibility reference lists max_tokens and does not list max_completion_tokens, but every request OpenClaw sends to that family carried max_completion_tokens.

The endpoint is not obliged to honour an undocumented field, so the configured cap can be silently ignored on the vendor side.

Why This Change Was Made

resolveOpenAICompletionsCompatDefaults builds usesMaxTokens from each vendor family it knows is not OpenAI-shaped — Chutes, Mistral, Moonshot, Cloudflare AI Gateway, Z.ai, Together — and the Model Studio family was the one omission, so it fell through to the max_completion_tokens default.

The same function already recognises this family for two other flags: isModelStudioLike gates requiresNonEmptyUserOrAssistantMessage, and isMoonshotLike (which includes it) gates supportsDeveloperRole. Adding isModelStudioLike to usesMaxTokens reuses the predicate that is already there rather than introducing a second notion of "is this Model Studio".

Scope is deliberately that one boolean. No manifest key, no model-catalog field, no new provider concept.

User Impact

Requests to qwen, dashscope and modelstudio now carry the cap as max_tokens, the field Model Studio documents. A cap configured as params.max_completion_tokens in a model entry keeps working — the value is carried onto whichever field the provider uses, so no existing configuration needs editing. Nothing changes for OpenAI or any other provider.

Evidence

Measured through buildOpenAICompletionsParams, so this is the field on the actual request body rather than the resolver's opinion. Moonshot and Together are non-OpenAI controls; OpenAI is the OpenAI-shaped control:

provider before after
qwen max_completion_tokens max_tokens
dashscope max_completion_tokens max_tokens
modelstudio max_completion_tokens max_tokens
moonshotai max_tokens max_tokens
together max_tokens max_tokens
openai max_completion_tokens max_completion_tokens

Tests. Three new cases in openai-completions-params.cache-and-compat.test.ts for the three provider ids, plus a guard asserting OpenAI still gets max_completion_tokens so the change cannot widen.

Four existing tests changed, and why. openai-completions-params.test.ts has four tests that used dashscope as an incidental fixture while asserting on the field name:

  • uses model params max_completion_tokens ... before model maxTokens
  • keeps runtime maxTokens ahead of model params max_completion_tokens ...
  • keeps zero runtime maxTokens falling back to model params ...
  • uses CJK-aware input estimates when clamping proxy-like completions output budgets

Each is about which value wins or about CJK clamping, not about the spelling — their neighbours make the same assertions with xiaomi-token-plan, chutes, stepfun-plan and vllm. The assertions keep their values and move to max_tokens. I checked the value is not lost in the switch: with params: { max_completion_tokens: 64_000 } the request now carries max_tokens: 64000, and the same holds if it is configured as max_tokens.

If any of those four was in fact a deliberate statement that Model Studio wants max_completion_tokens, then the premise of #127119 is wrong and this PR should be closed — say so and I will. Nothing in the tests' titles, bodies or history suggests it, but they are the one piece of evidence pointing the other way and I would rather flag it than quietly rewrite it.

Suite. packages/ai on Node 24.19.0:

before   7 failed | 1813 passed   (the 3 new + the 4 updated)
after    1820 passed (104 files)  0 failed

oxlint and oxfmt --check clean on all three files. tsc --noEmit on packages/ai reports 41 pre-existing errors, none in the changed files — they are in src/media/qr-runtime.ts and src/system-agent/chat-turn-router.ts and stem from a missing @types/qrcode in my local install.


Updated 2026-08-25 (f79309c1) — narrowed to Alibaba's documented /compatible-mode/v1 surface after the P1 endpoint-scope finding. The two Coding Plan endpoints (coding[-intl].dashscope.aliyuncs.com/v1) keep max_completion_tokens; nothing this PR changes now rests on inference rather than on the vendor reference. Every case in #127119's repro is on a /compatible-mode/v1 URL, so the issue is still closed in full. See the comment thread for the endpoint table and test results.

@clawsweeper

clawsweeper Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 21, 2026
@clawsweeper

clawsweeper Bot commented Aug 21, 2026 •

Copy link
Copy Markdown
Contributor

Thanks for the contribution. This PR still needs the requested real-behavior proof, and the branch has been idle since that ask.

Close as stalled awaiting real-provider proof. The dated proof request remains unmet after more than 20 days without head or check activity, and no maintainer has engaged; the useful underlying issue remains open.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #127119
Summary: This PR is an unmerged candidate for the open request-field bug; closing the stalled candidate does not resolve the issue.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

So I’m closing this for now to keep the review queue honest. Please reopen or open a fresh PR with real-behavior proof (a live run, logs, or a reproducible validation transcript) and it will be reviewed again.

Review details

Best possible solution:

Retain the open bug report and return with a compact endpoint-scoped fix that preserves explicit overrides and demonstrates actual cap enforcement.

Do we have a high-confidence way to reproduce the issue?

Yes for the request-field mismatch: current source deterministically selects the undocumented field, and before/after unit results support that path. Actual provider rejection or ignored limits remain unobserved.

Is this the best way to solve the issue?

Acceptable mitigation, but not established as the best final shape: the host/path restriction is appropriate and preserves overrides; a plugin-metadata solution would require additional contract work, while per-model overrides would not repair the default.

Security review:

Security review cleared: The diff changes request-field selection and tests without introducing credential, authorization, dependency, or supply-chain changes.

AGENTS.md: found and applied where relevant.

What I checked:

  • Introduced change and preserved settings: The pinned introduction adds Alibaba hostname/path classification and changes the detected default. Explicit model.compat.maxTokensField still takes precedence. Coding Plan and unrelated proxy endpoints do not match the new predicate. (packages/ai/src/transports/openai-completions-compat.ts:74, e8c2c3d6fcb0)
  • Production path and sibling coverage: The managed completion transport calls the parameter builder before client.chat.completions.create. The builder and direct-provider implementation both consume the shared compatibility resolver; the direct implementation selects the token field at lines 833–839. Existing parameter normalization preserves configured token values. This change depends on Alibaba’s API contract, not the Codex runtime. (packages/ai/src/transports/openai-completions-transport.ts:230, e8c2c3d6fcb0)
  • Alibaba API contract: Alibaba’s current compatibility reference documents compatible-mode endpoints and max_tokens as the output limit. This supports the requested field correction but does not establish an observed before/after provider result: Alibaba compatibility reference.
  • Still necessary on main and latest release: Inspected current main’s complete compatibility resolver and Qwen manifest: Model Studio remains absent from usesMaxTokens, with no manifest maxTokensField override. The latest release has the same omission. This is not an implemented-on-main closure. (packages/ai/src/transports/openai-completions-compat.ts, ec9c1a13db89)
  • Current-main inspection: Current-main compatibility defaults still omit Model Studio from output-field selection; explicit model compatibility remains the supported override. No merged fixing PR was established by the targeted related-item search. (packages/ai/src/transports/openai-completions-compat.ts, 1adb39eebaad)
  • Proof request and contributor response: The needs-proof label was applied on 2026-08-21. The author explicitly confirmed on August 26 that no Alibaba account or after-fix request/response was available: fix: send max_tokens to Alibaba Model Studio instead of max_completion_tokens #127135 (comment). The captured body and discussion contain builder-level evidence, not a live provider trace. (e8c2c3d6fcb0)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Codex review notes: model internal, reasoning medium; reviewed against 1adb39eebaad.

@ntdat812

Copy link
Copy Markdown
Author

Thanks — the blast-radius point is the right one to raise, and it is sharper than my PR body allowed for. Two answers: one honest limitation, one narrowing of the claim.

I cannot supply real-provider proof

I have no Alibaba Cloud Model Studio credentials, so I cannot produce a redacted live request/response. I would rather say that plainly than dress up builder output as something it is not. Everything in the PR is resolver- and request-builder level, and I labelled it as such.

If a maintainer or the reporter of #127119 can run one call against dashscope-intl.aliyuncs.com/compatible-mode/v1 with the branch applied, that closes the item. Happy to prepare an exact repro script for it.

The endpoint boundary is narrower than "the whole family", and I should have said so

The predicate covers 6 provider IDs (qwen, qwencloud, modelstudio, dashscope, qwen-token-plan, bailian-token-plan) across 6 declared base URLs. They are not one surface — per docs/providers/qwen.md:

endpoint plan path covered by the doc I cited?
dashscope.aliyuncs.com/compatible-mode/v1 Standard CN /compatible-mode/v1 ✅
dashscope-intl.aliyuncs.com/compatible-mode/v1 Standard Global /compatible-mode/v1 ✅
token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1 Token Plan CN /compatible-mode/v1 ✅
token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1 Token Plan Global /compatible-mode/v1 ✅
coding.dashscope.aliyuncs.com/v1 Coding Plan CN plain /v1 ❌
coding-intl.dashscope.aliyuncs.com/v1 Coding Plan Global plain /v1 ❌

The Model Studio OpenAI-compatibility reference documents the /compatible-mode/v1 surface. The two Coding Plan URLs do not carry that path, and I have no vendor citation for them — my PR body implied one citation covered all six, which it does not.

Two ways forward, your call

A — keep the family whole (current PR). Argues that the codebase already treats these six as one family for supportsDeveloperRole and requiresNonEmptyUserOrAssistantMessage, so splitting it only for this flag creates a second notion of "is this Model Studio". Needs the live proof to be safe.

B — narrow to the documented surface. Gate usesMaxTokens on the /compatible-mode/v1 endpoints only and leave Coding Plan on max_completion_tokens until someone with a Coding Plan key can check. Fully supported by the citation, no live proof needed for what it changes — but it knowingly leaves Coding Plan on a field the vendor does not document for the sibling surface, and it fragments the predicate.

I lean A, for one reason worth stating explicitly as reasoning rather than measurement: max_tokens is the legacy OpenAI field that OpenAI-compatible servers overwhelmingly still accept, while max_completion_tokens is the newer one many compat servers do not implement. The risk is asymmetric — the current behaviour is the riskier of the two on an undocumented surface, not the safer one. That is an argument, not evidence, and I am not asking anyone to merge on it.

Tell me which you want and I will push it. If you prefer to hold for live proof, leave it as-is and I will keep the branch current.

…n_tokens

Model Studio's OpenAI-compatibility reference documents max_tokens and does not
list max_completion_tokens, but resolveOpenAICompletionsCompatDefaults built
usesMaxTokens from every other non-OpenAI-shaped family and left this one out,
so the cap shipped under a field the vendor does not document.

The resolver already recognises the family: isModelStudioLike gates
requiresNonEmptyUserOrAssistantMessage, and isMoonshotLike (which includes it)
gates supportsDeveloperRole. usesMaxTokens is the one place it was missing.

Measured through buildOpenAICompletionsParams, with Moonshot/Together as
non-OpenAI controls and OpenAI as the OpenAI-shaped control:

  qwen         max_completion_tokens -> max_tokens
  dashscope    max_completion_tokens -> max_tokens
  modelstudio  max_completion_tokens -> max_tokens
  moonshotai   max_tokens            -> max_tokens
  together     max_tokens            -> max_tokens
  openai       max_completion_tokens -> max_completion_tokens

Four existing tests in openai-completions-params.test.ts used dashscope as an
incidental fixture while asserting on the field name. They are about which
value wins (model params vs model maxTokens vs runtime maxTokens) and about CJK
clamping, not about the spelling, so the assertions move to max_tokens and keep
their values. A configured params.max_completion_tokens is still honoured — the
value is carried onto whichever field the provider uses, verified for both
spellings.

Closes openclaw#127119
@ntdat812

Copy link
Copy Markdown
Author

Took option B. Pushed as f79309c1.

I offered A or B above and leaned A. The P1 is right and my lean was wrong, for a reason I could have checked at the time: every case in the reporter's own repro in #127119 is on a /compatible-mode/v1 URL. Coding Plan was never part of the report — I widened past it by gating on isModelStudioLike, which resolves through an endpoint class covering all six URLs.

So usesMaxTokens now requires Model Studio and a /compatible-mode/ path:

endpoint plan field after this commit
dashscope.aliyuncs.com/compatible-mode/v1 Standard CN max_tokens
dashscope-intl.aliyuncs.com/compatible-mode/v1 Standard Global max_tokens
token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1 Token Plan CN max_tokens
token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1 Token Plan Global max_tokens
coding.dashscope.aliyuncs.com/v1 Coding Plan CN unchanged — max_completion_tokens
coding-intl.dashscope.aliyuncs.com/v1 Coding Plan Global unchanged — max_completion_tokens

This still closes #127119 in full, and now everything it changes is covered by the citation. The real-behaviour blocker no longer applies to the changed surface — there is nothing left in the diff that rests on my inference rather than on Alibaba's reference. Coding Plan keeps today's behaviour, so no proof is needed for it either.

Matching the path segment rather than listing six URLs, so a new Alibaba region does not silently fall out of the documented surface.

What I did not do, deliberately. The recommendation also proposes adding a generic endpoint-level plugin metadata capability for the output-token field. I agree that is the better long-term shape — the manifest declaring one modelstudio-native class over six URLs is the root cause, and a path check in the transport is a workaround for it. But it is plugin API surface, the review itself marks it "Owner decision: Required", and it is a larger change than the bug warrants. If a maintainer wants it, I am happy to do it as a separate PR rather than smuggle an API expansion into a field-name fix.

Verification, all runnable without provider credentials:

packages/ai/src/transports/openai-completions-params.cache-and-compat.test.ts   25 passed
packages/ai/src/transports/openai-completions-params.test.ts                    13 passed

The compatible-mode case now covers all four documented endpoints; two new cases pin Coding Plan on max_completion_tokens. Reverting to the wide predicate fails exactly those two, which is what makes them worth having.

One note on the test fixture, since it shows in the diff: the token-plan URLs are driven through provider qwen because resolveTestEndpointClass in the unit support file only maps dashscope.aliyuncs.com to modelstudio-native. In production the plugin manifest lists all six URLs under that class. Either path reaches the same gate, but I would rather flag the fixture gap than have it read as a coincidence.

tsc --noEmit on packages/ai reports 41 errors on this branch, none in the two files touched here — 38 are the sessionFile/sessionId mismatch in src/agents/* test files, which this branch does not go near.

The earlier live-verification failure in the review was infrastructure, not the suite: live-proof package manager pnpm is unavailable after its official installer. The command it tried is the first file above, which passes locally.

…ible-mode surface

The first version gated on isModelStudioLike, which resolves through the
`modelstudio-native` endpoint class. That class covers six base URLs and they are
not one surface:

  https://dashscope.aliyuncs.com/compatible-mode/v1              documented
  https://dashscope-intl.aliyuncs.com/compatible-mode/v1         documented
  https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1   documented
  https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1  documented
  https://coding.dashscope.aliyuncs.com/v1                       Coding Plan, NOT documented
  https://coding-intl.dashscope.aliyuncs.com/v1                  Coding Plan, NOT documented

Alibaba's OpenAI-compatibility reference describes the `/compatible-mode/v1`
surface. It says nothing about the two Coding Plan endpoints, so the citation
behind this change does not reach them, and I have no Coding Plan key to test with.
Switching them anyway was me widening the fix past its evidence.

usesMaxTokens now requires Model Studio AND a `/compatible-mode/` path. Coding Plan
keeps max_completion_tokens until someone with a key can confirm.

This still closes openclaw#127119 in full: every case in the reporter's repro is on a
/compatible-mode/v1 URL.

Matching the path segment rather than a list of six URLs so a new Alibaba region
does not silently drop out of the documented surface.

Tests: the compatible-mode case now covers all four documented endpoints, and two
new cases pin Coding Plan on max_completion_tokens. Reverting to the wide predicate
fails both of those. The token-plan URLs are driven through provider "qwen" because
the unit fixture's endpoint-class map only knows dashscope.aliyuncs.com; in
production the plugin manifest lists all six under modelstudio-native, and either
way the path gate is what decides.

Addresses the P1 "restrict the field switch to documented endpoint classes" from
the ClawSweeper review, without adding the endpoint-level plugin metadata
capability it also suggests — that is plugin API surface and belongs to a
maintainer decision, not to this fix.
@ntdat812

Copy link
Copy Markdown
Author

CI on f79309c1 came back with two failures. One was mine, one I cannot reproduce and do not believe is.

check-lint — mine, fixed in 2c5e1edb.

$ oxfmt --check
packages/ai/src/transports/openai-completions-params.cache-and-compat.test.ts (4ms)
Format issues found in above 1 files.

The Coding Plan it.each block I added went over the line budget, so the formatter wants the description and callback on their own lines. Formatting only, no assertion changed; the file is 25/25 before and after, and oxfmt --check is clean on both files I touch.

checks-node-compact-small-48 — test/scripts/control-ui-i18n.test.ts > control-ui-i18n process runner > waits for all process groups before re-raising parent signals, failing on child did not close before timeout. A process-signal timing assertion.

I would rather give you the evidence than a verdict:

  • This PR changes two files, both under packages/ai/src/transports/. Nothing in the diff touches process spawning, signals, or the i18n scripts.
  • The lint job in the same run printed [skip] changed scope cannot affect control-UI i18n catalogs — the CI's own scope analysis reached that conclusion about this branch before the other shard ran it anyway.
  • I could not run it locally to confirm, and I am not going to imply otherwise. The file refuses to load on my machine before reaching any test: OpenClaw requires SQLite 3.51.3+ ... Node 22.21.0 embeds SQLite 3.50.4. That is my Node, not this branch.

So: strong structural argument, no local reproduction. 2c5e1edb re-runs CI, and whether that test comes back green on an unrelated formatting commit is the cheapest real evidence either way. If it fails again I will treat it as worth digging into rather than as noise.

If it is a known flake on main, pointing me at the issue would save me the dig.

check-lint failed on `oxfmt --check`: the Coding Plan it.each block I added in
f79309c exceeded the line budget, so the formatter wants the description and
callback on their own lines. Formatting only — 25/25 still pass.
…substring

A Qwen-family provider accepts an arbitrary custom baseUrl, so testing the path
alone handed max_tokens to any route serving /compatible-mode/ — including a
proxy Alibaba does not own and the compatibility reference does not describe.

The gate now reads the host as well, reusing the shapes
extensions/qwen/video-generation-provider.ts already matches, so a future
Alibaba region stays inside the documented surface while an unrelated route
does not enter it.

Three of the four new cases fail on the previous commit.
…t holds

cn-hongkong.dashscope, dashscope-us and workspace.ap-southeast-1.maas each serve
/compatible-mode/v1 and are named elsewhere in this repository, but none of them
is in MODELSTUDIO_NATIVE_BASE_URLS. Matching the host reaches all three; a fixed
URL list would leave every one on the wrong field.
@ntdat812

Copy link
Copy Markdown
Author

Pushed 791e4624 and e8c2c3d6. Between them they answer the P1 and the merge risk that follows from it. They do not answer the request for a live trace, and I say why at the end rather than dress something up as one.

P1 — the field policy no longer rests on a path substring

You were right, and the shape of it is worse than "an unrecognized proxy route". The gate was

isModelStudioLike && input.baseUrl?.includes("/compatible-mode/") === true

which decides what a route is from how its URL is spelled. A Qwen-family provider takes an arbitrary baseUrl, so anything serving that path segment qualified.

It now reads the host as well, reusing the shapes resolveDashscopeAigcApiBaseUrl in extensions/qwen/video-generation-provider.ts already matches:

/(?:^|\.)dashscope(?:-[^.]+)?\.aliyuncs\.com$/   or   *.maas.aliyuncs.com
   AND   pathname begins with /compatible-mode/

Three of the four new negative cases fail on the parent commit. That is the regression you named:

case before after
https://proxy.example/compatible-mode/v1 max_tokens max_completion_tokens
https://dashscope.aliyuncs.com.evil.example/compatible-mode/v1 max_tokens max_completion_tokens
https://notaliyuncs.com/compatible-mode/v1 max_tokens max_completion_tokens
https://dashscope.aliyuncs.com/compatible-mode-preview/v1 max_completion_tokens max_completion_tokens

The fourth passes both ways. It guards behaviour that was already correct rather than fixing anything, and I would rather label it than let it count as four.

Why the host, and not a Qwen-owned URL list

You asked me to move this to Qwen-owned route handling. I kept it in the transport, and this is the measurement that decided it — I would rather show it than argue.

I ran the new predicate over every Alibaba base URL this repository names — extensions/alibaba, extensions/qwen, scripts/lib/official-external-provider-catalog.json, src/config/zod-schema.core.ts. Eighteen URLs; the predicate agrees with "the path is /compatible-mode" on all eighteen.

Seven of those are compatible-mode surfaces. MODELSTUDIO_NATIVE_BASE_URLS holds four base URLs, of which two are compatible-mode; extensions/qwen/openclaw.plugin.json holds six, of which four are. These three are in neither list:

  • https://cn-hongkong.dashscope.aliyuncs.com/compatible-mode/v1
  • https://dashscope-us.aliyuncs.com/compatible-mode/v1
  • https://workspace.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1

A URL list leaves all three on max_completion_tokens — the exact bug this PR exists to fix, on three regions the repository already ships. Matching the host reaches them and still refuses proxy.example. e8c2c3d6 adds them as cases.

If you would still rather this live in the Qwen plugin, say so and I will move it with the host predicate intact. My argument is about the list, not about where the code sits.

Coding Plan is untouched: coding[-intl].dashscope.aliyuncs.com/v1 is Alibaba-owned but not /compatible-mode, so it keeps max_completion_tokens.

The live trace — I cannot produce it

I do not have an Alibaba Model Studio account, so I cannot attach an after-fix request/response pair. I would rather write that sentence than pass a mock off as a trace.

What I can attest to: the field on the outgoing body, measured through buildOpenAICompletionsParams rather than through the resolver's opinion; 45/45 on both affected test files; oxlint and oxfmt --check clean.

What remains unverified: that Model Studio honours max_tokens. That rests on the vendor's OpenAI-compatibility reference listing max_tokens and not listing max_completion_tokens, and on #127119's reporter — not on anything I measured.

So, whichever suits you:

  1. someone with a Model Studio key runs one capped completion against /compatible-mode/v1 and posts the redacted pair, and I will fold it into the body; or
  2. this stays open until such a key turns up.

I am not asking you to merge on documentation alone. If a live trace is the bar, this is not ready, and I will not argue that it is.

The two red checks

check-lint failed for the runner, not for the code:

[oxlint:extensions] still running after 103s
##[error]The runner has received a shutdown signal.
[oxlint] FAILED (exit 143)
##[error]The operation was canceled.

Exit 143 is SIGTERM — the runner was shut down mid-oxlint. openclaw/ci-gate failed three seconds later as a consequence of it. Everything else on this head is green: 137 passed, 26 skipped. I have no rights to re-run it; a fresh run on any later push should clear both.

@shojikumaru shojikumaru left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Real-setup verification — tested at head e8c2c3d6fcb0c47647373de33015abbe8e4124e0

Setup: isolated checkout (git fetch origin pull/127135/head), Docker node:26, pnpm install --ignore-scripts, no secrets in env, tests run with --network=none. Linux host.

After (head e8c2c3d6): node scripts/run-vitest.mjs packages/ai/src/transports/openai-completions-params.cache-and-compat.test.ts packages/ai/src/transports/openai-completions-params.test.ts → 45/45 passed (1.92s).

Before (merge-base 75c44b2b): overlaid only the PR's test file(s) onto the merge-base, same command → 12 failed | 33 passed — reproducing the base behavior the PR fixes (failing: "uses CJK-aware input estimates when clamping proxy-like completions output budgets").

Not covered: runtime behavior beyond the unit surface (unit-level proof only).

Verified by Sho (human) + Alpha (AI agent) on a real OpenClaw setup. Happy to re-run against a new head if the branch moves.

@clawsweeper

clawsweeper Bot commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper recorded closeout evidence for this proposed close.

  • Action: close remains subject to final live verification.
  • Close reason: stalled PR without requested real-behavior proof.
    Review evidence: durable ClawSweeper review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: S status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Model Studio (Qwen/DashScope) requests send max_completion_tokens, but the vendor documents max_tokens

2 participants