CLI: async runtime + proper RPC fallback plumbing

- main.rs: use #[tokio::main] so CLI has a runtime available
- memory.rs: make run_with_local_store async (no more runtime creation)
- mcp_server.rs: cache socket connection in OnceLock, use block_in_place
  for async fallback when socket unavailable

Fixes "cannot start a runtime from within a runtime" panic when CLI
falls back to local store.

Co-Authored-By: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
Kent Overstreet 2026-04-13 11:23:52 -04:00
parent 7476e9d0db
commit dc1049f62d
3 changed files with 96 additions and 55 deletions

View file

@ -476,7 +476,8 @@ impl Run for AdminCmd {
}
}
fn main() {
#[tokio::main]
async fn main() {
std::panic::set_backtrace_style(std::panic::BacktraceStyle::Short);
// Handle --help ourselves for expanded subcommand display