Skip to content

feat(mcp): read and apply the engine settings like the CLI and the server (#1515, part 4) - #1533

Merged
ajianaz merged 1 commit into
developfrom
refactor/engine-settings-4
Oct 22, 2026
Merged

ajianaz merged 1 commit into
developfrom
refactor/engine-settings-4

Conversation

@ajianaz

@ajianaz ajianaz commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

What

Last step of #1515. uteke-mcp used to open the store with the built-in defaults and ignore uteke.toml for recall, tier, graph rerank, dream, lifecycle and the embedding fallback. It now loads EngineSettings (EngineSettings::load: global file, project file with its untrusted keys stripped, then UTEKE_RECALL_* / UTEKE_GRAPH_* / UTEKE_EMBED_FALLBACK_*) and applies it. Uteke::apply_settings also sets tier and graph rerank and keeps the sanitized [recall] settings; uteke_recall uses min_score, min_score_strict and default_strategy when a call gives none, as POST /recall does (a call's own floor or strategy wins). MCP over HTTP gets the same from the server's settings. uteke-serve now also honours UTEKE_RECALL_* and UTEKE_GRAPH_* (it ignored them), and one shared layering helper replaces the copy in the privacy loader. The server builds one engine value up front (env, sanitized strategy, fallback) and its two small resolver functions go away.

Why

The same store answered uteke_recall differently over MCP than over POST /recall or uteke recall once [recall] was changed. With no [recall] section and no variable nothing changes (the defaults equal the built-ins).

Contract: uteke-cloud#248 is answered (2026-10-22): no objection, nothing to change in cloud. Refs #1515, closes #1355 when merged.

Testing

  • clippy -D warnings, fmt, cargo test --workspace pass; cargo run -p docgen changes nothing
  • core: 8 new tests (sanitized, tier/graph/recall defaults applied, default recall settings, layers then env order); MCP: 3 tests (no section changes nothing, configured floor filters and a call floor wins, configured strategy and sanitizing)
  • side by side with the real model: the MCP binary from develop ignores [recall] min_score and UTEKE_RECALL_MIN_SCORE (3 results), this branch applies them (1 result); no configuration gives identical output. Server: toml-only configs identical to develop, only the env case changes as documented
  • reviewed locally with the Cora MCP agent reviewer before pushing: no blocking finding. One minor finding of mine: MCP now also reads the project-local file for [lifecycle] and [dream], which the CLI and the server already did; whether those belong in the untrusted keys is tracked in a separate issue

@github-actions

Copy link
Copy Markdown

🔍 Cora AI Code Review

✅ No issues found. Code looks good!


Review powered by cora-code · BYOK · MIT

@ajianaz
ajianaz force-pushed the refactor/engine-settings-4 branch from 102e22b to a035427 Compare October 22, 2026 08:44
@ajianaz
ajianaz marked this pull request as ready for review October 22, 2026 08:45
@ajianaz
ajianaz merged commit df69bab into develop Oct 22, 2026
18 of 19 checks passed
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.

refactor: unify the mirrored config schema structs (CLI Config vs server ServerFileConfig)

1 participant