Conversation
…ontract
The gateway reads completion caps, thinking control and tool selection
from the request body's "parameters" object. The bridge wrote
reasoning_effort and tool_choice at the top level, where the gateway
never looks, so every thinking tier silently fell back to the model
default and "none" could never disable reasoning.
Reverse-engineering the official qodercli client confirmed the contract:
it builds a parameters map first, always attaches it, and disables
thinking by setting is_reasoning=false together with an explicit
max_thinking_tokens=0.
- add chatParameters carrying max_tokens, max_thinking_tokens,
reasoning_effort and tool_choice
- route reasoning_effort and tool_choice into parameters
- on the "none" tier, send max_thinking_tokens=0 and flip both
is_reasoning copies to false (pointer field so 0 survives omitempty)
- resolve is_reasoning and the max_tokens fallback from the model
catalog instead of hardcoding them; a caller-supplied max_tokens wins
over the catalog cap, matching the official precedence so models with
a small advertised cap are not silently truncated
- log the resolved is_reasoning and max_tokens alongside the tier, so a
dropped value is visible without another probe
Verified against the live gateway: "none" now emits zero
reasoning_content frames and no completion_tokens_details key, while the
spread of reasoning_tokens across the six tiers widens from 13 (a flat
noise band, proving the value was discarded) to 181.
The admin panel showed lifetime cumulative credits, which stops meaning
anything once the monthly allowance refreshes. Query the gateway's
/algo/api/v3/user/status for the authoritative nextResetAt boundary and
track credits per cycle instead.
- auth: add FetchUserStatus/ParseAccountStatus for the subscription state
- stats: track CycleCredits/CycleStartMs/NextResetMs with idempotent
rollover on both the write and read paths; count credits only for
billable usage frames
- bridge: cache /user/status for 1h and resolve the real userType before
building the signed session (jobToken omits it, so team accounts were
defaulting to personal_standard)
- main: refresh account state out of band every 10m, keeping the panel's
15s poll free of upstream calls
- admin: render cycle credits with reset date and countdown; no progress
bar, since team plans report quota=0
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.
如题, 具体参见readme.
