Skip to content

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

Commits on main

118a627
refactor(rpc): give the log envelope a single definition\n\nThe rule that decides a controller's response shape\n\n logs.is_empty() -> value (bare)\n otherwise -> { "result": value, "logs": … } (wrapped)\n\nwas written out independently in two places:\n\n * `rpc::RpcOutcome::into_cli_compatible_json` — the registry path, reached\n by 152 call sites across the domains;\n * `core::types::invocation_to_rpc_json` — the dynamic-dispatch path, live\n via `core/dispatch.rs:64` for internal and legacy methods.\n\nSix identical lines, with nothing linking them. #6080 cites only the first.\nA fix applied there alone would have left the dispatch path answering the old\nshape, and the divergence would have been invisible until a caller hit the\nwrong path.\n\nBoth now delegate to `rpc::apply_log_envelope`. Behaviour is preserved\nbyte-for-byte: this changes where the rule lives, not what it does.\n\n**#6080 stays open after this commit, deliberately.** Normalising the envelope is a wire\nchange across every controller and needs a maintainer's ruling, which the\nissue does not yet carry. The evidence for that ruling is posted on the issue:\nthe frontend peelers are defensive and tolerate either shape, no frontend code\nconsumes log *content* (all six `.logs` references are envelope discriminators\nor unrelated state), and there is no central peel — `coreRpcClient.ts:861`\nunwraps only the outer JSON-RPC `result`. What this commit buys is that when\nthe ruling lands it is a one-line change in one body instead of two.\n\nThe new test asserts the two paths **agree** for the same `(value, logs)`\npair, not that they produce a particular shape — pinning the shape would\nenshrine the defect as intended behaviour, which is the thing #6080 is about.\n\nFault injected to prove it bites: re-forked `invocation_to_rpc_json` to emit\n`payload` instead of `result`, exactly as an accidental future edit would.\n\n assertion `left == right` failed: the dispatch and registry paths\n disagreed for value={"data":true} logs=["one"]; both must go through\n rpc::apply_log_envelope\n left: Object {"logs": [...], "payload": {...}}\n right: Object {"logs": [...], "result": {...}}\n\nat `src/core/types.rs:331`. Restored: 292 passed, 0 failed.\n\nAlso drops the now-orphaned top-level `use serde_json::json;` from\n`core/types.rs` — the only non-test use of the macro moved out with the rule.\n\nRefs #6080\n
M3gA-Mind committed 2 months ago
a620e4e
fix(update): make the release endpoint injectable for tests, without making it configurable\n\n`check_available()` built `https://api.github.com/...` inline, so the HTTP and\nJSON-parse path could only ever run against the live endpoint. No test could\ntell "failed to fetch latest release" from a genuine "no update", and the call\nis subject to GitHub's unauthenticated 60/h/IP limit, so the same test could\ntake either branch on different runs. `scheduler_tests.rs` says exactly this,\nand skips testing `tick()` for that reason, naming\n`check_available_with_url(base_url)` as the refactor it wanted.\n\n`check_available()` is now a two-line wrapper over a private\n`check_available_with_base_url(base_url)`. Only the URL construction changed —\nthe transport-failure classifier, the observability branches, the non-2xx\nhandling and asset selection are untouched.\n\nPrivate, and not an env var, on purpose. #6089 asks whether an operator-supplied\nupdate endpoint should be allowed to bypass `ops::validate_download_url`'s\nGitHub host allowlist; this avoids answering that rather than answering it\nwrongly. A runtime-overridable release endpoint would be a self-update\nredirection primitive on the highest-trust path in the product. The seam is\nreachable only from the unit suite, which points it at a wiremock server.\n\nFive tests: platform asset selection against a decoy for another triple, the\nno-update branch, a 403 rate-limit response, a malformed body, and a pin that\nthe URL a shipped binary builds is byte-identical to the previous literal —\nthat last one is what breaks if someone later makes the origin configurable.\n\nCloses #6089\n\nClaude-Session: https://claude.ai/code/session_01Rx5Fzc5keoeUQB3MwMFqMM\n
M3gA-Mind committed 2 months ago
75671bd
fix(agent): keep the reserved Gmail actions read-only and harden the stub guard\n\nReview follow-ups on the delegation surface.\n\n- The essentials table no longer reserves `GMAIL_SEND_EMAIL`. Reserved\n actions are forced onto a delegation whatever it asked for, so a write\n action there handed a "read my email" task a send capability it never\n requested — and `ComposioActionTool` does not override\n `external_effect`, so the approval middleware, which gates on\n `external_effect_with_args`, would not have stopped it. Instructions\n embedded in a fetched email could act on the mailbox with no human in\n the loop. Send is unaffected for real send prompts: the ranker already\n puts it first, which `real_data_gmail_send_email` pins.\n- An unfinished run is no longer told it "is complete as returned". The\n `[SUBAGENT_INCOMPLETE]` envelope gets its own note, which says only\n that no worker exists and to re-delegate.\n- A `PreferAsync` delegation that falls back to the synchronous path\n registers no worker either, so the mode is now pinned to `Blocking`\n past the async branch and its result discloses that too.\n- The stub guard classifies a whole-text JSON payload by parsing it and\n looking for a `tool_calls` key: line-based stripping cannot tell that\n an object's inner members belong to the call rather than to an answer,\n so a pretty-printed payload used to read as a finished result. Prose\n that merely names `"tool_use"` is no longer a stub — that marker alone\n is enough to attempt a strip, never enough to conclude a sub-agent\n produced nothing.\n
Shanu committed 2 months ago
919b69e