Repository navigation
feat: add per-conversation reasoning-effort override (#641) - #958
Merged
pancacake merged 2 commits intoAug 24, 2026
Merged
Conversation
`apply_llm_selection_to_catalog` already calls `LLMSelection.from_payload`, so resolving the override parsed the same payload a second time — meaning a malformed `reasoning_effort` was validated and raised from two places. `from_payload` is idempotent on an already-parsed value, so parse once and pass the object through. Also correct the `VALID_REASONING_EFFORTS` comment: it called itself the single source of truth while pointing at two things that are not the same vocabulary. `reasoning_params.py` maps a level onto a provider's actual knob, and the per-backend `efforts` lists say what each subagent CLI accepts (some are empty — no effort flag at all). This constant is only the request-validation union.
Contributor
Author
|
@pancacake I believe this is fix now. |
14 tasks done
pancacake
pushed a commit
that referenced
this pull request
Nov 15, 2026
#641) Carry the #958 service-layer reasoning_effort override through the whole turn contract: the core TurnRequest LLMSelection accepts the field (validated against VALID_REASONING_EFFORTS, old two-ID payloads unchanged), the generated web contracts are regenerated, and ChatStateAdapter's asLLMSelection restores a legal override instead of dropping it. The composer gains a selector beside the model picker, offering only the levels the selected model supports (live supported_reasoning_efforts or the provider/model tables) narrowed to the wire vocabulary, hidden when the model has none. The choice persists on the conversation's llm_selection, so the next send uses it without a backend restart and other conversations are unaffected; switching models resets the override. Precedence stays conversation override -> profile/model default -> provider default, and the context-budget readout reports the effective effort beside the model when one was used.
izerui
pushed a commit
to izerui/DeepTutor
that referenced
this pull request
Nov 22, 2026
HKUDS#641) Carry the HKUDS#958 service-layer reasoning_effort override through the whole turn contract: the core TurnRequest LLMSelection accepts the field (validated against VALID_REASONING_EFFORTS, old two-ID payloads unchanged), the generated web contracts are regenerated, and ChatStateAdapter's asLLMSelection restores a legal override instead of dropping it. The composer gains a selector beside the model picker, offering only the levels the selected model supports (live supported_reasoning_efforts or the provider/model tables) narrowed to the wire vocabulary, hidden when the model has none. The choice persists on the conversation's llm_selection, so the next send uses it without a backend restart and other conversations are unaffected; switching models resets the override. Precedence stays conversation override -> profile/model default -> provider default, and the context-budget readout reports the effective effort beside the model when one was used. (cherry picked from commit 3b1730d)
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.
Description: Adds an optional per-conversation reasoning_effort override to LLMSelection, the existing model-pin primitive that already flows from a turn's payload (or saved session preferences) through to the real LLM call. When set, it takes precedence over the profile/model's own default; when unset, existing resolution is unchanged. The effective value is also exposed in the turn metadata that already surfaces llm_model/llm_provider (Activity panel data). The chat-composer selector UI itself is a separate frontend change, not included here.
Related Issues: Related to #641
Module(s) Affected: services, api
Additional Notes: 9 new tests added (tests/services/model_selection/test_llm_selection.py, tests/services/config/test_provider_runtime.py); full suite run clean against a fresh dev checkout.