The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
chore: remove prompt-budget ratchet from CI and codebase
Steven Enamakelabc5cd0859e5
diff --git a/.github/ci-paths-filter.yml b/.github/ci-paths-filter.ymlindex c87d43ccb7..187af8ca4c 100644--- a/.github/ci-paths-filter.yml+++ b/.github/ci-paths-filter.yml@@ -54,11 +54,6 @@ rust-core:# entry, resolved to `["rust-tauri"]` alone, skipping every lane# that would have compiled the family it enabled.- 'scripts/ci/product-features.*'- # The prompt-budget ratchet runs in rust-quality; editing its- # limits or the script must arm the lane that checks them.- - 'scripts/prompt-budget.limits'- - 'scripts/check-prompt-budget.sh'- - 'scripts/prompt-size-measure.sh'# The feature-gate smoke owns the dependency-floor ratchet. Its# limits and measurement logic must arm that lane themselves.- 'scripts/kernel-floor.limits'diff --git a/.github/workflows/ci-lite.yml b/.github/workflows/ci-lite.ymlindex 0a446ee28e..900f7816ae 100644--- a/.github/workflows/ci-lite.yml+++ b/.github/workflows/ci-lite.yml@@ -349,23 +349,6 @@ jobs:if: ${{ !cancelled() && needs.changes.outputs['rust-tauri'] == 'true' }}run: bash scripts/ci-cancel-aware.sh cargo clippy --manifest-path crates/openhuman-app/Cargo.toml -- -D warnings- # LAST on purpose. A failing step halts its job, so every step after it- # reports SKIPPED rather than running. This guard went red between- # 2026-09-21T21:26Z and 22:24Z (#6423) and from then on skipped the five- # steps that used to sit behind it on every Rust-touching PR -- including- # `cargo test -p openhuman-embed` and `cargo test -p openhuman-tinyhumans`,- # which are test suites, not lints. Keeping this step last means a budget- # overrun can never conceal a lint or a test suite again. It is NOT- # suppressed: the step still runs, still fails, the job still goes red and- # `PR CI Gate` still blocks the PR.- #- # It builds openhuman-core with the product feature set from- # scripts/ci/product-features.sh, the same set the clippy steps above use.- - name: Guard — the fixed prompt prefix may not grow- id: prompt_budget- if: ${{ !cancelled() && needs.changes.outputs['rust-core'] == 'true' }}- run: bash scripts/ci-cancel-aware.sh bash scripts/check-prompt-budget.sh --verbose-# Report every check's own outcome (#6451).## `skipped` and `success` are easy to conflate when scanning a job: adiff --git a/crates/openhuman-core/src/agent/debug/prompt_size.rs b/crates/openhuman-core/src/agent/debug/prompt_size.rsindex c7e70ff8f2..d7bc5449fe 100644--- a/crates/openhuman-core/src/agent/debug/prompt_size.rs+++ b/crates/openhuman-core/src/agent/debug/prompt_size.rs@@ -22,9 +22,9 @@//! # Bytes, not tokens, are the unit of record//!//! Token counts depend on the tokenizer, which depends on the model, which is-//! a per-session choice. Bytes are exact and reproducible on any host, so the-//! CI ratchet (`scripts/check-prompt-budget.sh`) works on bytes and this report-//! prints an estimate alongside them purely as a reading aid. Do not tighten+//! a per-session choice. Bytes are exact and reproducible on any host, so this+//! report records bytes and prints an estimate alongside them purely as a+//! reading aid. Do not tighten//! [`EST_BYTES_PER_TOKEN`] into a claim of accuracy — it is a divisor, not a//! tokenizer.diff --git a/crates/openhuman-core/src/agent/prompts/builder.rs b/crates/openhuman-core/src/agent/prompts/builder.rsindex 3590f963ae..7bee0b58e9 100644--- a/crates/openhuman-core/src/agent/prompts/builder.rs+++ b/crates/openhuman-core/src/agent/prompts/builder.rs@@ -343,9 +343,8 @@ impl SystemPromptBuilder {/// single `MEMORY.md` write invalidated all of them.////// It does not change the prompt's **size**: the same sections render the- /// same bytes, in a different order. `scripts/prompt-budget.limits` should- /// therefore not move when this lands, and if it does, something else- /// changed too.+ /// same bytes, in a different order (`scripts/prompt-report.sh` shows the+ /// per-agent totals).pub fn build_tiered(&self, ctx: &PromptContext<'_>) -> Result<TieredPrompt> {// Render each section once and bucket its parts by tier. A section// usually yields one part in its own tier; a dynamic builder thatdiff --git a/scripts/README.md b/scripts/README.mdindex ffa97a1552..be3c4aa507 100644--- a/scripts/README.md+++ b/scripts/README.md@@ -59,8 +59,7 @@ above.prompts, skills) distinct from the `debug/` runner directory.- **`check-*`** (outside `ci/`) — repo-level gates: `check-coverage-matrix.mjs`,`check-domain-e2e-coverage.mjs`, `check-pr-checklist.mjs`,- `check-kernel-floor.sh` (dependency-floor ratchet), `check-prompt-budget.sh`- (fixed-prefix byte ratchet, run in CI by `rust-quality`), `check-linux-tls-dependencies.sh`.+ `check-kernel-floor.sh` (dependency-floor ratchet), `check-linux-tls-dependencies.sh`.- **`i18n-*`** — translation coverage and audit tools (`i18n-coverage.ts`,`i18n-find-english.ts`, `i18n-react-audit.ts`, behind `pnpm i18n:*`);`i18n-doc-scan.sh` scans the Chinese GitBook docs instead of the app.diff --git a/scripts/__tests__/self-hosted-lanes.test.mjs b/scripts/__tests__/self-hosted-lanes.test.mjsindex 80694e9e66..8fb6ab726a 100644--- a/scripts/__tests__/self-hosted-lanes.test.mjs+++ b/scripts/__tests__/self-hosted-lanes.test.mjs@@ -165,7 +165,6 @@ test("every ci-lite check the lanes claim to carry is still a ci-lite check", ()"cargo clippy -p openhuman-embed --all-targets -- -D warnings","cargo check -p openhuman-embed --no-default-features","cargo clippy -p openhuman-tinyhumans --all-targets -- -D warnings",- "bash scripts/check-prompt-budget.sh --verbose","bash scripts/check-kernel-floor.sh --verbose","bash scripts/ci/check-dep-sim-calibration.sh","cargo clippy --manifest-path crates/openhuman-app/Cargo.toml -- -D warnings",diff --git a/scripts/check-prompt-budget.sh b/scripts/check-prompt-budget.shdeleted file mode 100755index 5ea949cd53..0000000000--- a/scripts/check-prompt-budget.sh+++ /dev/null@@ -1,241 +0,0 @@-#!/usr/bin/env bash-# Enforce the fixed-prefix ratchet declared in `scripts/prompt-budget.limits`.-#-# Every turn ships a system prompt plus the schemas of every advertised tool,-# before the user has said anything. On this codebase that prefix reached ~37k-# tokens for the orchestrator, ~44k of which was tool schema that nothing in the-# repo measured — the whole of the prior discussion had been about prose,-# because prose was the half that was visible. This lane is the number.-#-# Like `check-kernel-floor.sh`, the ratchet only goes DOWN: it fails on growth,-# and it fails when a profile comes in *under* its limit by more than a slack-# margin without the limit being lowered, because a saving nobody ratchets is a-# saving that silently grows back.-#-# Usage: scripts/check-prompt-budget.sh [--verbose] [--write]-#-# --write Rewrite the limits file's numbers to the measured values. For-# landing a deliberate reduction; never run it to make CI green.-#-# Two entry shapes, both ratchets:-# <agent>:<max prompt bytes>:<max tool-schema bytes>-# tool:<name>:<max bytes> - one tool's own schema-#-# The per-tool ratchet exists because the per-agent number hides its own-# causes: `workflow_builder` sat at 33,948 B with a single tool accounting for-# 7,415 of it. A tool over TOOL_ATTENTION_BYTES must be recorded in the limits-# file, so growth in one schema cannot hide inside an agent total that is still-# under its own limit.-set -euo pipefail--cd "$(dirname "${BASH_SOURCE[0]}")/.."--LIMITS="scripts/prompt-budget.limits"-VERBOSE=0-WRITE=0-for arg in "$@"; do- case "$arg" in- --verbose) VERBOSE=1 ;;- --write) WRITE=1 ;;- *) echo "unknown flag: $arg" >&2; exit 64 ;;- esac-done--# Slack in bytes, per measured field.-#-# Prompt text moves by a few bytes for reasons nobody should have to ratchet —-# a typo fix, a renamed heading. Tool schemas do not move at all unless a schema-# changed. 512 absorbs ordinary copy-editing (~128 tokens) while still forcing a-# ratchet update for any real reduction, which starts in the thousands.-SLACK=512--# The size at which one tool's schema is worth an explicit decision.-#-# 1,600 bytes is ~400 tokens, the point at which a schema costs more than most-# prose sections of the system prompt. Crossing it is not a bug; crossing it-# without anyone noticing is. A tool above this line must appear in the limits-# file, which is where the reason goes.-#-# Deliberately a ratchet rather than a hard cap. A cap failing above ~800-# tokens would reject `memory` (3,788 B) and `cron` (3,228 B), which are that-# size precisely because they replaced families of eleven and six - the-# consolidation this budget exists to encourage. What matters is that a number-# moves and someone looks, not that every tool fits one shape.-TOOL_ATTENTION_BYTES=1600--# The measurement must not depend on who is logged in.-#-# `prompt-size` renders through the real session path, which injects the-# workspace's PROFILE.md / MEMORY.md / AGENTS.md and fetches live Composio-# connections. Run against a developer's own workspace the numbers move with-# their memory tree, which would make this lane fail for reasons unrelated to-# any change. A fresh empty workspace is the only reproducible baseline; it also-# means `integrations_agent` has no connected toolkit and is skipped, which is-# correct — its size is a property of the user's account, not of this repo.-cleanup() { rm -f "${TOOL_LOOKUP:-}" "${TOOL_OVERSIZE:-}"; }-trap cleanup EXIT--# `--hermetic` isolates config and workspace but not HOME: skill discovery still-# scans ~/.openhuman/skills and ~/.agents/skills, so one installed skill added-# 515 B of `## Installed Skills` to the orchestrator on a dev machine and a-# `--write` there baked it into the limits. An empty HOME matches CI.-# OPENHUMAN_HOME is dropped too: the agent-definition loader prefers it-# over ~/.openhuman.-if ! measured="$(bash scripts/prompt-size-measure.sh)"; then- echo "::error::prompt-size failed to measure" >&2- exit 1-fi--# Helper python written to temp files rather than inline heredocs: a heredoc-# inside the `while read` loop would consume the loop's own stdin.-TOOL_LOOKUP="$(mktemp)"-TOOL_OVERSIZE="$(mktemp)"-cat > "$TOOL_LOOKUP" <<'PYLOOKUP'-import json, os, sys-d = json.loads(sys.argv[1])-tool = os.environ["TOOL"]-for agent in d["agents"]:- for t in agent["tools"]:- if t["name"] == tool:- print(t["bytes"])- sys.exit(0)-sys.exit(f"tool '{tool}' is in prompt-budget.limits but no agent advertises it - "- f"was it renamed, removed or deferred? Drop the line if so.")-PYLOOKUP-cat > "$TOOL_OVERSIZE" <<'PYOVER'-import json, os, sys-d = json.loads(sys.argv[1])-listed = set(filter(None, os.environ["LISTED"].split()))-threshold = int(os.environ["THRESHOLD"])-seen = {}-for agent in d["agents"]:- for t in agent["tools"]:- seen[t["name"]] = t["bytes"]-for name, size in sorted(- ((n, b) for n, b in seen.items() if b > threshold and n not in listed),- key=lambda kv: -kv[1],-):- print(f"{name} {size}")-PYOVER--status=0-declare -a NEW_LINES=()--while IFS= read -r raw; do- line="${raw%%#*}"- line="$(echo "$line" | tr -d '[:space:]')"- if [[ -z "$line" ]]; then- NEW_LINES+=("$raw")- continue- fi-- IFS=: read -r first second third extra <<< "$line"- if [[ -n "${extra:-}" || -z "$first" || -z "$second" || -z "$third" ]]; then- echo "::error::invalid prompt-budget limit entry: '$line'" >&2- exit 1- fi-- if [[ "$first" == "tool" ]]; then- tool_name="$second"- max_tool="$third"- if ! measured_bytes="$(TOOL="$tool_name" python3 "$TOOL_LOOKUP" "$measured")"; then- status=1- NEW_LINES+=("$raw")- continue- fi- if (( VERBOSE )); then echo "tool $tool_name $measured_bytes/$max_tool"; fi- if (( measured_bytes > max_tool )); then- echo "::error::tool schema REGRESSED: '$tool_name' is $measured_bytes B, limit is" \- "$max_tool. Every agent holding it pays this on every turn." >&2- status=1- elif (( max_tool - measured_bytes > SLACK )); then- echo "::error::tool schema IMPROVED but was not ratcheted: '$tool_name' is" \- "$measured_bytes B against a limit of $max_tool. Lower it in this PR." >&2- status=1- fi- NEW_LINES+=("tool:$tool_name:$measured_bytes")- continue- fi-- agent="$first"- max_prompt="$second"- max_tools="$third"-- if ! read -r prompt_bytes tool_bytes tool_count max_tool_bytes max_tool_name <<< "$(- AGENT="$agent" python3 - "$measured" <<'PY'-import json, os, sys-d = json.loads(sys.argv[1])-agent = os.environ["AGENT"]-for r in d["agents"]:- if r["agent"] == agent and r.get("toolkit") is None:- worst = max(r["tools"], key=lambda t: t["bytes"], default=None)- print(r["prompt_bytes"], r["tool_bytes"], r["tool_count"],- worst["bytes"] if worst else 0, worst["name"] if worst else "-")- break-else:- sys.exit(f"agent '{agent}' is in {os.path.basename('prompt-budget.limits')} "- f"but was not measured — was it renamed or removed?")-PY- )"; then- status=1- NEW_LINES+=("$raw")- continue- fi-- (( VERBOSE )) && echo "$agent prompt=$prompt_bytes/$max_prompt tools=$tool_bytes/$max_tools ($tool_count tools, worst $max_tool_name $max_tool_bytes B)"-- if (( prompt_bytes > max_prompt )); then- echo "::error::prompt budget REGRESSED: '$agent' renders $prompt_bytes B of" \- "system prompt, limit is $max_prompt. Every turn pays this." >&2- status=1- elif (( max_prompt - prompt_bytes > SLACK )); then- echo "::error::prompt budget IMPROVED but was not ratcheted: '$agent' renders" \- "$prompt_bytes B, limit is still $max_prompt. Lower it in this PR" \- "(scripts/check-prompt-budget.sh --write) or the saving grows back." >&2- status=1- fi-- if (( tool_bytes > max_tools )); then- echo "::error::tool-schema budget REGRESSED: '$agent' advertises $tool_count" \- "tools worth $tool_bytes B, limit is $max_tools. Consider deferring the" \- "tool rather than trimming its description." >&2- status=1- elif (( max_tools - tool_bytes > SLACK )); then- echo "::error::tool-schema budget IMPROVED but was not ratcheted: '$agent' is" \- "at $tool_bytes B against a limit of $max_tools. Lower it in this PR." >&2- status=1- fi-- NEW_LINES+=("$agent:$prompt_bytes:$tool_bytes")-done < "$LIMITS"--# Any tool over the attention threshold must be recorded above. Checked after-# the loop so the message names every offender at once rather than failing on-# the first.-listed_tools="$(grep -oE '^tool:[^:]+' "$LIMITS" | cut -d: -f2 | sort -u || true)"-unlisted="$(LISTED="$listed_tools" THRESHOLD="$TOOL_ATTENTION_BYTES" \- python3 "$TOOL_OVERSIZE" "$measured")"-while read -r name size; do- [[ -z "$name" ]] && continue- if (( WRITE )); then- NEW_LINES+=("tool:$name:$size")- echo "[prompt-budget] recording tool:$name:$size" >&2- else- echo "::error::'$name' is $size B, over the $TOOL_ATTENTION_BYTES B attention" \- "threshold, and is not in $LIMITS. Add 'tool:$name:$size' with a comment" \- "saying why it needs that much, or trim it." >&2- status=1- fi-done <<< "$unlisted"--if (( WRITE )); then- printf '%s\n' "${NEW_LINES[@]}" > "$LIMITS.tmp"- mv "$LIMITS.tmp" "$LIMITS"- echo "[prompt-budget] rewrote $LIMITS to measured values" >&2- exit 0-fi--if (( status == 0 )); then- echo "[prompt-budget] OK — every agent is within its limit" >&2-fi-exit "$status"diff --git a/scripts/ci/self-hosted/lanes-plan.mjs b/scripts/ci/self-hosted/lanes-plan.mjsindex 4e7f0afc9c..94cadbf2ad 100644--- a/scripts/ci/self-hosted/lanes-plan.mjs+++ b/scripts/ci/self-hosted/lanes-plan.mjs@@ -349,11 +349,6 @@ export function buildPlan({ profile, areas, env = {}, isPullRequest = true }) {when: core,run: "cargo clippy -p openhuman-tinyhumans --all-targets -- -D warnings",},- {- name: "prompt-budget",- when: core,- run: "bash scripts/check-prompt-budget.sh --verbose",- },],},{diff --git a/scripts/prompt-budget.limits b/scripts/prompt-budget.limitsdeleted file mode 100644index dcb196d79d..0000000000--- a/scripts/prompt-budget.limits+++ /dev/null@@ -1,353 +0,0 @@-# Fixed-prefix ratchet. `scripts/check-prompt-budget.sh` fails when an agent-# exceeds its limit here.-#-# Format: <agent id>:<max system-prompt bytes>:<max advertised tool-schema bytes>-#-# The two halves are separate on purpose. Prompt bytes are prose somebody wrote-# and can rewrite; tool bytes are schemas, and the fix for those is almost never-# "trim the description" — it is to defer the tool, collapse a family of verbs-# into one tool, or move the capability into a skill.-#-# Measured with `--hermetic`, which relocates BOTH the workspace and-# `config_path` into a temp dir. Overriding the workspace alone is not enough-# and the first version of this file got it wrong: credentials, auth profiles-# and integration toggles resolve against `config_path`'s parent, so a-# workspace-only override still read `~/.openhuman`. Roughly twenty-# backend-proxied tools (`google_places_*`, `stock_*`, `storage_*`,-# `twilio_call`, `composio_*`, `tinyfish_*`) all sit behind a single-# `if let Some(client) = integrations::build_client(..)`, so the whole block-# appeared or vanished depending on whether the developer happened to be signed-# in — a 12 KB swing that looked exactly like a code change. `openhuman/CLAUDE.md`-# documents this trap under "config_path is not cosmetic"; this file walked into-# it anyway, which is why the numbers below were re-recorded.-#-# Consequence worth knowing: this ratchet measures a SIGNED-OUT install, so it-# cannot see savings on tools that only register when a backend client exists.-# Deferring the five `stock_*` tools, for instance, is real but invisible here.-# Judge integration-tool work with `prompt-size` against a signed-in workspace-# and record the finding in a PR body, not in this file.-#-# Moving prose into a SKILL trades prompt bytes for tool bytes, and the trade is-# only worth recording if both halves are. `workflow_builder` gave up 21,445 B-# of standing prompt when its reference manual became the `flow-authoring`-# builtin skill, and took on 556 B for `read_workflow_resource` — the tool that-# reads a page. Net -20,889 B per turn. The other agents pay ~14 B for the-# mechanism (`skill_search` joined the withheld `skills` pack, which lengthened-# `load_skill`/`use_skill`'s summary) and the orchestrator 97 B for the sentence-# that tells it search exists.-#-# Two things that made the first attempt worse rather than better, both caught-# by numbers here rather than by review:-#-# * `read_workflow_resource` sat in the withheld `skills` pack, so naming it-# on the builder's belt advertised `load_skill` + `use_skill` (3,137 B)-# INSTEAD of the tool (556 B), and put a round trip in front of every read.-# Adding `workflow_builder` to that pack's `owners` fixed it and widened-# nothing — its belt is `Named`, so no other pack member is visible to it.-# * `skill_search` was registered outside any pack, costing 748 B on every-# wildcard agent to produce a skill id those agents could not act on,-# because `describe_workflow` and `run_skill` were still withheld. A-# doorway to a locked room. It belongs in the pack with them.-#-# A FALLING tool-byte count is not automatically good. Collapsing the memory,-# todo and cron families showed both failure modes in one afternoon:-#-# * Nine agents named the legacy tools in their `[tools] named` belts. Hiding-# those tools dropped the count on every one of them — and `scheduler_agent`-# was left with no scheduler tool at all. The ratchet reported that as an-# improvement.-# * Migrating a NARROW belt onto a collapsed tool makes it bigger and wider:-# `flow_memory_agent`'s three read-only memory tools (2,396 B) became the-# whole `memory` tool (3,788 B), handing an agent documented as read-only-# the `store` and `forget` actions its belt existed to withhold.-#-# So per-tool exposure now applies only to a wildcard belt (see-# `AgentBuilder::build`), and a drop here should be read alongside the agent's-# tool LIST, which `prompt-size --json` carries in full. Fewer bytes and fewer-# capabilities look identical in this file.-#-# The ratchet only goes DOWN. Lowering a number is the point; the check fails-# both on growth and on an un-ratcheted improvement, because a saving nobody-# writes back is a saving that grows back. Use-# `scripts/check-prompt-budget.sh --write` to record a deliberate reduction.-#-# `integrations_agent` is absent by construction: it is parameterised by a-# connected Composio toolkit and renders nothing on an empty workspace.-#-# A prompt REGRESSION can be the right trade, and one is recorded below. The-# orchestrator's prompt grew 168 B to say that specialists are now reached with-# `delegate_to { agent: "..." }` rather than as tools of their own. Without-# those two sentences the model calls `ask_docs` and gets "unknown tool" — the-# routing table in `## Delegation` names the specialists, and the names stopped-# being tool names. 168 B of prose bought 13,332 B of schema. The ratchet is-# there to make a trade like that visible and deliberate, not to forbid it.-#-# Measure with: openhuman-core agent prompt-size --workspace <empty dir> --json-#-# History-# 2026-08-31 Baseline, recorded the day the measurement first existed.-# Fleet total 1,073,644 B (~268k tokens of fixed prefix across 33-# agents). Three things in this table are worth reading as bugs-# rather than as facts:-#-# * `morning_briefing`, `trigger_triage`, `summarizer` and-# `tools_agent` each advertise 151 tools / 104,567 B (~26k-# tokens). They declare no `[tools] named` belt, so they inherit-# the whole registry. `summarizer` exists to compress text and-# carries 151 tool schemas to do it.-# * `workflow_builder` renders 80,353 B (~20k tokens) of system-# prompt — more than twice the orchestrator's — because the flow-# DSL reference is inlined in its `prompt.md`. That body belongs-# in a SKILL.md.-# * the orchestrator's 45,199 B across 50 tools is dominated by a-# handful of schemas; `propose_workflow` alone was 7,568 B when-# this was first measured.-#-# Every one of those was invisible until this file existed.-#-# 2026-09-01 The archetype delegates collapsed into one `delegate_to` tool.-# Orchestrator tools 43,153 -> 29,821 B (46 -> 30 tools); fleet-# total 934,265 -> 921,351 B.-#-# The cause is worth recording because it was not a big schema,-# it was a small one repeated: `ArchetypeDelegationTool::-# parameters_schema` is a `json!` literal that never reads-# `self`, so all 16 synthesised delegates carried a byte-identical-# delegation envelope. 17,746 B — 41% of the orchestrator's whole-# tool budget — was one object, sixteen times. The per-agent-# number could not show that: every individual tool sat under the-# 1,600 B attention threshold, so nothing in this file flagged-# them. **A family of near-identical schemas hides from both-# ratchets.** When the next one is looked for, group by schema-# body, not by size.-#-# Two regressions this introduced, both caught by measurement-# rather than review, and both now pinned by tests:-#-# * The first version made tools go UP, 43,153 -> 52,513. The-# members were marked `ToolExposure::Hidden`, but exposure is-# only applied to a WILDCARD belt, and the orchestrator's belt-# is `Named` — with every synthesised name force-inserted into-# it by `factory.rs` and again by `refresh_delegation_tools`.-# Both surfaces shipped. Hiding is now filtered at those two-# insertion points, which is the correct place: those names-# were never chosen by a human, so skipping one takes nothing-# an author asked for.-# * The collapse then silently RE-ADVERTISED seven routes the-# pack table withholds (`do_crypto`, `setup_mcp_server`,-# `use_mcp_server`, `setup_skills`, `run_skill`,-# `build_workflow`, `discover_workflows`). Each stopped being a-# tool of its own, so `strip_packed_from_visible` had nothing-# to remove, and it reappeared as a string inside another-# tool's schema where no visible-set subtraction reaches it.-# `toolpacks::is_withheld_from` now filters the enum.-# **A collapse must never widen what a pack narrowed** — check-# it whenever a surface moves from "a tool" to "a value".-#-# 2026-09-01 `named = []` now means zero tools. Fleet 921,327 -> 751,657 B.-#-# `summarizer` and `trigger_triage` each declare an empty named-# scope in their shipped `agent.toml`, and each was handed the-# ENTIRE registry — 109 tools, 82,986 B of schema — because an-# empty visible set is the harness's "no filter" sentinel. The-# declaration was not ignored, it was inverted. 165,972 B, 18% of-# the fleet's fixed prefix, on the two agents that asked for none.-#-# `trigger_triage`'s own comment says local 1B-class models are-# unreliable at nested tool calls, "so we keep the turn flat" — so-# this was not merely waste, it was working against the thing the-# author had written down. That is the general lesson: **this file-# cannot tell a large number from a wrong one.** Both agents sat-# at the top of the table from the day it was created, and the-# baseline note called them out as a bug in the wrong terms —-# "they declare no `[tools]` belt" — when in fact they declare an-# empty one, which is the opposite problem and a much cheaper fix.-# Read a definition, not just a row.-#-# `NO_TOOLS_SENTINEL` spells the empty belt so it survives a set-# whose empty state was already spoken for. It replaced a literal-# that existed twice, once with a comment saying it was a verbatim-# copy.-#-# Also trimmed 606 B from the orchestrator's "Running several-# workers at once" section, and fixed a bug it was hiding. Two of-# its four paragraphs restated `spawn_async_subagent`'s own-# description ("Fire-and-forget ... Returns immediately ... never-# use it for ... anything whose result must gate your final-# answer") in the prompt, where it is billed on every turn whether-# or not the tool is used. The schema is the better home: it is-# already paid for, and it cannot drift from the tool.-#-# The bug: the section told the model to call-# `spawn_async_subagent` with `blocking: true`. **That parameter-# does not exist on that tool** — its properties are agent_id,-# context, fresh, model, prompt, task_key, task_title, toolkit.-# `blocking` is on `delegate_to`. So the one hard rule about-# result-gating pointed at an impossible call, and the same-# section opened by asserting the tool is "always async ... you do-# not wait for it", contradicting its own closing paragraph.-#-# Worth noting how it was found: not by reading the prompt, but by-# reading the prompt NEXT TO the tool schemas, which is what-# `dump-prompt --wire` exists to make easy. A contradiction between-# a prompt and a schema is invisible while the two live in-# different files.-#-# The six bullets stay. They are identity and recovery rules that-# appear in no schema — track by `subagent_session_id` because-# `agentId` is only the worker type; `[active_subagents]` over-# recollection; `list_subagents` as the recovery move; and-# `continue_subagent` for an `awaiting_user` worker, which is the-# prose half of the #4291 infinite-re-delegation fix that-# `toolpacks::registry` cites as its reason for never packing the-# fleet tools. Deleting the section wholesale would have removed-# a known bug's fix along with the redundancy.-#-# 2026-09-19 Re-measured after the coordinated vendor refresh. The updated-# agent/tool contracts make the pack proxy reachable on several-# narrow belts and expand the planner, profile-memory and trigger-# instructions; those are intentional upstream surfaces, not-# duplicated local prose. The same refresh removes 8,662 B of-# wildcard schemas from morning_briefing and tools_agent, and-# those savings are ratcheted here at the same time.-#-# 2026-09-19 Re-measured after merging the agent-runtime migration from-# upstream/main. The workflow builder's migrated contract adds-# 3 B to both its fixed prompt and schemas. The same migration-# removes another 838 B of wildcard schemas (and 25 B of prompt)-# from morning_briefing and tools_agent; those savings are-# ratcheted here rather than left as stale headroom.-#-# 2026-09-20 Re-measured after the fresh-turn and cost-routing changes merged-# without their generated budget update. The morning briefing's-# fixed prefix is 3 B larger; all other recorded ceilings stay put.-#-# 2026-09-22 TinyAgents 2.1.2 expands the shared `todo` tool schema from-# 860 B to 1,127 B. Ratchet the six agents that advertise it-# (and their aggregate schema budgets) to the measured values;-# unrelated prompt and schema reductions are ratcheted too.-#-# 2026-09-23 Two deliberate tool changes merged without their budget update.-# `apply_patch` now documents file creation through an empty-# `old_string` (6c5eaae53d), +246 B for every agent that has it-# (code_executor, skill_creator, orchestrator, tools_agent,-# morning_briefing). `file_write` is back in the default tool-# pack (b06e70009e), a further +507 B for orchestrator,-# tools_agent and morning_briefing. Only those five schema-# ceilings move; every other recorded value stays put.--morning_briefing:10769:60411-trigger_triage:7537:0-workflow_builder:76501:28987-summarizer:7351:0-tools_agent:5229:60411-orchestrator:9717:21760-code_executor:11455:13868-crypto_agent:10992:10454-task_manager_agent:4531:7602-planner:7829:5900-skill_creator:5464:12120-flow_discovery:8522:8285-profile_memory_agent:5515:11010-settings_agent:4721:9652-context_scout:8852:5495-skill_executor:7789:5469-scheduler_agent:7873:5144-agent_memory:8231:5423-skill_setup:5367:5693-trigger_reactor:6561:5606-mcp_agent:7147:2569-flow_memory_agent:7526:2534-tool_maker:4529:4543-presentation_agent:4791:4322-video_agent:5259:1106-help:6742:952-image_agent:5303:1106-goals_agent:5226:1191-vision_agent:5171:1106-archivist:4426:1686-researcher:5600:873-critic:4520:695--# ── Per-tool schema ratchet ──────────────────────────────────────────────-#-# One line per tool whose schema is over the attention threshold (1,600 B,-# ~400 tokens). Being here is not a fault; being here *unexamined* is. Each-# entry should be justified by the comment above it or be trimmed.-#-# Why the big ones are big, as of 2026-08-31:-#-# memory (3,788) / cron (3,340) / todo (1,831)-# Collapsed families. `memory` replaced eleven tools worth 7,879 B and-# `cron` six worth 3,938 B, so each is large *because* the surface got-# smaller. A union schema costs more than any one member and less than-# all of them. Do not "fix" these by splitting them back up.-#-# spawn_subagent (3,554) / spawn_async_subagent (1,965) /-# spawn_parallel_agents (1,851)-# The delegation surface: three tools describing overlapping arguments.-# A collapse candidate on the same argument as memory/cron/todo, and the-# next obvious one — 7,370 B between them.-#-# memory_tree (3,008) / cron_add (3,003)-# `memory_tree` dispatches eight tree operations on `mode` and is the-# one memory tool deliberately left out of the `memory` collapse.-# `cron_add` is a member of the collapsed `cron` tool and no longer-# reaches the wire itself, but is measured here because some agent still-# carries it on a hand-written belt.-#-# propose_workflow (3,170)-# Was 7,415 until its node-kind reference stopped being hand-written and-# started being generated from `node_contracts.rs`-# (`render_node_kinds_required`). What remains is this tool's own-# contract plus 401 B of generated kinds.-#-# edit_workflow (2,721) / save_workflow (1,957) / suggest_workflows (2,445)-# The rest of the flow-authoring belt. Each carries its own prose copy of-# graph-shape rules; the same generate-don't-hand-write treatment that-# shrank `propose_workflow` applies and has not been done.-#-# generate_presentation (2,662)-# A deck spec: slides, layouts, per-layout fields. Genuinely wide.-#-# delegate_to (5,302)-# The collapsed archetype delegation tool. 1,404 B of that is the shared-# envelope and the `agent` enum; the other 3,898 B is 17 specialists'-# `when_to_use` blurbs, which are the routing information itself — this-# tool is how the orchestrator picks a specialist at all.-#-# It is large because 16 tools worth 17,746 B became one. Do not "fix" it-# by splitting it back up, and do not trim the blurbs mechanically: at-# least three carry NEGATIVE boundaries that prevent mis-routing-# (`scheduler_agent`: "reading live calendar events ... belongs to the-# calendar/email integration"), and a first-sentence truncation drops-# exactly those. The real remaining duplication is with the prompt's own-# `## Delegation` routing table, which names the same specialists again-# in 7,912 B — deduplicating the two is the next saving here, and it is-# an editorial change, not a mechanical one.-#-# search_tool_catalog (1,695) / use_skill (1,620)-# Discovery tools. Both are the recovery path for a withheld surface, so-# their descriptions carry the "here is what you can still reach" copy.-#-# `memory` and `delegate_to` were dropped 2026-09-18: no agent at 93e9938f3-# advertises them (nor does the default-features registry), so the lookup below-# failed before any number was compared. The prose above describes them as they-# were on 2026-09-01. `cron` returned when the scheduler's collapsed surface was-# wired into the durable registry.-tool:spawn_subagent:3542-tool:propose_workflow:3170-tool:memory_tree:3008-tool:cron:3340-tool:edit_workflow:2721-tool:generate_presentation:2662-tool:suggest_workflows:2445-tool:spawn_async_subagent:1535-tool:save_workflow:1957-tool:spawn_parallel_agents:1839-tool:todo:1127-tool:search_tool_catalog:1695-tool:use_skill:1711-# One action-dispatched memory surface replaces the separately registered-# memory operations while keeping read/write/forget routing explicit.-tool:memory:3937diff --git a/scripts/prompt-report.sh b/scripts/prompt-report.shindex bb05886c9d..7315e1fdac 100755--- a/scripts/prompt-report.sh+++ b/scripts/prompt-report.sh@@ -3,9 +3,8 @@# schemas — one row per agent, largest first, then their sum (a size measure,# not a cost: each prefix is paid only on the turns that agent runs).#-# Report-only: nothing here fails on a number. The ratchet that does is-# `scripts/check-prompt-budget.sh`; both consume the JSON from-# `scripts/prompt-size-measure.sh`, so their setup cannot drift.+# Report-only: nothing here fails on a number. It consumes the JSON from+# `scripts/prompt-size-measure.sh`.## Usage: scripts/prompt-report.sh [--workspace <dir>]#