odysseus/routes
Mark Cockram 0e2c08300e
feat(settings): opt-in reasoning effort for utility model calls (#6572)
* feat(settings): opt-in reasoning effort for utility model calls

Add utility_reasoning_effort (empty = provider default) and let utility
calls inherit a chat session's effort only on that session's matching
endpoint+model route. Explicit caller effort wins; otherwise the utility
setting wins over session inheritance on utility-chain routes. Resolve
the chain and setting per user and validate levels against model evidence.
No-session work uses the setting only, with no chat-effort crossover.

- src/utility_effort.py owns effort_for_call and candidate_effort_factory
- remove global effort fill from llm_call/llm_call_async; utility call
  sites pass effort explicitly, so unrelated calls on the same route do
  not pick it up
- wire auto-title, memory/persona/skill extraction, memory suggest/import/
  audit, compaction, auto-sort, and per-owner background task candidates
- wire no-session email writing-style, summary, and translation calls,
  plus skills evaluation, necessity/retrieval audits, and improvement
- deliberately exclude email replies because thinking_mode='off'
- add the optional candidate_request_factory to llm_call_async_with_fallback
- add sync llm_call reasoning_effort and include it in the cache key
- show the Utility Model effort selector only for advertised levels

Fixes #6569

* fix(utility): exclude email replies and support inherited effort in settings

Pass reasoning_effort='' to task_llm_call_async for scheduled reply drafting to honor the email reply exclusion. In AI settings, resolve the effective Default Chat endpoint and model when Utility is set to 'Same as chat' so supported reasoning effort levels can be selected.

* feat(utility): support same-as-chat effort and session model fallback in compaction

In AI settings, show 'Same as chat' as the default effort option when Utility Model is inherited, and support an explicit 'Provider default' (off) override. Pass the active session fallback in context compaction callers so compaction shares the live chat session's model and reasoning effort for maximum prompt/KV cache affinity.

* fix(settings): clarify chat effort inheritance and keep option visible

Label inherited effort as 'Same as chat (when supported)' and mention
cache affinity and latency speedups in the help text. Ensure the effort
control remains visible when the utility model is set to 'Same as chat'
even if the default chat model lacks advertised reasoning levels, and
populate candidate levels across configured endpoints so the user can
configure effort or keep provider default.

* feat(settings): per-fallback reasoning effort for utility model

Each utility fallback row gets an Effort select, shown only when the
selected model advertises reasoning levels. The choice is stored as
reasoning_effort on the utility_model_fallbacks entry and sent only to
that candidate; an empty value means provider default.

* fix(utility): transmit reasoning effort in non-streaming calls

---------

Co-authored-by: Alexandre Teixeira <111787685+alteixeira20@users.noreply.github.com>
2026-10-13 21:02:16 +01:00
..
admin_wipe refactor(routes): move admin_wipe domain into routes/admin_wipe/ subpackage (#5659) 2026-07-21 12:39:27 +02:00
cleanup refactor(routes): move cleanup domain into routes/cleanup/ subpackage (#5658) 2026-07-21 12:38:32 +02:00
compare refactor(routes): move compare domain into routes/compare/ subpackage (#5660) 2026-07-21 12:40:09 +02:00
contacts Squash Odysseus development history 2026-09-11 06:04:19 +00:00
document fix(runtime): enforce workspace confinement in one place 2026-10-01 19:45:59 +02:00
email feat(settings): opt-in reasoning effort for utility model calls (#6572) 2026-10-13 21:02:16 +01:00
gallery fix(runtime): enforce workspace confinement in one place 2026-10-01 19:45:59 +02:00
history feat(settings): opt-in reasoning effort for utility model calls (#6572) 2026-10-13 21:02:16 +01:00
mcp fix(mcp): reject malformed Args on Add MCP Server instead of silently defaulting to [] (#6215) 2026-09-11 15:36:41 +02:00
memory feat(settings): opt-in reasoning effort for utility model calls (#6572) 2026-10-13 21:02:16 +01:00
note Squash Odysseus development history 2026-09-11 06:04:19 +00:00
research Squash Odysseus development history 2026-09-11 06:04:19 +00:00
search fix(security): harden Python service boundaries 2026-10-06 03:16:54 +01:00
task fix(security): harden Python service boundaries 2026-10-06 03:16:54 +01:00
vault feat(runtime): bind remote and owned resources to authority 2026-10-02 03:00:46 +01:00
webhook refactor(routes): move webhook domain into routes/webhook/ subpackage (#5781) 2026-08-03 20:44:31 +02:00
__init__.py Odysseus v1.0 2026-05-31 23:58:26 +09:00
_validators.py fix(hwfit): validate remote SSH detection targets (#3718) 2026-06-11 00:43:49 +02:00
admin_wipe_routes.py refactor(routes): move admin_wipe domain into routes/admin_wipe/ subpackage (#5659) 2026-07-21 12:39:27 +02:00
api_token_routes.py fix(api): normalize non-object JSON bodies to empty dict in token PATCH (#3976) 2026-06-15 18:05:15 +01:00
assistant_routes.py fix(security): enforce registered endpoint authority 2026-10-05 22:24:15 +01:00
auth_routes.py Preserve preview harness, editor, email and task improvements 2026-10-01 01:34:26 +00:00
backup_routes.py fix(memory): don't let an unreadable store get overwritten with an empty one (#5831) 2026-08-06 02:33:50 -06:00
calendar_routes.py fix(security): harden Python service boundaries 2026-10-06 03:16:54 +01:00
chat_helpers.py feat(settings): opt-in reasoning effort for utility model calls (#6572) 2026-10-13 21:02:16 +01:00
chat_routes.py feat(notes): attach selected Notes/Todos as Agent context (#6495) 2026-10-13 18:57:19 +01:00
chatgpt_subscription_routes.py feat(provider): support multiple ChatGPT subscriptions with usage 2026-09-22 13:12:19 +01:00
cleanup_routes.py refactor(routes): move cleanup domain into routes/cleanup/ subpackage (#5658) 2026-07-21 12:38:32 +02:00
codex_routes.py fix(runtime): enforce local control across Cookbook wrappers 2026-10-02 23:39:13 +01:00
compare_routes.py refactor(routes): move compare domain into routes/compare/ subpackage (#5660) 2026-07-21 12:40:09 +02:00
contacts_routes.py Merge remote-tracking branch 'origin/dev' 2026-07-07 00:51:34 +00:00
cookbook_helpers.py Squash Odysseus development history 2026-09-11 06:04:19 +00:00
cookbook_output.py fix(cookbook): report dead finished downloads as completed instead of stopped (#4025) 2026-06-15 15:26:55 +09:00
cookbook_routes.py fix(runtime): enforce local control across Cookbook wrappers 2026-10-02 23:39:13 +01:00
copilot_routes.py feat: add ChatGPT Subscription provider (#2876) 2026-06-08 10:19:18 +02:00
device_flow.py feat: add ChatGPT Subscription provider (#2876) 2026-06-08 10:19:18 +02:00
diagnostics_routes.py feat(ui): add real-time diagnostic logs console (#974) 2026-06-15 10:32:51 +02:00
document_helpers.py refactor(routes): move document domain into routes/document/ subpackage (#5885) 2026-08-04 03:54:55 -06:00
document_routes.py refactor(routes): move document domain into routes/document/ subpackage (#5885) 2026-08-04 03:54:55 -06:00
editor_draft_routes.py fix(review): harden scholarly redirects, editor draft limits, and threat model 2026-09-23 12:53:06 +01:00
email_helpers.py Preserve preview harness, editor, email and task improvements 2026-10-01 01:34:26 +00:00
email_pollers.py refactor(routes): move the email modules into routes/email/ 2026-09-29 18:21:18 +02:00
email_routes.py Preserve preview harness, editor, email and task improvements 2026-10-01 01:34:26 +00:00
embedding_routes.py feat(paths): abstract runtime path logic for frozen distribution packages (#969) 2026-06-15 17:44:10 +01:00
emoji_routes.py refactor(constants): single source of truth for data dir (#3368) 2026-06-08 09:58:52 +02:00
font_routes.py Keep compact font family names together (#1263) 2026-06-03 14:24:30 +09:00
gallery_helpers.py Merge dev into main for testing 2026-06-28 14:07:23 +00:00
gallery_routes.py Merge dev into main for testing 2026-06-28 14:07:23 +00:00
history_routes.py refactor(routes): move history domain into routes/history/ subpackage (#5090) 2026-07-04 13:36:35 +02:00
hwfit_routes.py fix(security): harden Python service boundaries 2026-10-06 03:16:54 +01:00
mcp_routes.py refactor(routes): move mcp domain into routes/mcp/ subpackage (#5899) 2026-08-11 02:24:55 -06:00
memory_routes.py refactor(routes): move memory domain into routes/memory/ subpackage (#5007) 2026-06-30 17:52:14 +02:00
model_routes.py Preserve preview harness, editor, email and task improvements 2026-10-01 01:34:26 +00:00
note_routes.py refactor(routes): move note domain into routes/note/ subpackage (#5236) 2026-07-20 13:52:30 +02:00
personal_routes.py fix(runtime): enforce workspace confinement in one place 2026-10-01 19:45:59 +02:00
prefs_routes.py refactor(model-routing): centralize explicit foreground fallback policy (#6020) 2026-08-14 08:10:30 +01:00
preset_routes.py Squash Odysseus development history 2026-09-11 06:04:19 +00:00
research_routes.py refactor(routes): move research domain into routes/research/ subpackage 2026-06-28 14:34:11 +01:00
search_routes.py refactor(routes): move search domain into routes/search/ subpackage (#5779) 2026-07-28 22:26:29 +02:00
session_routes.py feat(settings): opt-in reasoning effort for utility model calls (#6572) 2026-10-13 21:02:16 +01:00
shell_routes.py fix(runtime): restore authorized local control paths 2026-10-02 23:15:51 +01:00
signature_routes.py Constrain signature uploads to PNG data (#2844) 2026-06-05 13:17:43 +02:00
skills_routes.py feat(settings): opt-in reasoning effort for utility model calls (#6572) 2026-10-13 21:02:16 +01:00
stt_routes.py refactor(uploads): centralize upload byte-limits in upload_limits.py (#3364) (#3518) 2026-06-09 01:24:30 +02:00
task_routes.py refactor(routes): move task domain into routes/task/ subpackage 2026-08-17 10:07:17 +08:00
tts_routes.py Odysseus v1.0 2026-05-31 23:58:26 +09:00
upload_routes.py fix(runtime): enforce workspace confinement in one place 2026-10-01 19:45:59 +02:00
vault_routes.py refactor(routes): move vault domain into routes/vault/ subpackage (#5780) 2026-08-03 20:44:00 +02:00
webhook_routes.py refactor(routes): move webhook domain into routes/webhook/ subpackage (#5781) 2026-08-03 20:44:31 +02:00
workspace_routes.py Squash Odysseus development history 2026-09-11 06:04:19 +00:00