Repository navigation
fix(alibaba-token-plan): correct model capabilities and limits against the live gateway, add HappyHorse video - #3695
Merged
rekram1-node merged 6 commits intoJul 24, 2026
Conversation
…live gateway Probed the Token Plan gateway directly (2026-07-24); several values were wrong in both region providers: - kimi-k2.5/k2.6: drop base_model_omit=["structured_output"] — the gateway accepts response_format json_schema on both. - kimi-k2.6: remove the [limit] output=16_384 override (inherits base 262_144). A max_tokens=17,000 request truncated at exactly 17,000 (finish_reason=length) and a real run emitted 33,718 tokens (finish_reason=stop), disproving the console/price-sheet "16K". max_tokens accepts up to 262,144, rejects 262,145. - kimi-k2.5: [limit] output 32_768 -> 98_304 (its enforced max_tokens ceiling). - qwen3.8-max-preview, qwen3.7-max, qwen3.7-plus, qwen3.6-plus, glm-5: add structured_output=true (json_schema works though base/console report none; qwen3.6-plus gained json_schema since the 2026-07-17 probe, matching flash). - qwen3.7-max/plus, qwen3.6-plus/flash: add [interleaved] reasoning_content. - deepseek-v4-pro/flash: add cache_write=0. Citations are in each file's leading comment block.
happyhorse-1.1-{t2v,i2v,r2v} are Token Plan supported models served on the async
video-synthesis endpoint (POST .../api/v1/services/aigc/video-generation/
video-synthesis, X-DashScope-Async), not the OpenAI-compatible /models list.
Entitlement confirmed live 2026-07-24 on both tiers (Personal and Team keys each
accepted a t2v job: task_id + PENDING->RUNNING). Credit-billed, so cost is 0.
Contributor
Action items
|
…dels The reviewer bot correctly flagged happyhorse-1.1-i2v and -r2v: they take an image as input, so attachment should be true, not false. Consumers that gate image upload on attachment would otherwise treat them as text-only. t2v stays false (text input only).
Contributor
Author
|
Good catch, thank you. Fixed in 67cfb5d: |
Contributor
Action items
|
The Alibaba image-to-video API takes an image (anchors the first frame) plus a text prompt (drives the motion), so input is ["image", "text"], not ["image"] alone. This matches sibling r2v. Confirmed against the HappyHorse i2v API docs.
Contributor
Author
|
Confirmed and fixed in be249ab. The image-to-video API takes an image (which anchors the first frame) plus a text prompt (which drives the motion), so |
Contributor
|
No actionable findings. |
…e gateway
Re-probing the full chat catalogue on 2026-07-24 surfaced four values the
providers still got wrong. All verified by probing the live gateway directly.
- kimi-k2.7-code: drop base_model_omit = ["structured_output"]. The gateway now
honours a strict response_format json_schema (a strict-schema request returned
exactly {"name":"Alice","age":30} with finish_reason=stop, with and without the
"json" keyword), so inheriting the base model's structured_output = true is
correct. This capability was absent at the earlier probe and has since appeared.
- qwen3.7-max: add [limit] output = 131_072. The gateway accepts max_tokens up to
131,072 and rejects 131,073 - double the inherited 65,536 and double its sibling
qwen3.7-plus, so the inherited value under-reports by half.
- qwen3.7-plus: add [limit] output = 65_536. The gateway accepts max_tokens up to
65,536 and rejects 65,537; the inherited model-metadata value is 64,000.
- MiniMax-M2.5: [limit] output 24_576 -> 32_768, its enforced max_tokens ceiling
(accepts 32,768, rejects 32,769). structured_output stays absent: a json_schema
request came back wrapped in markdown fences, i.e. free-form, not enforced.
Both region providers updated identically. Sources cited in each file header.
Contributor
|
No actionable findings. |
The gateway enforces a thinking_budget ceiling of 131,072 on qwen3.6-plus and qwen3.6-flash (probed 2026-07-24: max_tokens/thinking_budget accepts 131,072 and rejects 131,073). Alibaba's docs state 81,920, but the live gateway accepts up to 131,072, so the documented figure under-reports the real limit. Both region providers updated; the leading comment records the doc-vs-gateway difference.
Contributor
|
No actionable findings. |
This was referenced Jul 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
Both Token Plan region providers (
alibaba-token-planandalibaba-token-plan-cn) carried afew capability and limit values that the live gateway contradicts, and were missing the
HappyHorse video models the plan serves. Everything here was checked by probing the gateway
directly on 2026-07-24, not read off the console or a price sheet (several of which are wrong on
these exact fields).
Corrections
base_model_omit = ["structured_output"]. The gateway acceptsresponse_formatjson_schemaon both (a strict-schema request returns the expected object).[limit] output = 16_384override so it inherits the base262_144.The 16K figure (which the console and both price sheets also carry) is wrong: a
max_tokens = 17000request truncated at exactly 17000 withfinish_reason = length, and areal run emitted 33,718 tokens with
finish_reason = stop. The gateway acceptsmax_tokensupto 262,144 and rejects 262,145, so output is bounded only by the context window.
[limit] outputfrom32_768to98_304, its enforcedmax_tokensceiling(the gateway rejects requests above 98,304, distinct from k2.6 and k2.7-code at 262,144).
structured_output = true. The gateway doesjson_schemaeven though the base models reportnone. qwen3.6-plus gained
json_schemarecently (it wasjson_objectonly when first probed on2026-07-17), so it now matches its sibling qwen3.6-flash.
[interleaved]reasoning_content, matching the GLM, Kimi and DeepSeek entries, which all stream reasoning thesame way.
cache_write = 0(they hadcache_readonly;prepaid plan, so 0).
Corrections (second pass, 2026-07-24)
Re-probing the full chat catalogue turned up four more values, added in a third commit:
base_model_omit = ["structured_output"]. It now honours a strictjson_schema(returned exactly{"name":"Alice","age":30}withfinish_reason = stop, withand without the
jsonkeyword). This capability was absent on 2026-07-17 and has since appeared.[limit] output = 131_072(acceptsmax_tokens131,072, rejects 131,073)[limit] output = 65_536(accepts 65,536, rejects 65,537); the inheritedmodel-metadata value is 64,000.
[limit] outputfrom24_576to32_768, its enforcedmax_tokensceiling(rejects 32,769).
structured_outputstays absent: ajson_schemarequest came back wrapped inmarkdown fences, i.e. free-form, not enforced.
New models: HappyHorse 1.1 video
happyhorse-1.1-{t2v,i2v,r2v}added to both region providers. These are Token Plan supportedmodels (listed on the supported-model pages) served on the async video-synthesis endpoint
(
POST .../api/v1/services/aigc/video-generation/video-synthesiswithX-DashScope-Async: enable), not the OpenAI-compatible/modelslist, which is why they never appear in a/modelslisting. I confirmed both tiers can call them: a job submitted to that endpoint returned a
task_idand ran (PENDING then RUNNING) with no entitlement error.familyis omitted becauseHappyHorse is not in the family enum yet; happy to add it to the enum in a follow-up if you would
prefer that.
Notes
bun validatepasses andgit diff --checkis clean. No sync module touches this provider, sothe hand-authored source comments persist.
HappyHorse text-to-video API reference).
models.
Three commits: the first-pass corrections, the video additions, then a second pass of
gateway-verified corrections. Happy to split into separate PRs if you would rather review them
separately.
🤖 Generated with Claude Code (Claude Opus 4.8)
🧑💻 Ideated, directed and reviewed by a human, @oliver-mee