Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

Commits on main

Give json_rpc_e2e one memory workspace, as production has\n\nThis target gave every case its own `HOME`, while the module host captures a\nworkspace once per process: `set_modules_policy` ignores later calls, and the\nloaded artifact takes its `workspace_dir` at load time. So the module served\none store while each case's RPC handlers resolved another.\n\nProduction is not split — boot publishes the runtime config, so the module and\nthe handlers name one object. The harness was the outlier.\n\nThat stayed invisible while every memory path was in-process. Routing recall,\nreset and flush through the contract made it visible: three cases mix\ncontract-routed access with direct-SQLite reads of the same data, and each was\nwriting to one store and reading from the other. `memory_diff_take_snapshot`\ncounted 0 items after a successful ingest, and `memory_sources_reconcile` saw 0\nof 2 planted raw files.\n\nPoint both sides at one path. `json_rpc_e2e_shared_workspace` is a per-binary\ntemp dir the seam's policy is built from, and the three mixing cases export it\nas `OPENHUMAN_WORKSPACE`, which the config env overlay honours — the seam five\nother cases in this file already use. Its basename is `workspace` so\n`resolve_config_dir_for_workspace` returns it unchanged rather than appending a\nsecond segment.\n\nSharing a store costs the cases that assert global emptiness.\n`memory_sources_reconcile` needed nothing: it already passes `source_id`, so\nits scope count was never global. `memory_sync_and_learn` did — namespaces\nprocessed, queue depth and "ingestion is idle" are properties of the whole\nstore and no re-scoping expresses them, so it wipes first. That wipe relies on\nthe lane running this target serially, and says so at the call site with the\nline to check.\n\nTests only; no production code changed.\n
M3gA-Mind committed 3 months ago
8072f78
Publish the module host policy in the embeddings e2e harness\n\n`embeddings_rpc_e2e` builds only the RPC router, so nothing in it published\na module host policy. That was invisible until the reset/flush paths moved\nonto the contract: `wipe_all` now reaches the bound driver, a module-backed\ndriver refuses to load without a policy naming the workspace to open, and\ntwo of the nine tests failed with\n\n memory wipe failed: wipe_all: the module host policy was never published,\n so module 'tinymemory' cannot be loaded\n\nProduction publishes it at `modules::boot` and `core::runtime::context`,\nand `tests/memory_roundtrip_e2e.rs` does it explicitly for exactly this\nreason. This target was the outlier.\n\nDeliberately not fixed by degrading `wipe_all` when no policy exists. It\nis a destructive call: answering success when the store was never reached\nwould tell a caller their data is gone when it is not, which is a worse\noutcome than the error. The loud failure is the correct behaviour and the\nharness is what was wrong.\n\nOne workspace for the whole binary, behind a `OnceLock`, because\n`set_modules_policy` is a process-global whose first call wins. Publishing\nper test would let whichever test ran first silently own the workspace for\nall of them. The per-test `HOME` tempdirs still isolate config; the module\ncan only ever open one workspace.\n\nAll nine tests in the target pass, including the two that were failing.\n\nDiagnosis from the fleet on the PR thread — the file, the two tests, the\nprecedent and the two production publish sites were all named correctly\nthere, which is most of the work.\n
Shanu committed 3 months ago
900da70
Ask the driver which toolkits can sync, and pin tinymemory v1.12.0\n\nThe #4957 gate — does a native pipeline exist for this toolkit — was the\nlast engine call in `memory/sync/composio/bus.rs`. It reached the engine's\nprovider registry through the `memory::sync::composio::providers`\nre-export, which meant this process also had to populate that registry at\nsubscriber-registration time.\n\n`MemorySourceSync::is_toolkit_syncable` (tinymemory#106, released in\nv1.12.0) asks the driver instead. That matters beyond removing a\nreference: the answer depends on a normalisation the driver owns — it\ntrims and lower-cases before matching — so a host holding its own copy of\nthe list would have been correct until that rule changed and silently\nwrong after.\n\nThe host-side `init_default_providers` goes with it. It existed so this\nprocess could answer `get_provider`; the module initialises its own\nregistry in its own process (tinymemory#105), which a `cdylib`'s separate\nstatics require anyway.\n\n`Unsupported` and a binding failure both read as "not registrable", and\nthat direction is deliberate. Registering a source that then fails every\nsync is the #4957 lie; declining to register one leaves the connection\nworking as an ordinary agent-tool integration. Failing the other way would\nreintroduce the bug the gate exists to prevent.\n\nThe regression test moves with the rule it locks. Which toolkits have a\npipeline is the driver's fact now and is tested there against the same\noffenders this one named — `googlecalendar` false, `" Gmail "` true, so\nthe normalisation is pinned upstream too. What stays here is the half that\ncaused #4957: when the driver cannot answer, the host must treat the\ntoolkit as not registrable. A unit test has no loaded module, so every\nanswer is that case, which is exactly the branch worth asserting.\n\nPinned to v1.12.0 in the same commit because the member and the pin are\none change: all five sites move together, digests taken verbatim from the\nrelease's checksum.toml.\n\n819 memory and modules tests pass; `bus.rs` now names no engine symbol.\n
Shanu committed 3 months ago
1097cc6
Run the Composio connection bootstrap through the driver\n\n`memory/sync/composio/context_ext.rs` existed to bolt one method onto the\nengine's `ProviderContext`, for one caller: the connection-created\nsubscriber's backend-tenant probe. The context itself existed so that\nsubscriber could hand it back to `provider.on_connection_created`. With\nthat hook served over the bus (tinymemory#105) neither is needed, so the\nfile is deleted rather than rewritten.\n\nEverything the subscriber took from the context was host-owned already:\n\n- `ProviderContext::from_config` returning `None` was a probe for "does\n any Composio client resolve" — the not-signed-in case. That probe is\n this host's own factory, asked directly now. The skip behaviour is\n preserved deliberately: a signed-out user must not start taking a path\n they do not take today.\n- `backend_client()` becomes a local helper at its only call site. It\n still reloads the live config rather than trusting the snapshot (the\n OAuth completion being reacted to may have written credentials since),\n and direct mode is still a hard error rather than a silent fallback\n through the wrong tenant (#1710).\n- `ctx.config` was the host's own `Config` inside an `Arc` the moment\n before. The seam exposes `config_path`/`workspace_dir`/\n `onboarding_completed` as trait methods; the host has them as fields.\n- The caps are no longer sent. `BootstrapConnection` takes none, for the\n reason `RunConnectionSync` already documents: the driver reads\n per-source budgets from the registry it owns, and a second copy on the\n wire invites the two to disagree about caps that cost money when wrong.\n They are still logged where they are resolved.\n\nOne engine call is left, and it is the #4957 gate: does a native pipeline\nexist for this toolkit. `bus.rs` had two spellings of that question — a\nnamed predicate extracted to be unit-testable, and a raw `get_provider`\nbeside the hook. They are one now, and that predicate carries the note for\nthe swap: tinymemory#106 adds `is_toolkit_syncable`, which asks the driver\nwith its own normalisation applied instead of matching a list across the\nseam. When it releases, that body becomes a driver call, the host-side\n`init_default_providers` goes with it (the module initialises its own,\ntinymemory#105), and the `providers` re-export loses its last consumer\nhere.\n\n819 memory and modules tests pass.\n
Shanu committed 3 months ago
f826955
Bind the session store through the driver and pin tinymemory v1.11.0\n\n`session::builder::factory` was the last production caller of the\nin-process engine on the chat path — `create_session_memory_with_local_ai`\n— and the reason it stayed was that two embedder-resolution ladders were\n*believed* to agree with nothing proving it. They do, and the reason is\nstructural rather than lucky:\n\n`Config::workload_local_model` and `EngineRuntimeConfig::\nworkload_local_model` both read `embeddings_provider`, strip `"ollama:"`,\ntrim and reject empty. That `Option` is the only input to\n`effective_embedding_settings`, which picks ollama when it is `Some` and\nthe configured cloud provider otherwise. The Ollama health-gate is not a\ndifference either: it lives inside `create_unified_memory_full`, which\nthe module runs because the module *is* the engine, and its probe address\nis proxied back to this host through `EmbeddingHost::ollama_base_url`.\n`embedding_routes` never mattered — the engine's own parameter is\nunderscore-prefixed and unused.\n\nThe second reason was the test build binding to a module a unit test\ncannot `dlopen`. That is the same footing the archivist has had here all\nalong: `module_provider` under `cfg(test)` loads the module when\n`TINYMEMORY_TEST_MODULE` names it and degrades to null otherwise.\n\nThe swap also removes a real oddity — the session held an engine handle\n*beside* a driver over the same subtree. One binding now yields one store.\n\nPinned to v1.11.0 in the same commit because the two belong together: all\nfive sites move as a set (vendor gitlink, registry version + release URL +\n11 archive/digest pairs, `ARTIFACT_CAPABILITIES_PIN`, and the three CI\nworkflows). Digests are taken verbatim from the release's own\nchecksum.toml, never recomputed from a local build, so a release re-cut\nunder the same tag stops matching rather than silently replacing what runs\nin-process. Verified before trusting it: all 64 members this host forwards\nare declared by v1.11.0.\n\n819 memory and modules tests pass.\n
Shanu committed 3 months ago
8168f35
b9693d5
Route four more handlers through the memory contract\n\nEach of these named `tinymemory_core` for a member the pinned v1.10.0\nartifact already serves, so all four are host-side wiring rather than\nseam work.\n\n**flush_source_tree** — forwarders on `ModuleMemoryProvider` and\n`GuardedTree`, then the handler collapses onto the driver. Sealing and\ncascading are one driver call rather than two here, which closes the\nwindow the old two-step left: a tree sealed but not yet cascaded reads as\nempty to every structural query. The guard admits against the *scope*\nrather than `NO_NAMESPACE`, unlike the reads beside it, because this is a\nwrite that names what it acts on.\n\nAlso fixes a latch leak found while collapsing: the re-entrancy set was\ncleared only after a successful flush, so a driver error latched that\nscope out for the life of the process and the natural retry answered\n"already running" forever. It is an RAII guard now.\n\n**sync_statuses** — the wire body is unchanged. The contract's\n`SourceSyncStatus` and the driver's `MemorySyncStatus` carry the same six\nfields under the same names, and both freshness enums are the same three\nvariants under the same `rename_all`, so the map is total and lossless.\nDegrading a driver failure to an empty list is inherited behaviour, kept\ndeliberately: every caller renders "no rows" as "nothing syncing", and\nturning a blip into an RPC error is a real UI change that belongs with\nwhoever owns that screen.\n\n**migration import** — through `DriverMemory::for_config`. The comment\nhere claimed an upstream ask was needed, because `MemoryCore::store` goes\nthrough the guard and the capture budget would truncate an imported\n`MEMORY.md` entry. The budget is real and host-side, but `DriverMemory`\nwraps `binding.provider()`, which is the *unguarded* driver — the binding\nkeeps the guarded one behind `binding.guard()`. Store equivalence checked\nrather than assumed: both paths resolve subdir "memory" under the same\nworkspace.\n\n**email ingest** — an `email_items` mapper that is the exact inverse of\nthe driver's reconstruction. Every field the driver reads through\n`unwrap_or` is sent as `Some`, so no far-side fallback can substitute a\ndifferent value; `to`, `cc` and `list_unsubscribe` cross verbatim, the\nlast because an unsubscribe flow reads it back out of stored mail. Empty\nbodies are filtered rather than refused: the driver validates every item\nbefore ingesting any, so one header-only message would fail a whole\nthread the in-process pipeline wrote most of. The five mail fields were\nverified against the released tag, not the submodule — they are\n`#[serde(default)]`, so a stale pin would decode them to defaults and\ndrop headers silently.\n\nThe wire-shape test moves with it. It compared against the engine's\n`IngestResult` on the reasoning that the upstream type beat a hand-written\nkey list, which held while the engine produced the body. Every arm builds\nfrom `IngestOutcome` now, so that comparison would pin a shape nothing\nproduces — and it kept the engine linked purely to describe a wire this\ncrate owns. Its own doc names the resolution: this crate is the declaring\nside, so the expectation is written out.\n\n759 memory tests pass, ratchets included; the four allowlist entries are\nremoved rather than re-worded, so the lint reflects the real count.\n
Shanu committed 3 months ago
6088b83
Reinstall the memory host seams: this process does still embed the engine\n\nEvery chat turn failed on this branch:\n\n run_chat_task failed ... error=no EmbeddingHost installed — the host must\n call memory::embedding_host::set_embedding_host during startup wiring,\n before any memory work begins\n\n`bafc23214` removed `install_memory_host_seams` from all three boot sites\non the reasoning that "this process embeds no engine, so there is nothing\nto call back". That is not true yet:\n\n- `tinymemory-core` is a normal dependency of this crate (Cargo.toml:260).\n The dev-dependency entry at :657 is a second, separate one, which is\n where the "it is only a dev-dependency" reading came from.\n- `session::builder::factory` still calls\n `store::factories::create_session_memory_with_local_ai`, which calls\n `require_embedding_host()` — on the chat hot path, every turn.\n\nThe loaded module installing its own seams cannot cover this. It is a\n`dlopen`'d cdylib with its own statics, so what it sets is invisible in\nthis process. Same shape as the provider-registry gap found in\ntinymemory#105: a process-global one side fills and the other side reads.\n\nSo the seams go back at all three sites, and `host_impls` is\nunconditional again. `memory-embedded-test-seams` is deleted with them —\nthe feature existed only to keep `host_impls` out of production, which is\nthe premise that was wrong. That also retires the three CI-lane edits it\nneeded, since the 25 tests/*.rs targets naming `host_impls` compile\nunconditionally once more.\n\nThe regression test asserts the engine's own accessor rather than a local\nflag, so it keeps testing what the engine actually reads.\n\nThis costs nothing measurable against #5560: the ratchet counts\n`host_impls.rs` either way (it scans files on disk and does no cfg\nresolution), and the crate was already in the product graph through\n`factory.rs` and through `tinymemory-tinycortex`. What the gate bought was\nthe appearance of progress over a build that could not chat.\n\nThe ordering it settles is worth keeping: the seams are downstream of the\nlast in-process caller, not an independent item. Prove the two embedder\nladders agree, swap `factory.rs` onto `DriverMemory::for_subtree`, and the\nseams then fall out on their own.\n
Shanu committed 3 months ago
950e709
Assert the graph export's shaping without needing a loaded module\n\n`graph_export_builds_source_roots_doc_leaves_and_orphan_links` drove\n`graph_export_rpc` against an in-process engine. That engine is gone for\nthis path: `summary_forest` is served by the memory module now, so the\ncase failed with\n\n graph_export: summary_forest: the module host policy was never\n published, so module 'tinymemory' cannot be loaded\n\nIt was invisible because the file did not compile at all under the\nproduct feature set until the previous commit.\n\nBooting a module to restore it would be the wrong repair. Every one of\nits assertions is about what the *host* does with the forest — invent a\nsource root per scope, re-parent an orphan summary onto it, emit a\ndocument leaf per raw child id of an L1 summary — and none is about what\nthe store holds. So the shaping is now a pure function,\n`shape_summary_nodes`, and the assertions moved to a sibling\n`graph_tests.rs` beside `chunks_tests.rs` and `admin_tests.rs`.\n\nThat buys coverage rather than trading it. The old case asserted one\nforest; the eight tests here add the cases it could not reach — a\nsummary whose parent IS present keeps it (the re-parenting pass must not\nflatten a truncated forest), a summary that sealed over other summaries\nemits no document leaves (they are already real nodes; emitting both\nwould double every interior node), a non-L1 summary emits none, and the\nnode budget cuts the document tail while every summary survives.\n\nAlso fixes a hang in the same file: `run_git` inherited a contributor's\nglobal `commit.gpgsign`, so seeding the test repo blocked forever on a\npinentry prompt with no tty behind it. Two orphaned `git commit` children\nfrom earlier runs had been stuck for over a day. The seeded repos now\npass `-c commit.gpgsign=false`, and the file runs in under a second.\n\nClaude-Session: https://claude.ai/code/session_01UsS36AGAjUaCnFNRHuCtmx\n
Shanu committed 3 months ago
1aac5d4
bc19223