Skip to content

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

Commits on main

141ec1e
fix(cron): declare cron_run's real output shape\n\n`cron_run`'s controller schema promised\n`{job_id, status: "ok"|"error", duration_ms, output}` with every field\nrequired, but the handler spawns the execution on a background task and\nreturns `{job_id, status: "queued"}`. `"queued"` was not among the declared\nvariants and `duration_ms`/`output` were never returned at all.\n\nThe async behaviour is deliberate — `ops.rs` spawns the job and writes a\n`"queued"` placeholder run row so "Run Now" does not block the UI — so the\nschema is what moves. The terminal outcome already lives in `cron_runs`.\n\nThe declared shape was not invented: it is what the *agent tool*\n`CronRunTool` returns, which still runs `execute_job_now()` synchronously.\nThe controller was made async later and the schema tracked neither.\n\nDeclare `status` as `Enum["queued"]` rather than adding `"queued"` to the\nexisting variants: `ok`/`error` are unreachable from this controller, and\ndeclaring them would leave a generated client modelling states it can\nnever receive.\n\nNothing validates controller outputs at runtime (`validate_params` covers\ninputs only), so this divergence was structurally silent. Add a conformance\ntest that dispatches the real handler and checks its response against\n`cron_schemas("run").outputs` — required fields present, no undeclared\nkeys, enum values among declared variants — so drift on either side fails\nloudly.\n\n`schemas_run_result_contains_status_and_duration_fields` asserted the\nbuggy shape; replaced with one asserting the true shape.\n\nCloses #6070\n
Shanu committed 2 months ago
b6d4c00
fix(flows): stop claiming ungranted trust and reject malformed contract slugs\n\nTwo defects in the flows RPCs that report what a run will ask the user for.\n\n`flows_approval_manifest` pushed every approvable `tool_name` onto\n`already_trusted` when no `ApprovalGate` was installed. Nothing parks without a\ngate, so `missing` is empty by definition — but nothing was ever *granted*\neither, so those keys do not belong in `already_trusted`. A graph with an\n`http_request` and a `code` node came back as\n`already_trusted: ["flows_http_request", "flows_code"]` on a host holding no\ngrant, which is what the save+enable card renders as "already authorized".\nThe classification moves into `split_manifest_trust`, which returns both lists\nempty with no gate — the same answer the sibling `approval_preauthorize_flow`\nalready gives for the identical condition, and the one the RPC schema already\ndocumented for the field. Extracting it also makes both branches testable\nwithout the process-global `OnceLock` gate.\n\n`flows_get_tool_contract`'s `<TOOLKIT>_<ACTION>` guard was unreachable for any\nnon-empty slug: `toolkit_from_slug` falls back to the whole string when there is\nno `_`, so `nodashhere` resolved to a toolkit and failed later with an unrelated\n"could not fetch the live Composio catalog" message, after taking a per-toolkit\nfetch lock and attempting a round trip. `toolkit_for_contract_slug` checks the\nshape first — non-empty segments either side of the first `_` — and the error\nnames the caller's own slug rather than the trimmed one. The vendored\n`toolkit_from_slug` is left permissive on purpose: `compute_required_connections`\nmaps toolkit-ish tokens and wants the whole string back, so the stricter rule\nbelongs to these controllers.\n\nThe agent's `get_tool_contract` tool carried a verbatim copy of the same guard,\nwhere it was fully dead — the tool rejects an empty slug before reaching it — and\nwhere the fall-through was more damaging, since the catalog error tells the model\nto retry a fetch that can never succeed. It now calls the same helper, which is\nwhat its RPC twin's docstring already claimed ("the same core as the agent's\nget_tool_contract tool").\n\nCloses #6071\nCloses #6072\n
Shanu committed 2 months ago
b9cfafc
fix(scripts): evaluate the cfg predicate instead of matching the feature name\n\nCodex and CodeRabbit found this independently, and they are right. Matching\n`feature = "x"` anywhere inside a `#[cfg(...)]` accepted two predicates that do\nnot require the feature, and the first is wrong in the most dangerous\ndirection:\n\n #[cfg(not(feature = "e2e-test-support"))] compiles when it is OFF\n #[cfg(any(feature = "e2e-test-support", unix))] compiles on unix regardless\n\nEither would have let a namespace that is always present be accepted as always\nabsent, and its controllers would have left the denominator in silence — the\nexact outcome this check exists to prevent.\n\nReplaced with a small recursive-descent parser over the predicate and an\nimplication test that is conservative by construction: it answers "no" whenever\nit cannot prove "yes". `all(...)` is proved by any one child requiring the\nfeature; `any(...)` only if every branch does; `not(...)` and anything\nunrecognised prove nothing.\n\nAttributes are now collected by matching brackets backwards from the `mod`\ndeclaration rather than by reading one line, so a predicate split across lines\nis one attribute rather than a fragment that parses to nothing, and a doc\ncomment between the attribute and the item no longer hides it.\n\nNine cases cover the semantics — four predicates that must be rejected, five\nthat must still be accepted, including the multi-line and doc-comment forms.\n\nAlso, per CodeRabbit: the fixture now writes `test_support/mod.rs` with\n`mod schemas;`, so every test drives a faithful module tree and the gate is\nfound on a grandparent declaration the way it is in the real source.\n
Shanu committed 2 months ago
4ec25ef
fix(scripts): check an exclusion against the #[cfg] it claims, not just the feature\n\nCodex, second round. Every check so far could pass while the Rust gate that\nmade a namespace unreachable was deleted: the feature is still declared, still\ndisabled, the namespace is still discovered and still absent from MODULES — but\nits module compiles unconditionally now and its controllers dispatch. The\nexclusion is a claim about the source, so it is checked against the source.\n\n`moduleGatesFor` walks the chain of `mod` declarations that must compile for a\ndeclaring file to exist and collects their `#[cfg(feature = …)]` gates. Every\nfile declaring an excluded namespace must sit behind one naming the claimed\ngate. The walk climbs because `#[cfg]` lives on the declaration in the PARENT,\nnever in the file itself: `test_support/schemas.rs` is reached through\n`mod schemas;` and then `pub mod test_support;`, and only the second is gated.\n\n`collectSchemaMethods` now also returns which file declared each namespace,\nwhich is what makes that check possible.\n\nTwo cases the walk has to get right, both tested: a gate on a grandparent\ndeclaration with an ungated `mod` in between (the arrangement\n`src/openhuman/test_support/` actually has), and a namespace declared in\n`mod.rs` itself — that file IS its directory's module, so its declaration sits\none level further up under the directory's name, and resolving it like an\nordinary file would look for `mod mod;`, find nothing, and report a gated\nmodule as ungated.\n
Shanu committed 2 months ago
d5ddb64