Skip to content

fix(cli): an explicit --store never routes through a running server - #1444

Merged
ajianaz merged 3 commits into
developfrom
fix/cli-store-skips-server
Oct 13, 2026
Merged

ajianaz merged 3 commits into
developfrom
fix/cli-store-skips-server

Conversation

@ajianaz

@ajianaz ajianaz commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

What

  • Routing fix. With [server] enabled = true and uteke-serve running, an explicit --store that names a different store than the default now runs locally instead of going to the server. A --store that points at the default store still uses the server. The routing decision lives in a pure function, should_route_via_server (crates/uteke-cli/src/main.rs).
  • Store resolution. The default store resolution is factored into default_store_path, so resolve_store_path and the routing decision cannot drift apart.
  • Bench tooling. benchmarks/longmemeval/scripts/modal_fast50.py now reads UTEKE_RELEASE, like modal_fanout.py. It used to be hardcoded to v0.15.0.
  • CHANGELOG. New ### Fixed entry.

Why

  • The bug. With server routing enabled, remember, recall, search, list, stats and forget went to the server, which serves its own store. --store <other path> was silently ignored, so data was written to and read from the wrong database.
  • Benchmark exposure. The LongMemEval harness always passes --store <tmp>, so on a machine with server routing enabled its numbers came from the wrong store. Plan item B4 for decide the HTTP/MCP/CLI behaviour differences found by the typed-request work (#1343 follow-up) #1439.
  • Why --store at the default store still routes. The server holds an exclusive lock on that store's vector index. Opening it locally would wait 30 s and then fail, which is what a first version of this change did.

Testing

  • Commands. cargo test -p uteke-cli passes (120 + 3). cargo fmt --all -- --check and cargo clippy --workspace --all-targets -- -D warnings are clean.

  • routing_tests. Another store never routes. A store equal to the default routes, also with a trailing slash. No --store routes only when the server is enabled.

  • Local A/B against a real uteke-serve on a temp port, with a temp uteke.toml that enables routing:

    Binary Command Where the memory landed
    Old (develop 0a62384) --store X remember Server store; X stayed empty
    New --store X remember X; server store unchanged
    New --store <server's store>/ Server, in 1.3 s, no lock wait
  • LongMemEval fast50: not run. The dataset (longmemeval_s_cleaned.json, 277 MB) is not on this machine, and downloading it was not approved for this PR. The change is still benchmark-neutral by construction. The harness runs with server routing disabled ([server] enabled defaults to false). With routing disabled, should_route_via_server returns false before looking at --store, exactly like the old config.server.enabled && .... No recall, import or ranking code is touched.

  • Known gap, out of scope. UTEKE_HOME on its own, without --store, still routes to the server when the server is enabled. Tracked in cli: UTEKE_HOME alone still routes to a running server that serves another store #1445.

With [server] enabled = true and a server up, remember/recall/search/list/
stats/forget were sent to the server, which serves its own store, so an
explicit --store was silently ignored and data went to the wrong database
(the LongMemEval harness always passes --store). Server routing is now
decided by should_route_via_server(), which returns false whenever --store
is set; the cheap check runs before the network probe. UTEKE_HOME is
unchanged. (#1439 B4)
@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 merged commit 08f7183 into develop Oct 13, 2026
21 checks passed
@ajianaz
ajianaz deleted the fix/cli-store-skips-server branch October 13, 2026 05:35
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.

1 participant