Skip to content

feat: add per-conversation reasoning-effort override (#641) - #958

Merged
pancacake merged 2 commits into
HKUDS:devfrom
ademicho123:feature/conversation-reasoning-effort
Aug 24, 2026
Merged

pancacake merged 2 commits into
HKUDS:devfrom
ademicho123:feature/conversation-reasoning-effort

Conversation

@ademicho123

Copy link
Copy Markdown
Contributor

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.

@pancacake
pancacake changed the base branch from main to dev August 23, 2026 11:10
`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.
@ademicho123

Copy link
Copy Markdown
Contributor Author

@pancacake I believe this is fix now.

@pancacake
pancacake merged commit e4dda9f into HKUDS:dev Aug 24, 2026
12 checks passed
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants