Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions docs/spec/sidecar.md
Original file line number Diff line number Diff line change
Expand Up @@ -350,11 +350,16 @@ mark the turn's total as partial rather than presenting a smaller number
as complete. A turn that delegated nothing emits the historical payload
unchanged.

`stream.done.treeUsage` reports the whole turn tree against the request's
`budgetTokens`: `{limit, spent, byAgent}` where `byAgent` is keyed by the
caller's agent labels (`"parent"`, `"0.1"`). It is absent when the request
carried no `budgetTokens` — "no limit" stays distinguishable from "spent
nothing".
`stream.done.treeUsage` reports what the whole turn tree spent:
`{spent, byAgent}` where `byAgent` is keyed by the caller's agent labels
(`"parent"`, `"0.1"`). It is always present on a turn, because the number is
for display: there is no limit in it and none is enforced. A turn that runs
long had more work, not a failure, and stopping it partway through would
throw away what the user already paid for.

`budgetTokens` still bounds the parent run's own loop (see the loop limits
above), which is a per-run wall rather than a tree-wide gate. The two are
separate: the tree counter never compares its total against anything.

Sub-agent delegation is ON BY DEFAULT: the sidecar advertises
`delegate_subagent` and answers it with a bounded child CoreLoop running
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@steerable/monorepo",
"version": "0.12.0",
"version": "0.12.1",
"private": true,
"type": "module",
"packageManager": "pnpm@10.23.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/agent-cli/ts/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@steerable/agent-cli",
"version": "0.12.0",
"version": "0.12.1",
"description": "Product-neutral command line for a Steerable host. Products supply the bin name and brand.",
"license": "Apache-2.0",
"homepage": "https://steerableframework.com/",
Expand Down
2 changes: 1 addition & 1 deletion packages/agent-client/ts/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@steerable/agent-client",
"version": "0.12.0",
"version": "0.12.1",
"description": "In-process client for a Steerable host: HTTP-shaped requests, turn streams, and approval replies.",
"license": "Apache-2.0",
"homepage": "https://steerableframework.com/",
Expand Down
2 changes: 1 addition & 1 deletion packages/agent-harness/py/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "steerable-agent-harness"
version = "0.12.0"
version = "0.12.1"
description = "Steerable harness helpers for Python"
license = { text = "Apache-2.0" }
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion packages/agent-harness/ts/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@steerable/agent-harness",
"version": "0.12.0",
"version": "0.12.1",
"description": "Steerable framework Tier 2 \u2014 TypeScript facade over the Python harness (policy, budget, retry, completion, tracing) used for cross-language conformance tests. Production code should depend on the Python harness.",
"license": "Apache-2.0",
"homepage": "https://steerableframework.com/",
Expand Down
2 changes: 1 addition & 1 deletion packages/agent-protocol/py/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "steerable-agent-protocol"
version = "0.12.0"
version = "0.12.1"
description = "Steerable protocol schemas for Python"
license = { text = "Apache-2.0" }
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion packages/agent-protocol/ts/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@steerable/agent-protocol",
"version": "0.12.0",
"version": "0.12.1",
"description": "Steerable framework Tier 1 \u2014 wire-format types (SSEEvent, ChatMessage, ToolCall, ToolResult, AgentSession, HarnessTrace, sidecar JSON-RPC) shared by every Steerable client and server.",
"license": "Apache-2.0",
"homepage": "https://steerableframework.com/",
Expand Down
20 changes: 12 additions & 8 deletions packages/agent-runtime/py/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,18 @@ release. Nothing in the single-agent path changed.
`CREATE TABLE IF NOT EXISTS`, so an existing database upgrades in place on
first open — no migration function, no data rewrite. A database written by a
newer build still refuses to open.
- **`budgetTokens` now bounds the whole turn tree.** It used to limit each
loop separately; a parent plus three children could each spend the full
allowance. Every agent in the tree now debits one counter, and the first to
cross it fails there. A host that relied on per-child allowances gets a
tighter (correct) limit.
- **New `TreeBudget` / `SessionBudgetExceeded`** in `steerable_agent_runtime`.
`AgentPool(budget=...)` shares one counter across the pool; the parent loop's
usage is charged to the same counter by the host.
- **`budgetTokens` no longer bounds the turn tree.** It still caps the parent
run's own loop (unchanged from before the tree layer), but there is no longer
a shared tree limit: `TreeBudget` and `SessionBudgetExceeded` are gone,
replaced by `TreeSpend`, which only records.
- Why removed: a tree limit stopped a task partway through, leaving children
at `budget_exhausted` and needing a human to click resume. A turn that runs
long had more work, not a failure. Cost control belongs before a turn
starts (or on a period budget), not inside one already half done.
- What replaced it: `TreeSpend` — `record(usage, agent=...)` plus
`report() -> {spent, by_agent}` — so a host can still show what a turn cost
and which agent spent it. `AgentPool(spend=...)` shares one counter across
the pool; the parent's usage is recorded into the same counter by the host.
- **`provider_factory` for sub-agent profiles now takes `(model, effort)`**
instead of `(model)`. `None` for either knob means "inherit the parent's",
never "clear it". A profile pinning neither does not rebuild the provider at
Expand Down
2 changes: 1 addition & 1 deletion packages/agent-runtime/py/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "steerable-agent-runtime"
version = "0.12.0"
version = "0.12.1"
description = "Steerable agent runtime: LLM, tool, storage, and transport adapters."
license = { text = "Apache-2.0" }
readme = "README.md"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
lineage,
resolve_fork_seq,
)
from .budget import SessionBudgetExceeded, TreeBudget, TreeBudgetReport
from .spend import TreeSpend, TreeSpendReport
from .tree import AgentTree, TreeMember
from .team_board import TaskItem, TeamTaskBoard
from .cache_control import (
Expand Down Expand Up @@ -383,9 +383,8 @@
"ChildRegistry",
"ChildNoticeHooks",
"CHILD_NOTICE_KIND",
"SessionBudgetExceeded",
"TreeBudget",
"TreeBudgetReport",
"TreeSpend",
"TreeSpendReport",
"render_child_notice",
"ChildStatusView",
"SpawnedChild",
Expand Down
124 changes: 0 additions & 124 deletions packages/agent-runtime/py/src/steerable_agent_runtime/budget.py

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

from steerable_agent_protocol.generated import ToolCall, ToolResult

from .budget import TreeBudget
from .spend import TreeSpend
from .hooks import ChainHooks, CompletionAction, CompletionDraft, NoopHooks
from .history import completed_turn_prefix
from .llm import LLMMessage, LLMProvider
Expand Down Expand Up @@ -533,7 +533,7 @@ def __init__(
history_store: Any | None = None,
parent_record_id: str | None = None,
parent_projection: Callable[[], list[LLMMessage]] | None = None,
budget: TreeBudget | None = None,
spend: TreeSpend | None = None,
parent_route: Callable[[], tuple[str | None, str | None]] | None = None,
provider_factory: Callable[[str | None, str | None], LLMProvider] | None = None,
tree: AgentTree | None = None,
Expand Down Expand Up @@ -592,7 +592,7 @@ def __init__(
else None
)
#: The tree's shared token limit; ``None`` keeps per-run accounting.
self._budget = budget
self._spend = spend
self._depth = _depth
self._lineage = _lineage
self._pool = AgentPool(
Expand All @@ -603,7 +603,7 @@ def __init__(
event_sink=event_sink,
registry=registry,
parent_record_id=parent_record_id,
budget=budget,
spend=spend,
# Needed to write a fork seed's provenance into the child's record.
history_store=history_store,
tree=tree,
Expand Down Expand Up @@ -681,7 +681,7 @@ def _child_loop(
parent_projection=lambda: (
own_loop[0].history.projection if own_loop else []
),
budget=self._budget,
spend=self._spend,
# Same tree and board: a grandchild is as much a member of the
# job as its parent, and the plan it reads must be the one the
# root wrote.
Expand Down
Loading
Loading