Skip to content

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

Commits on main

refactor(memory): route the last contract-covered call sites, and fix the CLI gate\n\nA parallel sweep over every remaining bucket. The finding worth recording is\nthe shape of what is left: of 86 distinct engine symbols this host still\nnames, 15 have an exact contract member, 9 have one whose output differs,\nand 44 have none at all — they hand out a connection or a client, not data.\nRouting cannot reach those, which is why this is the end of what routing\nachieves rather than a pause in it.\n\nMigrated where a member covers the call exactly: chunk list/get in the tree\nRPC (`ChunkQuery` is `ListChunksQuery` field-for-field; `Chunk` is the same\nitem on both paths, so the wire bytes are unchanged, and the `spawn_blocking`\ngoes with it because the driver owns whether its reads block), the memory\ntools' store/recall/forget, `remember_preference`, the ops layer's document\nhelpers, and the composio sync bus.\n\nLeft alone, deliberately, each with the reason in the file: the entity and\ngraph read RPCs return a total count and a `MAX(surface)` sample the contract\ndoes not promise; `ingest_*` returns `IngestResult`, whose `already_ingested`\nis load-bearing and which `IngestOutcome` drops; the retrieval RPCs serialise\na `tree_kind` the contract's `RetrievalHit` does not carry. Each of those is a\nwire renegotiation, not a routing change.\n\n`legacy_client_verdict` accepted only `DriverClass::Embedded` while\n`binding::admit` had stopped admitting `Embedded` at all — so it was refusing\nevery `openhuman memory` subcommand in the field, not just the two it meant\nto gate. `Module` passes now: the gate is about where memory lives, and a\nmodule is a cdylib over the in-process bus with no egress. `External` and\n`Null` stay refused for the reason the message gives.\n\nTwo dead aliases removed (`memory::{MemoryClient, UnifiedMemory}`,\n`lib::{MemoryClient, MemoryState}`) — zero consumers anywhere; the two tests\nthat did want the handle now name the crate deliberately.\n\nThe ratchets drove their own shrink, which is what they are for: seven files\nstruck off the direct-refs allowlist, one dead guard bypass removed. The new\ntest seam lives under `memory/test_support/` because that is the path the\nbypass scanner skips — its allowlist may shrink but never grow, and a test\nfixture is not the kind of bypass that list exists to track.\n\n285 -> 236 direct engine references over the session.\n\n
Shanu committed 3 months ago
0f2058c
refactor(memory): route the CLI's read paths and own the safety scrubbers\n\nThree migrations that share one shape: the host was reaching through the\nengine crate for things that were never the engine's.\n\n`openhuman memory docs|graph|namespaces|clear` bind the driver now.\n`create_memory_binding` runs the same capability gate, installs the same\nhost seams, and publishes the module policy the way `runtime/context.rs`\ndoes — without that last step a CLI invocation never runs boot's\n`load_declared_modules` and every module-backed call fails on an\nunpublished policy. `legacy_client_verdict` is deliberately NOT on this\npath: it passes only for `DriverClass::Embedded`, and a contract call does\nnot touch the embedded store. A missing family refuses by family name and\ndriver id rather than succeeding silently. `ingest` and `query` stay on the\nengine client — the ingestion pipeline and the engine-rendered context\nstring have no contract shape yet, and the doc comment now says so.\n\nTwo behaviour deltas, both stated rather than smuggled: `memory graph`\nemits snake_case keys (the contract's serde derive) where the engine\nhand-wrote camelCase, which makes the CLI agree with the `memory.graph_query`\nRPC that already returned snake_case; and an unfiltered graph query is no\nlonger truncated at 300 rows, because the contract call takes the limit the\nRPC passes.\n\nThe safety scrubbers move host-side, verbatim — secret patterns, the\nnational-ID PII pass, the JSON walker, and their tests. Which strings count\nas secrets, and what a redaction looks like, is product policy exactly like\nthe preference lanes and the event heuristics before it; the engine keeps\nits copy for its own pipelines and the two are independent by design.\nPatterns stay behind `LazyLock` so the compile happens once, as upstream.\n\n`flows/memory_tools.rs` names the contract for `MemoryCategory` and\n`MemoryTaint`: its comment claimed they were "the engine's types, not the\ncontract's", which stopped being true when tinymemory#18 §A1 moved them\nonto the contract — `tinymemory_core` re-exports them verbatim.\n\nRatchet: bypass allowlist gains one entry for the CLI binding, with the\nsame justification `cli_capability.rs` already carries. 258 -> 246 direct\nengine references.\n\n
Shanu committed 3 months ago
2f3bdff
test(e2e): retire stale settings contracts
Steven Enamakel committed 3 months ago
00df95d
test(e2e): retire stale settings contracts\n\n
Steven Enamakel committed 3 months ago
d6aeff4
Merge pull request #11 from senamakel/prompt-slimming
Steven Enamakel committed 3 months ago
fb20425
fix(agent): make the retry instruction true for Failed as well\n\nThe previous commit removed one false claim and introduced another. It\nreplaced "re-running this tool will return the same result" with\n"re-running it will not produce a summary" — which is false for\n`UnavailableReason::Failed`, because that variant is recorded *before* the\ncircuit breaker opens, so a later attempt can genuinely succeed. The doc\ncomment said exactly that two paragraphs above the notice asserting the\nopposite, which is the tell.\n\nAll three notices now end with an instruction and a reason rather than a\nprediction:\n\n Do not re-run the tool for a summary; the full output is already here.\n\nThat is true for every variant. It keeps the anti-loop property the\nsentence exists for — the model's reasonable response to an unannounced\ntruncated dump is to call the same tool again — but grounds it in something\nthe code knows (the raw output is already in front of the model) instead of\nsomething it does not (what a future attempt would do). The `Failed` reason\nclause is also scoped to "for this result", since that is the only attempt\nit observed.\n\nThe unit test is renamed to\n`every_unavailable_notice_says_not_to_re_run_without_predicting_the_future`\nand now asserts both retired phrasings are *absent* from every variant, so\nneither returns as a tightening. The middleware regression test follows the\nnew wording.\n\nNote this is the second correction to the same sentence in this PR. That is\nworth being explicit about rather than quietly amending: the first review\nround caught an overclaim, the fix overcorrected into a different overclaim,\nand the test now pins the property rather than the phrasing so a third\nattempt cannot reintroduce either.\n
M3gA-Mind committed 3 months ago
5dfbf1e
docs(approval): record the accepted auto_approve_all × remote-triage outcome\n\nThe Codex reviewer on this PR found that labelling remote triage triggers\n`Workflow { require_approval: true }` does not park them when\n`autonomy.auto_approve_all` is on: the blanket bypass excludes only\n`SubconsciousTainted` and `Unknown`, so for those users this PR moves the\npath from `Unknown` → hard Deny to Allow with no `pending_approvals` row.\n\nVerified, referred to the gate owner rather than patched, and ruled on:\nenabling a blanket "approve everything" switch opts into this globally.\nNot a defect, and deliberately not a code change — excluding the origin\nwould overturn the pinned test at `auto_approve_all_overrides_require_\napproval_workflow` and narrow what the flag means for every user who set\nit, and a new protected variant would make the flag mean "approve\neverything except…".\nhttps://github.com/tinyhumansai/openhuman/issues/5634#issuecomment-5396604125\n\nSo the outcome is documented in the three places someone would meet it:\n\n- The `auto_approve_all` field docs, on both the config schema and the\n `SecurityPolicy` mirror. Someone enabling the flag should learn that\n remote-origin triage stops writing an audit row from the field, not from\n an incident review.\n- The bypass construction itself, extending the comment that already\n explains why `SubconsciousTainted` and `Unknown` are carved out, so the\n reader of the exclusion list sees what is deliberately *not* carved out.\n- `auto_approve_all_allows_a_remote_triage_dispatch_without_an_audit_row`,\n beside the existing `auto_approve_all_overrides_*` pair.\n\nThat test is written to be broken on purpose. It drives the real\n`remote_trigger_origin` helper rather than a synthetic origin, so it fails\nboth if the bypass exclusion list grows this origin and if\n`remote_trigger_origin` is changed to return a protected variant — either\nof which reopens the decision. Its doc says so, and says that deleting it\nto make such a change pass is the wrong response.\n\nRevert-check is by construction rather than by a separate run: both\nassertions read through `auto_all`, so adding this origin to the exclusion\nlist flips `Allow` to a park and makes `list_pending()` non-empty. The\ncoverage lane runs it.\n
M3gA-Mind committed 3 months ago
3a7b5bb
fix(agent): keep the unavailable notice intact, and stop it overclaiming\n\nTwo review findings on the disclosure, both about the notice rather than\nthe outcome plumbing.\n\nThe notice was prefixed before the truncation stages, and the per-tool char\ncap runs `content.chars().take(cap)`. The notice is ~165 chars, so a tool\ndeclaring a `max_result_size_chars` below that had the cap slice straight\nthrough it — removing the reason text and the do-not-re-run sentence and\nleaving a fragment that still reads as ordinary tool output. The stage that\nexists to stop a silent re-dispatch loop was therefore removed exactly when\nthe payload was most aggressively truncated.\n\nThe notice is now held in a local and applied after every cap. The payload\nis still capped to the tool's declared limit — deferring the notice must\nnot smuggle a tool past its own contract — and a regression test with a\n12-char cap against a 1,600-char payload asserts both halves: the complete\nnotice leads the content, and the payload still carries the tool-cap\nmarker. As a side effect the caps now bound the tool's own output rather\nthan openhuman's annotation about it, which is what a tool's declared cap\nis a contract about.\n\nSeparately, every variant asserted that "re-running this tool will return\nthe same result". That is false. `Failed` leaves the breaker open for\nfurther attempts, so a second summarization can genuinely succeed, and an\nAPI-backed tool is time-varying regardless — so the sentence could suppress\na recovery the model had good reason to attempt. Reworded to\n"Re-running it will not produce a summary", which is the only claim this\ncode can actually make and still carries the anti-loop property the notice\nwas added for. The doc comment now says why the stronger phrasing was\nwrong, so it does not get restored as a tightening.\n
M3gA-Mind committed 3 months ago
b4404d6
fix(agent-tracing): classify the backend host by parsing it, not by substring\n\n`environment_for_base` predates this PR, and while its answer only labelled\na payload its sloppiness was tolerable. `skip_push` makes it decide whether\na push happens at all, so both directions of that sloppiness became\nload-bearing:\n\n- Too broad on staging. `base.contains("staging")` matched the whole URL, so\n `https://staging-attacker.invalid` classified as staging and passed the\n push gate — a host nothing here owns, reached with a live session token.\n- Too narrow on local. Only `localhost`, `127.0.0.1` and `0.0.0.0` counted,\n so an IPv6 loopback backend (`http://[::1]:7788`) or a private LAN address\n classified as production and would have silently stopped exporting the\n moment the gate landed. That is a working development setup breaking on a\n change that intended to leave it alone.\n\nThe host is now parsed. Local detection delegates to\n`api::config::host_is_local`, which already handles IPv4\nloopback/unspecified/private, IPv6 loopback/unspecified and\n`localhost`/`*.localhost`; it is widened to `pub(crate)` for this. One\ndefinition is the point — two local-host predicates that disagree is how a\ngate admits exactly the case the other blocks.\n\nStaging now requires both the leftmost label to be `staging`/`staging-*`\nand the host to sit under `tinyhumans.ai`, so a host that is not ours is\nproduction, and production does not push. That anchor is the judgement call\nin this commit: it is taken from the hosts this file's own tests already\nencode, and it means a staging backend on some other domain would classify\nas production and stop pushing. That is the fail-closed direction and it\nmatches the allowlist rationale already written above\n`LANGFUSE_PUSH_ENVIRONMENTS`.\n\nAn unparseable base is production for the same reason.\n\nThree regression tests: lookalike staging hosts (including\n`staging-api.tinyhumans.ai.evil.example` and a right-domain wrong-position\nlabel), the local buckets the substring form missed, and the unparseable\ncase. Each asserts `push_allowed` alongside the bucket, since the bucket is\nonly interesting because of what it gates.\n
M3gA-Mind committed 3 months ago
7c932d9
feat(archivist): write episodic memory through the driver, not a SQLite handle\n\nThe archivist held `Arc<Mutex<Connection>>` — the raw handle the session\nfactory stripped off the engine result at `factory.rs:290`, and the exact\nblocker #5378's correction documented: a concrete SQLite connection no\nmodule or remote driver can supply, so the whole episodic subsystem was\nunmigratable while it existed.\n\nIt now holds `Arc<dyn MemoryProvider>` and writes through four families.\nTurns and segments go through Episodic (`insert_turn` answers the assigned\nid, which is why the contract returns it from the insert rather than\nleaving callers to a follow-up `last_insert_rowid` — that call is gone).\nExtracted events go through `insert_event`, profile observations through\n`Profile::upsert_provider_facet` (confidence-aware, so a weaker\nre-observation cannot overwrite a stronger one), and the segment's prose\nthrough `Ingest::ingest_chat` using the widened attribution fields: author\nis the speaking role, owner is the session, and `platform: "agent"` keeps\nwhat every previously-stored chunk carries.\n\n`ModuleMemoryProvider` gained `as_episodic` and forwards all nine members,\nso `ARTIFACT_CAPABILITIES` advertises the full contract for the first time —\nthe four capability-boundary tests that guarded the #5598 over-claim are\nrewritten rather than deleted: the over-claim was advertising a family the\nHOST could not reach, and the accessor rule (`capabilities_for` can only\nname families the provider implements) plus the pin-drift test are what\nkeep that honest now.\n\nThe heuristic event classifier moves host-side, verbatim — same pattern\nlists, same 5-char floor, same one-match-per-category dedupe. Which sentence\nis a "commitment" is product policy, exactly like the preference lanes and\nthe redaction hash before it.\n\nTest fixtures bind a real `TinycortexProvider` over a tempdir: the same\ndriver the cdylib wraps, since a dlopen'ed module is a process singleton a\nunit test cannot load twice. The tree-ingest tests share ONE workspace\nbetween provider and config — two tempdirs made every chunk count read a\nstore nothing had written to. `profile_conn_guard` now exempts `_tests.rs`\nby path like its sibling ratchets: a test that writes through the provider\nand proves the row landed with a raw read is using the connection as an\noracle, not as a door.\n\nRatchet: archivist files drop from 18 engine references to 5 (chat provider\nconstruction and the md-store dual-write, both separate buckets).\n\n
Shanu committed 3 months ago
79abb95
fix(e2e): align chat tests with assistant composer
Steven Enamakel committed 3 months ago
02892d8
fix(e2e): align chat tests with assistant composer\n\n
Steven Enamakel committed 3 months ago
b9335d3