Skip to content

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

Commits on main

a257b28
fix(inference,security): correct stale inference docs and derive keyring active_mode from the backend\n\nTwo independent defects from the e2e coverage wave.\n\n#6075 — two `inference` docs stated the opposite of the code.\n\nPart 1: the managed per-tier vision map returns `true` for the reasoning and\nvision tiers, but four comments claimed otherwise ("currently all `false`" /\n"only `reasoning-v1`"). All four are corrected, and the map is now pinned\nexhaustively — every tier constant and every `hint:` alias, the `false` arms\nincluded — so a future arm flip fails a test and forces the docs to be\nrevisited. The issue named one of the four sites; the other three describe the\nsame map and had drifted the same way.\n\nPart 2: `claude_code_settings.json` is written to the directory\n`workspace_dir_from_config` returns, which is the parent of `config.config_path`\n— the OpenHuman config dir, next to `config.toml`. The RPC schema description\nand the module docs said "under the workspace", which reads as\n`Config::workspace_dir` (`~/.openhuman/workspace`) or the user's project root.\nDocs corrected at all three sites, plus a test that builds a config whose three\ncandidate directories are distinct and asserts which one receives the file.\nThe storage location itself is unchanged: moving it would orphan every existing\ninstall's persisted toggle.\n\n#6076 — `keyring_consent_status` reported `active_mode: os_keyring` for every\nnon-OS backend.\n\n`current_status()` branched on `keyring::is_available()` alone, and\n`probe_availability()` short-circuits to `true` for `file`, `mock` and\n`encrypted_file`. All three therefore claimed the OS keyring beside a\n`backend_name` that said otherwise, and a recorded `declined` decision could not\nmove it. In staging and production — where `encrypted_file` is the documented\ndefault — the shipped app told users their secrets were in the OS keychain while\nthey were in `{workspace}/secrets.enc`.\n\nThe derivation now follows the backend identity, extracted as a pure\n`active_mode_for(available, backend_name, cached)` so every combination is\ntestable without touching the process-global backend `OnceLock`:\n\n os + available -> os_keyring\n os + probe failed -> consent outcome (unchanged)\n encrypted_file -> local_encrypted_file (new)\n file / mock -> local_plaintext_file (new)\n anything else -> consent_pending, with a warning\n\n`StorageMode` gains two variants rather than reusing `local_encrypted`: that\nvalue means "the user consented to the SecretStore fallback", which is a\ndifferent mechanism and a different location from the `encrypted_file` backend's\n`secrets.enc`. Reusing it would have conflated an operator's configuration with\na consent decision. `file` is plaintext `dev-keychain.json` with no OS keychain\ninvolvement at all, so it must not be labelled encrypted in either sense.\n`available` is untouched — the file backends genuinely are usable, and the wallet\nguards and snapshot loops that read it are unaffected.\n\nAlso fixes the consumer the issue names: `SecurityPanel` looked up\n`keyring.settings.mode.${activeMode}` with a snake_case mode against camelCase\ni18n keys, so no lookup ever matched and the badge rendered the literal key\n(`declined` was the sole exception, spelled the same either way). A mode -> key\nmap bridges the two; an unknown mode still falls through to the raw value, so\nversion skew shows what the core reported rather than borrowing another mode's\nlabel.\n\nNote for the issue's blast radius: SecurityPanel's two consent buttons sit\ninside `{!keyringStatus.available && ...}`, and `available` is `true` for\n`encrypted_file`, so that section is already hidden in staging/prod — this\nchanges the badge, not the buttons. `policy_tests.rs` did not pin\n`current_status()`. `activeMode` is typed `string` in the frontend, so the new\nvariants break no types or fixtures.\n\nCloses #6075\nCloses #6076\n
Shanu committed 2 months ago
03bf5cc
fix(schemas): declare pid as U64 and document param-validation precedence\n\n`health_system_info` declared `pid` as `TypeSchema::String` while\n`SystemInfo.pid: u32` serializes as a JSON number. Output fields are not\nvalidated at dispatch, so nothing failed at runtime — but the schema\ngenerates the frontend's RPC types and feeds the model-facing tool\n`output_schema` (`tools/registry/ops.rs:375`), so the wrong type reached\nboth consumers. Declaring `U64` leaves the wire format untouched.\n`platform/health/README.md` documented the mismatch as intended; updated.\n\nSeparately, handler-level "missing required param" strings cannot reach a\ncaller: `core::all::validate_params` is the single pre-dispatch gate and\nrefuses first, in its own wording, carrying the field's schema comment as\na suffix. Rather than delete the shadowed handler checks, document them.\nDeletion is not the near-zero-risk change it looks like: the coverage\nsuites invoke controllers via `(controller.handler)(params)` with no\nvalidation, so ~18 existing assertions pass *because* of those checks, and\nmost of the 150 `missing required param` sites across 74 files belong to\nagent tool handlers taking model-produced arguments, which never pass\nthrough `validate_params` at all.\n\n`validate_params` now documents its own precedence: the entry points that\nvalidate before `try_invoke_registered_rpc`, the one internal call site\nthat relies on its caller (`mcp::server::write_dispatch`), and what that\nmeans for whoever writes the next test. The three handler sites named in\nthe issue point back at it.\n\nAdds `tests/raw_coverage/dispatch_param_validation_e2e.rs`, which drives\nthe real dispatcher and pins what a caller observes for missing, unknown\nand mistyped params, plus a health test pairing every declared output type\nagainst the handler's live JSON.\n\nCloses #6073\nCloses #6074\n
Shanu committed 2 months ago
de8a99e
fix(tinyagents): count each middleware's fixed text against its own share\n\nBoth consumers of the split allowance added text no share accounted for. The\ncontents list seeded `used` at zero and counted only rows, then prepended a\nparagraph of header and appended the omitted-count line. The wrap-up filled its\nbudget to the boundary and then pushed its instruction unconditionally.\n\nRestoration filling to the boundary is what makes this bite: a fixed addition\nafter it is exactly the overshoot the budget exists to prevent. With a window\nthe trim middleware then evicts oldest non-system messages — including results\njust restored, the eviction bounded restoration was there to avoid. Without a\nwindow nothing trims and the request simply exceeds the allowance. The effect\nis largest on a small window, where the share floors at 64 tokens and the\nheader alone is comparable.\n\nEach middleware now seeds `used` with its own fixed text, so its share bounds\nits whole contribution rather than the variable part. Reserving the overhead\nfrom the total before splitting would double-count it, since neither share is\nspent anywhere but inside its own middleware.\n\n`FOOTER_ALLOWANCE` stands in for the omitted-count line, which cannot be\nmeasured before the cap decides how many rows were dropped.\n\nAdds `both_middlewares_together_stay_inside_the_no_window_allowance`, which\nruns both in registration order against one request and asserts the combined\ntotal — the bound that actually matters — plus that each contributed, so it\ncannot pass vacuously. The two existing caps now assert the nominal share\ninstead of a loose multiple of it.\n\nReported by CodeRabbit on #6068.\n\n
sanil-23 committed 2 months ago
656a6bd