Skip to content

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

Commits on main

fix(archivist): classify the Ollama errors the embedder actually emits\n\n`is_local_embedding_error` matched "Ollama embedding model … is not installed\nat …". That string exists nowhere in tinyinference: the only "is not installed\nat" is providers/openai/local.rs:376, and it reads "Ollama model" with no\n"embedding". The conjunction was therefore never true, so the model-not-pulled\nhalf of #5867 — Ollama up, bge-m3 never pulled — was not classified and no\nnotice fired. The test passed because it asserted the same invented string.\n\nMatch what the source emits instead, each literal quoted from it:\n\n- daemon down, embeddings/ollama.rs:136 (already matched)\n- embedding model not pulled: Ollama answers 404 and the embeddings path\n renders it through ollama_http_error as "ollama embed failed with status\n {status}: {body}" (embeddings/ollama.rs:241). Anchored on the status so the\n six other "ollama embed …" shapes in that file — NaN, count and dimension\n mismatch, empty vector, parse failure — keep their own non-notification\n path; those are data faults, not an absent runtime.\n- chat model not pulled: "Ollama model `{model}` is not installed at …"\n (providers/openai/local.rs:376). #5867 names gemma3:4b as well as bge-m3.\n\nAlso makes the latch test observe what it claims. It called the notice twice\nand asserted nothing, so it passed whether the notice fired twice, once, or\nnever — every outcome, including the banner storm the latch exists to\nprevent. It now subscribes to the web-channel bus first and asserts exactly\none event arrives with the expected kind.\n\nRevert-checked, both changes separately: restoring the old classifier fails\nthe new 404 assertion; removing the Once fails the latch assertion on "the\nsecond call must publish nothing". cargo fmt applied — that was the red\nRust Quality lane.\n
M3gA-Mind committed 3 months ago
65597b0
fix(build): suggest the full feature union, and stop a malformed error passing as a dispatch\n\nThree review findings, each confirmed against the source before acting.\n\n**build.rs — the suggested command dropped gates the caller already had.**\nFlagged independently by Codex and CodeRabbit. `skipped` mapped each target to\nits MISSING features and the `--features` line was built from that union, but\n`--features` is the complete set to activate, not a delta on the current one.\nWith `voice` already on, `raw_coverage_all` is missing only `inference`, so the\nwarning recommended `--features crash-reporting,inference,web3` — following it\ndrops `voice` and silently skips both voice targets again. The warning was\nhanding out a command that reproduces the failure it exists to prevent.\n\n`skipped` now carries `(missing, required)`: the diagnostic still names what is\nmissing, and the remediation is the union of every skipped target's FULL\n`required-features`.\n\nVerified by driving build.rs standalone against the real manifest, and\nrevert-checked:\n CARGO_FEATURE_VOICE=1, reverted -> `--features crash-reporting,inference,web3`\n CARGO_FEATURE_VOICE=1, fixed -> `--features crash-reporting,inference,voice,web3`\n\n**assert_rpc_completed — `unwrap_or_default()` re-opened the vacuous pass.**\nA missing, null or non-string `error.message` became `""`, which satisfies the\ncheck and lets a malformed error-only response count as a completed dispatch —\nthe same shape this helper was rewritten to remove. It now requires a string\nmessage and fails loudly when there is none.\n\n**assert_rpc_completed — `contains` was the wrong test.**\n`dispatch.rs:96` builds the string as `format!("{UNKNOWN_METHOD_PREFIX}{method}")`,\nso the marker is always at byte zero; `dispatch.rs:151` reads it back with\n`strip_prefix` for the same reason. `contains` would also reject a REGISTERED\nmethod whose own validation error quoted the phrase later, turning a reachable\nsurface into a false failure. Now `starts_with`.\n\nBoth helper changes tighten the assertion; neither relaxes one.\n
M3gA-Mind committed 3 months ago
5f65b34
fix(test): make a skipped test target audible and assert RPC reachability\n\nTwo findings from the e2e coverage audit, both of the same shape: something\nreports green having checked nothing.\n\n1. An unmet `required-features` skip is now announced.\n\nFour tests/*.rs targets carry `required-features`, and every gate they name is\ndefault-OFF for contributors. Cargo treats the two ways of selecting a target\ndifferently, and only one is safe:\n\n - naming it (`cargo test --test json_rpc_e2e`) is a hard error when the\n features are unmet -- verified: "target `json_rpc_e2e` in package\n `openhuman` requires the features: `voice`", exit 101. CI names its\n targets one at a time, so CI cannot lose one this way;\n - globbing (a bare `cargo test`, or `--tests`) drops the target SILENTLY and\n exits 0. That is what a contributor runs.\n\n`json_rpc_e2e` alone is >12k lines of RPC contract coverage and\n`raw_coverage_all` aggregates ~76 suites, so a green local run can have\ncompiled and run neither and look identical to one that did.\n\nbuild.rs now reads the manifest and emits one `cargo::warning=` naming what the\ncurrent feature set will skip and the flag that would run it. A build-script\nwarning rather than a failing test, because cargo captures the output of a\nPASSING test -- a warning printed there would itself be invisible. A warning\nrather than an error, because a contributor build legitimately omits these\ngates; the goal is that the omission is never a surprise. The manifest is\nparsed rather than hard-coded so a target added later is covered without\nanyone remembering this file, which is why the module list beside it is\nglobbed too.\n\n2. `assert_rpc_completed` now asserts something.\n\nIt checked that the response carried `result` OR `error` -- true of every\nwell-formed JSON-RPC response, including `unknown method: openhuman.whatever`.\nRoughly 90 methods across four tests were probed through it, so the whole\nregistry could have been deleted and this file would still have passed.\n\nIt now rejects a response whose error is `dispatch::UNKNOWN_METHOD_PREFIX`, and\ntakes that prefix from the shared constant so the probe cannot drift from the\nemit site. An error is still tolerated, deliberately: these loops call each\nmethod with empty params, so a registered method usually answers with a\nvalidation failure -- that is a completed dispatch, and the strongest thing an\nargument-less probe can honestly claim.\n\nChecked, not assumed: all 10 tests in the file still pass, so no call site was\npassing only because the helper was vacuous. Those ~90 surfaces are genuinely\nreachable.\n\nRevert-check: unregistering the memory_sources controllers in core/all.rs\nfails the reachability test at worker_c_modules_e2e.rs:254 with\n"openhuman.memory_sources_list: the core does not serve this method ...\nGot: unknown method: openhuman.memory_sources_list". The old helper passed that\nsame response. Restored; core/all.rs is byte-identical to main.\n
M3gA-Mind committed 3 months ago
95774b5
fix(subagent): reject a traversing task_id before it reaches a path\n\ntinysweeper flagged `task_id` as untrusted input on its way into a filename.\nTraced it, and it is: the value is model-authored and reaches the filesystem\ntwice.\n\n continue_subagent.rs:172 task_id read from the tool's arguments\n continue_subagent.rs:218 joined into a path to READ the checkpoint\n continue_subagent.rs:360 passed on as SubagentRunOptions::task_id\n pause_checkpoint.rs:50 a re-paused child WRITES {task_id}.json\n\nSo `continue_subagent(task_id: "../../../../tmp/pwn", …)` walks both the read\nand — once the resumed child pauses again — the write clean out of the\ncheckpoint directory. That is an arbitrary file write under a path the model\nchose, which is the same threat model the #5494 config hardening already works\nunder: this directory is agent-writable, so agent-supplied values are\nuntrusted.\n\nThe write predates this branch (it lived inline in `runner.rs`); moving it into\nits own module is what put it under review.\n\nGuarded at both ends, because they fail differently: the sink refuses and\nreports the pause as unpersisted, while the boundary refuses the whole call and\ntells the model what a task id may look like — which also closes the read,\nwhich the sink never sees.\n\n`is_safe_task_id` is an allow-list, not a `..` blocklist. Every id this system\nmints is `sub-{uuid}`, `subsess-{uuid}` or a short label, so nothing legitimate\nneeds a separator, a dot or a non-ASCII character — and an allow-list cannot be\nwalked around by an encoding the check did not anticipate. A test pins the real\nid shapes so the guard cannot start breaking resumption instead of hardening it.\n\nAlso from the same review: `a_repaused_subagent_gets_the_same_injection_safe_envelope`\nasserted only the `checkpointed=true` branch. The re-pause path passes\n`pause_checkpoint.is_some()`, and the other branch is exactly the case where a\nsecond pause failed to persist, so the test now runs both.\n\n`cargo test --lib -- checkpoint_tests awaiting_user continue_subagent\nsubagent_runner`: 104 passed, 0 failed.\n
Shanu committed 3 months ago
a3c9299
95f0f71
df7c244
fix(subagent): surface checkpoint write failures at pause time (#5928)\n\nThe reported symptom is not a bug. `[continue_subagent] no pause\ncheckpoint — trying durable session store` is an INFO log on the\ndesigned path: the `subsess-…` id in it is a durable-session id minted\nby `subagent_sessions::register`, while pause checkpoints are keyed by\ntask id and written only when a child exits on `ask_user_clarification`.\nThose id spaces never overlap, so a roster id always misses the file and\nalways resolves through the durable store — which the tool's own\ndescription documents. Nor is it silent: every fallback branch returns a\n`ToolResult::error` naming what to do next.\n\nWhat the log did do is carry `error=No such file or directory` at INFO\nfor an expected miss, so the happy path read like a broken one. That is\nnow split: ENOENT logs at debug as expected, any other IO error stays a\nwarning.\n\nThe issue's first acceptance criterion is real, though, and worse than\ndescribed. All three checkpoint failures — `create_dir_all`,\n`to_string_pretty`, `fs::write` — were logged at `warn` and then fell\nthrough to the same `SubagentRunStatus::AwaitingUser`, whose own doc\npromised "the checkpoint file contains the full conversation history for\nresumption". So a pause that failed to persist still told the\norchestrator it was resumable, relayed a question and a `task_id`, and\nonly failed once the user had answered and there was nowhere to put it.\n\n- `write_pause_checkpoint` is split out and returns `Option<PathBuf>`.\n Failures log at `error`, and the `None` propagates: `AwaitingUser`\n carries `checkpoint`, `AgentProgress::SubagentAwaitingUser` carries\n `checkpoint_path`, and the `[SUBAGENT_AWAITING_USER]` envelope tells\n the orchestrator resuming may fail. It warns rather than forbids,\n because a child with a durable session is still resumable from the\n roster — "not resumable from this pause" is a narrower claim than\n "not resumable".\n\n- The run ledger no longer fabricates the path. `progress_bridge`\n rebuilt it from `workspace_dir` and recorded it unconditionally, so it\n asserted a checkpoint existed even when the write had failed, and\n ignored any `checkpoint_dir` override. It now records what was written\n and a `checkpointPersisted` flag.\n\n- `continue_subagent`'s re-pause path built its own envelope with\n `format!` and the question interpolated raw. That is the injection\n hole `awaiting_user_envelope` exists to close: a sub-agent-authored\n question containing a newline and a literal `[/SUBAGENT_AWAITING_USER]`\n closed the block early and injected resume instructions the\n orchestrator then trusted. The helper JSON-encodes the question, and\n its doc already said the call sites must not drift — there were three\n and the third was the unsafe one. It also omitted the #4291\n "do NOT re-spawn" instruction. Now routed through the helper.\n\nOn the issue's third criterion: the checkpoint directory is created\ncorrectly on fresh installs. Nothing pre-creates it; `create_dir_all`\nruns at write time and builds intermediates. Pinned by a test rather\nthan left as prose.\n
Shanu committed 3 months ago
bf46ce5
style: rustfmt the tool-policy placement test
M3gA-Mind committed 3 months ago
a45feef
test(e2e): backfill coverage for migration guard, prompt order, redirects, privacy sheet\n\nAn audit of six PRs merged in the last week found none with e2e coverage of\nwhat they changed. Three shipped tests their authors reasonably believed were\nsufficient: #5799 added 62 lines to `tests/json_rpc_e2e.rs` that are a\ndeterminism fix for a different test; #5821's four unit tests exercise an\nextracted pure helper and would pass if `build_system_prompt` stopped calling\nit; #5939's two tests are vitest, not an e2e lane.\n\nAdded, each driving the changed path and asserting the changed behaviour:\n\n- #5799 `json_rpc_migrate_hermes_refuses_null_driver_without_naming_openclaw`.\n Drives the Hermes migration RPC into a configured null driver and asserts the\n refusal, that it no longer hard-codes "OpenClaw" in a message both migrations\n raise, and that the source workspace really is byte-identical afterwards.\n The third arm #5799 added is unreachable with modules on and stays with its\n gates-off unit test; the doc comment says so rather than faking it.\n\n- #5821 two tests on the real `Agent::build_system_prompt`, asserting the\n tool-policy boundary does not open the prompt and that it is the prompt's\n final block — the property a prefix cache keys on, and the one a revert to\n prepending destroys.\n\n- #5939 two cases on `/webhooks`, asserting the query and the fragment survive\n BOTH redirect hops. They assert the final destination, so a fix to only the\n first hop still fails them.\n\n- #5845 a new spec opening the privacy sheet, which no e2e had ever done.\n\nAlso flips `BUG: /skills?tab=channels drops the tab`, which pinned pre-fix\nbehaviour with the note "Flip the two assertions below when that lands". It\nlanded in 786d7ba76 (#5924), four hours before that spec was last touched, so\nthe test asserts the opposite of shipped behaviour.\n
M3gA-Mind committed 3 months ago
7eabdb5
fbcdf23