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(agent): reconcile delegation tools without owning the tools Arc\n\n`refresh_delegation_tools` reconciled `tool_specs` unconditionally but\ncould only reconcile the executable instances when `Arc::get_mut` on\n`self.tools` succeeded. Any reader holding a clone — an in-flight turn,\na spawned sub-agent's `ParentExecutionContext` — made that fail, and the\nrefresh published the new schema anyway while dropping the freshly\nsynthesised tools on the floor. The provider was then advertised a\n`delegate_*` tool that was registered in no tool set, so the model called\nit and got an unknown tool. Symmetrically, a revoked toolkit's delegate\nstayed executable after its spec was withdrawn.\n\nHold the synthesised delegation tools in their own `Agent::synthesized_tools`\nArc and replace it wholesale on every refresh. `collect_orchestrator_tools`\nrebuilds the whole set from the current connection set, so there is nothing\nto retain and no ownership to acquire — reconciliation cannot fail, and the\nschema and the executable surface can no longer drift apart. Readers holding\nthe previous Arc keep a coherent set for the rest of their turn; the\nsuperseded instances are freed once the last one drops.\n\nDispatch now carries both sets, synthesised first so the harness's\nfirst-wins name de-duplication prefers a fresh instance. This mirrors what\nthe channel path already does with its per-turn `extra_tools`.\n\nFollow-on simplifications, all consequences of the above:\n\n- `pending_synthesized_tools_mask` is deleted. It existed only to track\n instances a failed reconcile could not remove.\n- The `bool` return had no reachable `false` left, so it becomes `()` and\n the dead rollback in `refresh_delegation_tools_from_cached_integrations`\n goes with it. This is a signature change on a `pub` method; nothing\n outside `src/` calls it.\n- The tool-policy session and the system prompt's tool catalogue now read\n both sets via `Agent::all_tool_refs`, or a delegate the model can see and\n call would carry no policy decision and be missing from the catalogue.\n `ToolPolicyEngine::build_session` and `PromptTool::from_tools` keep their\n signatures; the borrowed-slice variants are additive.\n- `ParentExecutionContext.all_tools` deliberately stays the durable\n registry: a sub-agent must never be handed a delegate tool (#4452), so\n excluding them beats including them and stripping them at registration.\n\nNote the issue's title is not what was happening: on the shared path\n`self.tools` was never mutated, so nothing accumulated across turns. The\nstale-instance count was steady-state, and the real fault was the\ndivergence the log's own `tools_reconciled=false` reported.\n\nCloses #6145\n
Shanu committed 2 months ago
e57ccea
feat(tools): export the DNS-checking URL guard
oxoxDev committed 2 months ago
1b7fae5
chore(release): v0.63.23 [skip ci]
github-actions[bot] committed 2 months ago
0a2aeb0
chore(release): v0.63.23 [skip ci]\n
github-actions[bot] committed 2 months ago
7d58611
fix(config): make the autonomy allowlist widening visible, and stop promising otherwise\n\nA hand-written `config.toml` with a deliberately narrow\n`autonomy.allowed_commands` is silently widened by 28 commands on first launch,\nfive of which mutate the filesystem (`mkdir`, `touch`, `cp`, `mv`, `ln`). The\nfile on disk still shows the narrow list, so nothing surfaces it.\n\n`schema_version` is `#[serde(default)]`, so a file without the field loads as\nversion 0 and `run_pending` runs the whole 0->10 chain — including the v3->v4\n`expand_autonomy_defaults` migration — against a config that was never at v3.\nA config this code writes is already stamped `CURRENT_SCHEMA_VERSION` on\ncreation (`schema/load/impl_load.rs:491`), so the fresh-install path is fine.\nThe hand-written one is the gap.\n\nThis does NOT change the migration's behaviour, deliberately. Deciding whether\na v0 config carrying an explicit allowlist should migrate at all is a product\nruling: an additive merge has no record of the v3 default, so it cannot\ndistinguish "absent because the user removed it" from "absent because it\npost-dates this config", and both answers break somebody. What this does is\nstop the situation being invisible and stop the code claiming otherwise.\n\n1. The module doc promised removals were "fully preserved". That is false in\n the one direction that matters for an allowlist, and it is what makes the\n code read as safe. Corrected, with the v0 mechanism spelled out and the\n `schema_version` opt-out named.\n\n2. The widening was logged at DEBUG — invisible at a default log level, and\n invisible on disk. Now WARN, naming the commands added, and only when the\n list being widened was non-empty: an empty list never expressed an opinion,\n a non-empty one is a list somebody chose.\n\n3. Two tests for the case nothing covered. Existing tests start at v3 (a real\n migration) or a fresh install (already stamped); neither is what a user\n hits. One pins today's behaviour so a future ruling must walk past it; the\n other proves setting `schema_version` is a working opt-out.\n\nFault-injected: neutering the merge fails the new test at mod_tests.rs:538.\nRestored; `config::migrations` green, 105 passed.\n
M3gA-Mind committed 2 months ago
d8921b2