Add ThinkingConfig effort<->budget cross-axis derivation (v0.6.10)#32
Open
Esity wants to merge 1 commit into
Open
Add ThinkingConfig effort<->budget cross-axis derivation (v0.6.10)#32Esity wants to merge 1 commit into
Esity wants to merge 1 commit into
Conversation
A client dialect supplies only ONE thinking axis: Anthropic sends budget_tokens, OpenAI sends effort. A provider translator may need the OTHER axis than the one the client gave. Add #resolved_budget and #resolved_effort so any translator can ask for whichever axis it needs and always get a usable value, keeping thinking alive across every client x provider pair instead of silently dropping it. Both directions are driven by a single EFFORT_BUDGET map (SSOT / one oracle) rather than duplicating band constants: effort -> budget is exact (low=1024, medium=8192, high=16384); budget -> effort maps by band boundary. Explicitly-set values always win over derivation; both accessors return nil when neither axis is set. to_h stays faithful to what was actually set and never fabricates the missing axis. Foundation for wiring the provider translators so thinking is not dropped on cross-provider routes (e.g. Claude budget -> OpenAI effort).
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
Adds two derived accessors to
Canonical::ThinkingConfigso provider translators can always get the thinking axis they need, regardless of which axis the client supplied.#resolved_budget— returns the explicitbudgetif set, otherwise derives a token budget fromeffort(for providers like Anthropic that needbudget_tokens).#resolved_effort— returns the expliciteffortif set, otherwise derives an effort level frombudget(for providers like OpenAI that needeffort).Why (SSOT / one oracle)
Each client dialect supplies only ONE thinking axis: Anthropic sends
budget_tokens, OpenAI sendseffort. But a provider translator on the other side of a route may need the OTHER axis. Without a bridge, thinking gets silently dropped on cross-provider routes (e.g. a Claudebudgetrequest routed to an OpenAI backend that only understandseffort).Rather than scatter band constants across provider gems, both directions are driven by a single
EFFORT_BUDGETmap — one oracle for the conversion:low= 1024,medium= 8192,high= 16384.< 8192->low,< 16384->medium, elsehigh.Guarantees
nilwhen neither axis is configured.to_hstays faithful to what was actually set — it never fabricates the missing axis. Derivation is opt-in viaresolved_*.Scope
This is the foundation only. A follow-up will wire the provider translators (openai / anthropic / bedrock) to call
resolved_*so thinking is no longer dropped on cross-provider routes.🤖 Generated with Claude Code