@aragon-agent/cli 0.6.62 → 0.6.64
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +70 -2
- package/README.md +143 -27
- package/dist/agent/controller.d.ts +66 -14
- package/dist/agent/controller.js +291 -81
- package/dist/agent/headless.d.ts +16 -0
- package/dist/agent/headless.js +62 -3
- package/dist/agent/team-notices.d.ts +57 -7
- package/dist/agent/team-notices.js +93 -10
- package/dist/app/App.js +199 -77
- package/dist/cli.js +4 -1
- package/dist/commands/builtins.js +2 -1
- package/dist/commands/catalog.js +1 -1
- package/dist/compaction/archive.d.ts +27 -1
- package/dist/compaction/archive.js +8 -0
- package/dist/compaction/budget.d.ts +73 -0
- package/dist/compaction/budget.js +89 -0
- package/dist/compaction/child.js +6 -1
- package/dist/compaction/command.js +147 -1
- package/dist/compaction/compactor.d.ts +132 -15
- package/dist/compaction/compactor.js +288 -95
- package/dist/compaction/context-command.js +21 -0
- package/dist/compaction/memory-agent-prompt.d.ts +32 -0
- package/dist/compaction/memory-agent-prompt.js +76 -0
- package/dist/compaction/memory-agent-tools.d.ts +88 -0
- package/dist/compaction/memory-agent-tools.js +338 -0
- package/dist/compaction/memory-agent.d.ts +114 -0
- package/dist/compaction/memory-agent.js +220 -0
- package/dist/compaction/prune.d.ts +129 -0
- package/dist/compaction/prune.js +386 -0
- package/dist/compaction/retry-plan.d.ts +103 -0
- package/dist/compaction/retry-plan.js +136 -0
- package/dist/compaction/summarize-ladder.d.ts +149 -0
- package/dist/compaction/summarize-ladder.js +273 -0
- package/dist/compaction/wiring.d.ts +19 -0
- package/dist/compaction/wiring.js +65 -1
- package/dist/config/cli-commands.d.ts +2 -2
- package/dist/config/cli-commands.js +27 -0
- package/dist/config/env.d.ts +3 -1
- package/dist/config/env.js +44 -2
- package/dist/exec/events.d.ts +30 -0
- package/dist/exec/index.js +2 -0
- package/dist/exec/runner.js +16 -1
- package/dist/gene/commit-prepare.js +27 -1
- package/dist/gene/curator/curator.d.ts +15 -0
- package/dist/gene/curator/curator.js +26 -2
- package/dist/gene/curator/scripted-lane.d.ts +12 -0
- package/dist/gene/curator/scripted-lane.js +101 -0
- package/dist/gene/curator/task-context.d.ts +21 -0
- package/dist/gene/curator/task-context.js +33 -0
- package/dist/gene/curator/task-runner.d.ts +10 -1
- package/dist/gene/curator/task-runner.js +39 -4
- package/dist/gene/curator/tool-support.js +11 -4
- package/dist/gene/curator/toolkit.d.ts +13 -0
- package/dist/gene/curator/toolkit.js +23 -1
- package/dist/gene/curator/tools-verify.js +2 -2
- package/dist/gene/curator/tools-write.js +6 -1
- package/dist/gene/curator/validate/evidence-tokens.js +133 -22
- package/dist/gene/curator/validate/knowledge.d.ts +41 -1
- package/dist/gene/curator/validate/knowledge.js +74 -11
- package/dist/gene/curator/validate/prompts.d.ts +10 -2
- package/dist/gene/curator/validate/prompts.js +2 -2
- package/dist/gene/learn/draft-guard.d.ts +17 -0
- package/dist/gene/learn/draft-guard.js +113 -0
- package/dist/gene/learn/learn-prompt.d.ts +22 -1
- package/dist/gene/learn/learn-prompt.js +27 -2
- package/dist/gene/learn/learner.js +20 -2
- package/dist/gene/queue.d.ts +16 -0
- package/dist/gene/queue.js +44 -1
- package/dist/governance/store/run-store.d.ts +20 -0
- package/dist/governance/store/run-store.js +54 -8
- package/dist/host/index.d.ts +1 -0
- package/dist/host/index.js +1 -0
- package/dist/host/interaction.d.ts +8 -17
- package/dist/host/interaction.js +50 -72
- package/dist/host/team-wake-driver.d.ts +90 -0
- package/dist/host/team-wake-driver.js +114 -0
- package/dist/logging/install.d.ts +59 -1
- package/dist/logging/install.js +15 -0
- package/dist/session/validate-session.js +11 -0
- package/dist/team/console-tools.d.ts +12 -0
- package/dist/team/console-tools.js +20 -3
- package/dist/team/console-view.js +11 -1
- package/dist/team/notices.d.ts +81 -4
- package/dist/team/notices.js +187 -22
- package/dist/team/prompt.js +1 -1
- package/dist/team/runtime.d.ts +67 -24
- package/dist/team/runtime.js +250 -31
- package/dist/team/stall-watch.d.ts +54 -0
- package/dist/team/stall-watch.js +119 -0
- package/dist/team/task-tool.js +2 -2
- package/dist/team/wake.d.ts +176 -0
- package/dist/team/wake.js +444 -0
- package/package.json +81 -81
package/CHANGELOG.md
CHANGED
|
@@ -12,9 +12,9 @@ were written.
|
|
|
12
12
|
- **`task` no longer returns the final report in an interactive session.** It returns "started" — the
|
|
13
13
|
dispatch id, the labels it created and a one-line cheat sheet of the control tools — and the dispatch
|
|
14
14
|
then belongs to the runtime, not to a tool call. The report arrives once, at the end, as a transcript
|
|
15
|
-
notice
|
|
15
|
+
notice and - while the lead is idle - a **wake** that starts a turn for it
|
|
16
16
|
(`team.autoResume`, default `auto`; `team.settleGraceMs`, default 3000 ms, is the window in which your
|
|
17
|
-
next message cancels that turn). `aragon -p`, `aragon exec` and governance mode keep the blocking
|
|
17
|
+
next message cancels that turn; see the lead wake signals below). `aragon -p`, `aragon exec` and governance mode keep the blocking
|
|
18
18
|
behaviour and the byte-identical report, so scripts, hosts and `schemaVersion` are untouched.
|
|
19
19
|
**Migration:** read the notice, call `team_collect` when you need the report synchronously, or set
|
|
20
20
|
`team.detachDispatch: false` (`aragon config set team.detachDispatch false`) to restore the old
|
|
@@ -28,6 +28,74 @@ were written.
|
|
|
28
28
|
that outlived its turn, because a later `Esc` no longer does it. Both changes are deliberate: one `Esc`
|
|
29
29
|
used to mean "clear my mind", and it must not be able to throw away two hours of work.
|
|
30
30
|
|
|
31
|
+
### Fixed
|
|
32
|
+
|
|
33
|
+
- **A team run that hit `[Agent] idle watchdog fired` no longer stays dead.** When the model went quiet for
|
|
34
|
+
the whole idle window (210 s by default), or the retry ladder gave up on a transport failure, the run was
|
|
35
|
+
over and nothing started another one: the screen said `N steps left; the run ended with an error.
|
|
36
|
+
/todo continue to retry...`, and the only recovery was you typing something - 12 seconds later, or 89
|
|
37
|
+
minutes later on an unattended run. The host now **re-runs the interrupted run itself**
|
|
38
|
+
(`controller.continue()`: the history is asked again, no message is added) after a grace window you can
|
|
39
|
+
cancel with `Esc` - 15 s, then 45 s, then 120 s - and says why: `The model stopped responding for 3m 30s
|
|
40
|
+
while writing a tool call (task). The last response was discarded; retrying automatically in 15s
|
|
41
|
+
(attempt 1/3) - Esc to cancel.` It needs no todo plan (a lead that dies while composing its first
|
|
42
|
+
dispatch has none) and is independent of `todo.followThrough`.
|
|
43
|
+
Bounded twice: `retry.maxRunResumes` (default 3) back-to-back recoveries, and
|
|
44
|
+
`retry.maxRunResumesPerPrompt` (default 10) per prompt, which only **you typing** refills - so a link
|
|
45
|
+
that dies every other turn still stops. Only the engine's own transient verdicts are recovered
|
|
46
|
+
(idle watchdog, `network_error`, `timeout`, `overloaded`, `server_error`); a rate limit, a rejected key,
|
|
47
|
+
a context overflow and anything the provider calls non-retryable are not, neither is a run you
|
|
48
|
+
stopped with `Esc`, and neither is a stall that began while a **tool was running** (the history then ends
|
|
49
|
+
in tool calls with no results, which the provider would reject, so a retry could only fail).
|
|
50
|
+
A pending team-wake countdown keeps the timer slot (it redoes the same turn and delivers a real signal),
|
|
51
|
+
and a recovery that already holds it makes a later wake answer `busy`.
|
|
52
|
+
`retry.resumeRun: false` (or `/retry off`, or `retry.maxRetries: 0`) restores the old behaviour exactly.
|
|
53
|
+
`aragon -p` and the one-shot `aragon exec` path get **one** recovery, 15 s grace, and exit 1 when it does
|
|
54
|
+
not end in an answer; text already streamed to stdout before the stall is not retracted (the retry line on
|
|
55
|
+
stderr says so), as with the ladder's own `stream_restart`.
|
|
56
|
+
|
|
57
|
+
- **A watchdog death now says where it went quiet.** `run_end` in the log carries `stall`: the phase
|
|
58
|
+
(`awaiting_response`, `thinking`, `text`, `tool_input`, `tool_running`, `between_turns`), the last event,
|
|
59
|
+
the tool being written or run, and the silence on **both** the monotonic and the wall clock - they diverge
|
|
60
|
+
by the length of a suspend, which is how a sleeping laptop is told apart from a quiet network. Nothing is
|
|
61
|
+
added to an `agent_end` that did not die of the watchdog.
|
|
62
|
+
|
|
63
|
+
- **The Gene Bank publishes again: four days of learning produced one gene.** The reviewer was running, but
|
|
64
|
+
the bank stayed empty for four reasons, all fixed. (1) The source check (K2) read grammar and prose as
|
|
65
|
+
facts - `/dev/null`, `2>&1`, `deploy/update/roll`, whole backticked command lines, a localized message,
|
|
66
|
+
`YYYY` placeholders - and vetoed a gene for any one of them; it now ignores those shapes, checks a command
|
|
67
|
+
word by word, and vetoes only when **most** of a draft's specifics (more than half, or more than eight)
|
|
68
|
+
cannot be found in its evidence. A minority is recorded as `KNOWLEDGE_EVIDENCE_UNVERIFIED` and the gene
|
|
69
|
+
goes in **on probation**; `recheck` shares the rule. On the 15 stored candidates K2 passes 13 instead of 3.
|
|
70
|
+
(2) A skill or tool draft could never be created (17 of 17 skills, 1 of 1 tools): the reviewer was never
|
|
71
|
+
told the contract, and a refusal named one issue at a time. Refusals now list every problem, `gene_toolkit
|
|
72
|
+
load author` states the knowledge / skill / preference contract once, and the reviewer prompt (`v3-2026-11`)
|
|
73
|
+
asks for it, never proposes a tool and may propose one skill per reply. Drafts the curator cannot create
|
|
74
|
+
are refused at enqueue, and the ones already queued are moved to `dead/` once an hour (reversible).
|
|
75
|
+
(3) A task that hit its token, turn or finish ceiling was retried four times; it now gets two. (4) A
|
|
76
|
+
reviewer proposal with a complete knowledge draft that passes the checks needing no model is written and
|
|
77
|
+
validated by code and published on probation without starting an agent loop (`resume_validation`, the
|
|
78
|
+
path that produced the only gene so far); any doubt falls back to the agent loop before anything is
|
|
79
|
+
written. The run log now says how many turns, which tools and which refusals a stopped task used.
|
|
80
|
+
**Migration:** none. Kill switches: `ARAGON_GENE_DRAFT_GUARD=0` (enqueue guard and sweep),
|
|
81
|
+
`ARAGON_GENE_SCRIPTED_LANE=0` (scripted lane). A TUI session that holds the curator lease must be restarted
|
|
82
|
+
to load the fix.
|
|
83
|
+
- **In team mode the lead no longer sits idle forever after its subagents finish.** The old follow-up
|
|
84
|
+
turn was judged once, on the lead's own `agent_end`, and a dispatch that ends while the lead is idle
|
|
85
|
+
never produces one - so the report waited for you to type. The runtime now owes the lead a wake as a
|
|
86
|
+
*state*, re-checked whenever a signal arrives, the lead goes idle, a retry beat fires or the host answers.
|
|
87
|
+
Three signals, all raised from runtime facts: the dispatch **ended**, a subagent **failed for good**
|
|
88
|
+
(after the supervisor's post-mortem had its chance to replace it), and the team **stalled**
|
|
89
|
+
(`team.stallSignalMs`, default 180 s, `0` turns it off). The wake text states facts only
|
|
90
|
+
(`<team_signal>`); what the lead does with it is its own call. A dispatch that fails before it can
|
|
91
|
+
even start (a subagent that cannot be built) now reports a failed row per subagent instead of
|
|
92
|
+
vanishing; a failed child no longer downgrades the wake to a notice; a report that could not be
|
|
93
|
+
delivered into the turn it ended in is no longer lost; a report is no longer delivered twice; and the
|
|
94
|
+
first turn after an `Esc` receives the report too. The wake is bounded (3 attempts per notice,
|
|
95
|
+
4 live-signal wakes per dispatch) and never silent: giving up prints a line. The terminal and the
|
|
96
|
+
desktop run the same driver. **Migration:** none; `team.autoResume` keeps its three values but now
|
|
97
|
+
covers failures and stalls as well as the end, and `at most one summary turn` is no longer a rule.
|
|
98
|
+
|
|
31
99
|
### Added
|
|
32
100
|
|
|
33
101
|
- **Prompt profiles: the red team block's wording now lives in an editable Markdown file.** The
|
package/README.md
CHANGED
|
@@ -2632,29 +2632,50 @@ dispatch started with, so the key can never turn a live team into an awaited too
|
|
|
2632
2632
|
call or the other way round. `-p`, `aragon exec` and governance mode always
|
|
2633
2633
|
dispatch in await mode — the machine contract does not change for this feature.
|
|
2634
2634
|
|
|
2635
|
-
### When the
|
|
2635
|
+
### When the team needs the lead: three signals, one wake
|
|
2636
|
+
|
|
2637
|
+
The runtime needs the lead in exactly three situations, and in no others: the dispatch
|
|
2638
|
+
**ended** (every child finished - all of them succeeded or some failed), a subagent
|
|
2639
|
+
**failed for good** while the others keep running, or the team **stalled** (nobody is doing
|
|
2640
|
+
real work and somebody is waiting on somebody else). Each becomes a notice that reaches the
|
|
2641
|
+
lead exactly once, and while the lead is idle the runtime also **wakes** it - so a team that
|
|
2642
|
+
finishes at 3 a.m. does not sit there until you type. A single success, a message from a
|
|
2643
|
+
child or a pause is not a signal; those ride along with the next one.
|
|
2636
2644
|
|
|
2637
2645
|
| Key | Values | What it does |
|
|
2638
2646
|
|---|---|---|
|
|
2639
|
-
| `team.autoResume` | `auto` (default) / `notify` / `off` | `auto`
|
|
2640
|
-
| `team.settleGraceMs` | 500-30000 ms, default 3000 | How long
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
- **It
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
- **
|
|
2656
|
-
|
|
2657
|
-
|
|
2647
|
+
| `team.autoResume` | `auto` (default) / `notify` / `off` | `auto` wakes an idle lead for any of the three signals; `notify` only prints one line; `off` says nothing. With `notify` and `off` the signal still reaches the lead with your next message |
|
|
2648
|
+
| `team.settleGraceMs` | 500-30000 ms, default 3000 | How long a wake waits before it runs, so your next keystroke or `Esc` can cancel it |
|
|
2649
|
+
| `team.stallSignalMs` | `0`, or 60000-3600000 ms; default 180000 | How long nobody may do real work before the lead is told the team stalled. `0` switches only this signal off - the end-of-dispatch and failure wakes are unaffected |
|
|
2650
|
+
|
|
2651
|
+
**What the lead does once it is awake is the lead's call.** The wake carries facts and nothing
|
|
2652
|
+
else: a `<team_signal>` block with the counts, the labels, the first line of each error, who
|
|
2653
|
+
stopped whom and how long things were quiet, plus one provenance line saying it is automatic and
|
|
2654
|
+
not a message from you. It never tells the lead to summarise, retry, replace or stop anything -
|
|
2655
|
+
it can do any of those, or none.
|
|
2656
|
+
|
|
2657
|
+
The rules are there to make the signal reliable without making it a loop:
|
|
2658
|
+
|
|
2659
|
+
- **It always reaches the lead.** A dispatch that ends while the lead is idle wakes it; one that
|
|
2660
|
+
ends mid-turn but could not be delivered into that turn wakes it when the turn ends; a dispatch
|
|
2661
|
+
that dies before its children even start (a model profile that cannot be built) reports a failed
|
|
2662
|
+
row per subagent. A failure no longer downgrades the wake to a plain notice.
|
|
2663
|
+
- **It cannot loop.** A notice gets at most three attempts and then a visible "could not wake the
|
|
2664
|
+
lead" line; failures and stalls wake the lead at most four times per dispatch and at least a
|
|
2665
|
+
minute apart (the fifth is announced instead); the end of a dispatch is always allowed.
|
|
2666
|
+
- **You come first.** A message or `Esc` during the countdown cancels it and the report goes with
|
|
2667
|
+
your message. A turn you interrupt is not restarted behind your back. A later signal still wakes
|
|
2668
|
+
the lead after you cancelled an earlier one.
|
|
2669
|
+
- **A stop you ordered is not news.** Ending the team yourself (or having the lead do it) does not
|
|
2670
|
+
wake the lead for it; the report is still delivered with the next turn.
|
|
2671
|
+
- **Only dispatches the lead is free during.** Blocking dispatches (`-p`, `aragon exec`,
|
|
2672
|
+
governance mode, `team.detachDispatch: false`) return the report in the `task` result and produce
|
|
2673
|
+
no notice and no wake - exactly as before.
|
|
2674
|
+
- **Delivered exactly once** - each notice is acknowledged per steer by Core's receipt, a notice a
|
|
2675
|
+
fast-reviewer queue clear swallowed goes back in the queue, and `team_collect` returning the
|
|
2676
|
+
report removes the notice that would have repeated it.
|
|
2677
|
+
- **`team_status` shows a stall** (`no progress for 3m (blocked: ...)`), and `team_collect` stops
|
|
2678
|
+
waiting the moment a signal arrives.
|
|
2658
2679
|
|
|
2659
2680
|
### The lead's console: seven control tools
|
|
2660
2681
|
|
|
@@ -3040,16 +3061,97 @@ the model is not in that table.
|
|
|
3040
3061
|
To make it cheap, configure the fast tier (`/fast on`, `/fast model <cheap-id>`).
|
|
3041
3062
|
The transcript card then names the cheap model.
|
|
3042
3063
|
|
|
3064
|
+
### Redundancy is pruned before anything is paid for
|
|
3065
|
+
|
|
3066
|
+
The **first** stage of a compaction costs no tokens. `compaction.prune` (on by
|
|
3067
|
+
default) walks the band that is about to be replaced and rewrites bodies that say
|
|
3068
|
+
nothing new:
|
|
3069
|
+
|
|
3070
|
+
- identical `tool_result` bodies — the first and the last copy always survive, and
|
|
3071
|
+
only the repeats in between become `[pruned duplicate-tool-result ...]` stubs;
|
|
3072
|
+
- the same command re-run with the same arguments and the same output;
|
|
3073
|
+
- an earlier `read_file` of a path that was read again later;
|
|
3074
|
+
- empty and noise-only results (a blank line, an `ok`, a rule of separators);
|
|
3075
|
+
- a body over 60 000 characters keeps its head and its tail.
|
|
3076
|
+
|
|
3077
|
+
The rules are deliberately narrow, and one rule is about honesty rather than
|
|
3078
|
+
size: a message the existing task memory **quotes** is never rewritten, because
|
|
3079
|
+
its excerpt would stop being a substring of the message and every later
|
|
3080
|
+
submission would be refused for a reason the model could not see. When the pass
|
|
3081
|
+
alone drops the projection below the threshold, **no summarizer call happens at
|
|
3082
|
+
all** — the card says `pruned 12 redundant bodies (214,003 chars) - no summary
|
|
3083
|
+
needed`. `/compact on/off` is not the switch for this; `/compact prune on|off` is.
|
|
3084
|
+
|
|
3085
|
+
### How the summary is produced now
|
|
3086
|
+
|
|
3087
|
+
`compaction.agentic` (on by default) turns the summary into a **multi-turn agent
|
|
3088
|
+
with tools** instead of one large JSON request. The prompt only *suggests* an
|
|
3089
|
+
order; the tools carry the hard rules, and a result is adopted only when it
|
|
3090
|
+
arrives through `compaction_submit`.
|
|
3091
|
+
|
|
3092
|
+
| tool | when it is available | what it does |
|
|
3093
|
+
|---|---|---|
|
|
3094
|
+
| `compaction_outline` | first request | maps the band: ids, roles, sizes, prior memory |
|
|
3095
|
+
| `compaction_submit` | first request | the only accepted result |
|
|
3096
|
+
| `compaction_read` | after `outline` | one contiguous range, verbatim and bounded |
|
|
3097
|
+
| `compaction_search` | after `outline` | bounded snippets with source ids |
|
|
3098
|
+
| `compaction_note` | after `outline` | stage one item, validated immediately |
|
|
3099
|
+
|
|
3100
|
+
That is **progressive disclosure** as a protocol rather than a request: the first
|
|
3101
|
+
request carries two schemas, and the other three appear only after the model has
|
|
3102
|
+
seen the map. A rejected submission comes back as a tool result with
|
|
3103
|
+
`{accepted:false, code, path, remainingSubmissions}`, so an unusable delta is
|
|
3104
|
+
repaired inside the same operation instead of ending it — which is exactly the
|
|
3105
|
+
failure this replaced (`the summarizer returned an unusable memory delta`).
|
|
3106
|
+
A model that cannot call tools still compacts: the first turn carries no
|
|
3107
|
+
`tool_call`, its text is parsed as the delta, and the card reports the one-shot
|
|
3108
|
+
fallback.
|
|
3109
|
+
|
|
3043
3110
|
### When it cannot summarize
|
|
3044
3111
|
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3112
|
+
Failures are classified, and each class gets its own action instead of a blind
|
|
3113
|
+
second attempt:
|
|
3114
|
+
|
|
3115
|
+
| failure | action |
|
|
3116
|
+
|---|---|
|
|
3117
|
+
| invalid / empty delta (`semantic`) | retry with the validator's receipt, up to 3 times, then change model |
|
|
3118
|
+
| request does not fit the window (`window`) | shrink the digest and ask again, up to 2 times, then change model |
|
|
3119
|
+
| connection dropped (`transport`) | `stop` on the same endpoint (core's own `withRetry` already backs off there); escalate only to a different endpoint |
|
|
3120
|
+
| no key, no model, no safe cut (`structural`) | `stop` |
|
|
3121
|
+
| budget reached | `stop` |
|
|
3122
|
+
| cancelled | `stop` |
|
|
3123
|
+
|
|
3124
|
+
One compaction makes at most **5 real summary calls** under one total deadline,
|
|
3125
|
+
and the agent loop has its own shorter wall clock (100 s, below the engine's
|
|
3126
|
+
120 s) so a slow compaction ends by itself and reports `agent_timeout` instead of
|
|
3127
|
+
being cut from outside with no wording. Nothing here is retried twice through two
|
|
3128
|
+
independent ladders: transport backoff exists in exactly one place.
|
|
3129
|
+
|
|
3130
|
+
Cancellation, timeout, invalid data, missing credentials, budget exhaustion, or
|
|
3049
3131
|
failed adoption leave history unchanged. The command reports `History preserved`
|
|
3050
3132
|
and the reason. `onFailure` now defaults to `stop`; legacy `truncate` values still
|
|
3051
3133
|
load but preserve history as well, as `/compact status` explicitly explains.
|
|
3052
3134
|
|
|
3135
|
+
### A budget you can set
|
|
3136
|
+
|
|
3137
|
+
`compaction.budgetTokens` and `compaction.budgetUsd` cap **one operation**, not
|
|
3138
|
+
the session — a session-wide cap turns the seventh compaction of a long run into
|
|
3139
|
+
an unexplained cliff. `0` (the default) means no ceiling.
|
|
3140
|
+
|
|
3141
|
+
```
|
|
3142
|
+
/compact budget 200000 # 200k tokens for the next operation
|
|
3143
|
+
/compact budget usd 0.50 # 50 cents for the next operation
|
|
3144
|
+
/compact budget off # no token ceiling
|
|
3145
|
+
/compact spend # session total + the last operation's ledger
|
|
3146
|
+
```
|
|
3147
|
+
|
|
3148
|
+
The ceiling is charged from the provider's **real usage**, and it is checked
|
|
3149
|
+
before a request is sent, so an obviously over-budget call is not made at all.
|
|
3150
|
+
When the summarizer's model has no price table the dollar ceiling is *explicitly
|
|
3151
|
+
inactive* (`priceUnknown`, rendered `n/a`) rather than silently ignored — a
|
|
3152
|
+
ceiling that is not enforced must not look enforced. `Settings > Context` has the
|
|
3153
|
+
same two rows.
|
|
3154
|
+
|
|
3053
3155
|
### It will not loop on your money
|
|
3054
3156
|
|
|
3055
3157
|
Four independent guards: never two compactions on consecutive turns, never more
|
|
@@ -3066,7 +3168,10 @@ and replacing history invalidates late responses.
|
|
|
3066
3168
|
|
|
3067
3169
|
### What you see
|
|
3068
3170
|
|
|
3069
|
-
Three surfaces, each answering something the others cannot
|
|
3171
|
+
Three surfaces, each answering something the others cannot (the card also
|
|
3172
|
+
reports what pruning saved, how many turns and tool calls the agent used, and
|
|
3173
|
+
whether a ceiling stopped it — one muted line, and only when it has something to
|
|
3174
|
+
say):
|
|
3070
3175
|
|
|
3071
3176
|
- **While it runs** — the activity row reads `Compacting context…`. It outranks
|
|
3072
3177
|
the tool name and the rotating phrase, because compaction happens between
|
|
@@ -3107,7 +3212,11 @@ refusal is explained. Automatic tail clipping and failure truncation are disable
|
|
|
3107
3212
|
|
|
3108
3213
|
Children compact their own history **under the lead's own policy**: the same
|
|
3109
3214
|
`keepRecentTurns`, the same `onFailure`, the same archive setting, the same
|
|
3110
|
-
per-run compaction bound, the fast tier preferred whenever it
|
|
3215
|
+
per-run compaction bound, the same pruning, the fast tier preferred whenever it
|
|
3216
|
+
resolves. The multi-turn agent is the one exception and it is forced **off** for
|
|
3217
|
+
children: a child has no card and no notice channel, so its turns would be cost
|
|
3218
|
+
nobody can watch while the bill joins your session. Prune plus one JSON call is
|
|
3219
|
+
everything a background worker needs. Each
|
|
3111
3220
|
child owns its own context meter and counts compaction only after Core accepts
|
|
3112
3221
|
the candidate. There is no transcript card for a
|
|
3113
3222
|
child — the lead's transcript describes the lead's context. Turn it off with
|
|
@@ -3125,7 +3234,11 @@ After a splice is adopted, the dropped messages are written verbatim to
|
|
|
3125
3234
|
`~/.aragon/compaction/` — metadata, the summary, and the messages themselves.
|
|
3126
3235
|
|
|
3127
3236
|
`/compact history` lists **this run's** archives, newest first, with the path of
|
|
3128
|
-
each.
|
|
3237
|
+
each. Each document also carries the prune detail (`messageIndex`, `sourceId`,
|
|
3238
|
+
`keptIndex`, removed chars), the budget ledger and the agent's turn count — as
|
|
3239
|
+
**optional** sections, so archives written before this existed are still listed
|
|
3240
|
+
and still readable (`version` stays `1`; the reader treats a missing section as
|
|
3241
|
+
absent). `/compact show <n>` prints one archive's metadata and its stored summary;
|
|
3129
3242
|
it never prints message bodies, because a single archive can be megabytes and the
|
|
3130
3243
|
transcript is not a pager. The directory is shared by every `aragon` on the
|
|
3131
3244
|
machine, so files carry a per-process run id: another terminal's compactions are
|
|
@@ -3765,6 +3878,9 @@ env / `.env` → CLI flags**.
|
|
|
3765
3878
|
| `retry.respectRetryAfter` | `true` | Honour `Retry-After` (and the provider rate-limit reset headers) as a **floor**, never a replacement — a `Retry-After: 1` on the ninth retry does not undo eight retries of backoff. A stated wait above 60 s is surfaced immediately instead of waited out. |
|
|
3766
3879
|
| `retry.maxElapsedMs` | `240000` | Wall-clock budget from the first failure, clamped to `[10000, 1800000]`. Under the legacy regime (`team.overseer: false`) with `team.subagentTimeoutMs` positive, keep this below it: an equal budget means a subagent is killed at the same instant its ladder ends, and the user is then told "subagent timed out" for what was a provider outage. |
|
|
3767
3880
|
| `retry.onPartialStream` | `true` | Allow a restart after content has already streamed to the transcript. The view is rewound and the discarded tool cards removed; engine history is provably clean at that point, because it is only written on a completed turn. `false` refuses the whole path. |
|
|
3881
|
+
| `retry.resumeRun` | `true` | Re-run a run the **engine** interrupted - the idle watchdog fired (`[Agent] idle watchdog fired`) or the retry ladder gave up on a transport failure - instead of leaving it dead. Host-side: it redoes a **run** (`controller.continue()`, no message added) where the ladder above retries a **request**, so it never reaches the engine's `RetryPolicy`. Needs no todo plan and ignores `todo.followThrough`. Waits 15 s, then 45 s, then 120 s (cancel with `Esc`), announces the stall and its stage, and is switched off by `retry.enabled: false` / `retry.maxRetries: 0` as well. A rate limit, a rejected key, a context overflow, a run you stopped with `Esc` and a stall that began while a tool was running (unpaired tool calls in the history) are never recovered. `aragon -p` / `aragon exec` get one recovery, 15 s grace. |
|
|
3882
|
+
| `retry.maxRunResumes` | `3` | Back-to-back recoveries before control goes back to you, clamped to `[0, 10]`. Cleared by any run that ends without an error. `0` disables recovery and is a real value here, not a typo for the default. |
|
|
3883
|
+
| `retry.maxRunResumesPerPrompt` | `10` | Recoveries per prompt, clamped to `[0, 50]`, however well the runs in between went. Cleared **only** by you typing, so a link that dies every other turn still reaches it. `0` disables recovery. |
|
|
3768
3884
|
| `skills.enabled` | `true` | Master switch for the skill system. |
|
|
3769
3885
|
| `skills.requireApproval` | `true` | Require a human to approve `skill_install` / `skill_create`. |
|
|
3770
3886
|
| `skills.catalogMaxBytes` | `6000` | Level 1 catalog ceiling, in UTF-8 **bytes**, clamped to `[500, 40000]`. |
|
|
@@ -26,7 +26,8 @@ import type { ToolHookRunner } from '../exec/hooks/tool-wrapper.js';
|
|
|
26
26
|
import type { ToolPermission } from '../exec/permission.js';
|
|
27
27
|
import { type ToolOutputListener } from '@aragon-agent/tui/model/tools/tool-output-store';
|
|
28
28
|
import type { FilePatch } from '@aragon-agent/tui/model/tools/patch';
|
|
29
|
-
import {
|
|
29
|
+
import { type TeamWakeAck, type TeamWakeBegin, type TeamWakeRequest } from '../team/wake.js';
|
|
30
|
+
export type { TeamWakeAck, TeamWakeBegin, TeamWakeRequest } from '../team/wake.js';
|
|
30
31
|
import type { ReportOptions } from '../team/report.js';
|
|
31
32
|
import type { DispatchHandle, DispatchInspection } from '../team/runtime.js';
|
|
32
33
|
import type { TeamControlRequest } from '../team/console-view.js';
|
|
@@ -501,6 +502,22 @@ export declare class AgentController {
|
|
|
501
502
|
*/
|
|
502
503
|
private readonly teamNotices;
|
|
503
504
|
private teamRelay;
|
|
505
|
+
/**
|
|
506
|
+
* The wake governor (team-lead-wake-signals): "the team needs the lead - is now the
|
|
507
|
+
* moment to start a turn?". Level-triggered over the relay's ledger, so a dispatch
|
|
508
|
+
* that ends while the lead is idle still wakes it. Built next to the relay.
|
|
509
|
+
*/
|
|
510
|
+
private teamWake;
|
|
511
|
+
/** Dispatches started DETACHED; only these produce notices and wakes (I-WK3). */
|
|
512
|
+
private readonly detachedDispatches;
|
|
513
|
+
/**
|
|
514
|
+
* `prompt()` / `continue()` calls between entry and exit. The engine's own
|
|
515
|
+
* `isRunning()` is false for the whole `gene.planForTurn` await, but a turn is
|
|
516
|
+
* certainly starting then; the governor must not start a second one (RV-P2-10).
|
|
517
|
+
*/
|
|
518
|
+
private promptInFlight;
|
|
519
|
+
/** Distinguishes one notice steer's receipt id from the next. */
|
|
520
|
+
private noticeSequence;
|
|
504
521
|
/**
|
|
505
522
|
* The monotonic turn counter behind `I-DD11`.
|
|
506
523
|
*
|
|
@@ -715,6 +732,15 @@ export declare class AgentController {
|
|
|
715
732
|
steer(text: string): void;
|
|
716
733
|
/** Return the opaque ID used by the view to match Core's acceptance receipt. */
|
|
717
734
|
queueUserMessage(text: string, parts?: ContentPart[]): string;
|
|
735
|
+
/**
|
|
736
|
+
* `receipt` (notices only, team-lead-wake-signals) asks for an id WITHOUT making the
|
|
737
|
+
* steer a user message: Core echoes `steering_accepted` for any steer that has one,
|
|
738
|
+
* and the team relay needs that echo. It is deliberately NOT written to
|
|
739
|
+
* `pendingUserSteering` - `hasPendingUserMessages()`, `withdrawQueuedUserMessage()`,
|
|
740
|
+
* `continue()` and `fast`'s `userSteerCount` all read that map and mean "the user is
|
|
741
|
+
* waiting for an answer". The `notice:` prefix keeps every other receipt consumer
|
|
742
|
+
* treating it as an unknown id.
|
|
743
|
+
*/
|
|
718
744
|
private enqueueSteering;
|
|
719
745
|
/**
|
|
720
746
|
* Withdraw a queued user message by the id `queueUserMessage` returned.
|
|
@@ -1148,20 +1174,33 @@ export declare class AgentController {
|
|
|
1148
1174
|
/** Whether a dispatch is live AND was started by an earlier turn. */
|
|
1149
1175
|
teamOutlivesTurn(): boolean;
|
|
1150
1176
|
/**
|
|
1151
|
-
*
|
|
1152
|
-
*
|
|
1153
|
-
* THE ID TRAVELS WITH THE FACTS. The host spends the continuation with
|
|
1154
|
-
* `markTeamContinued()`, and the facts are by definition read AFTER settlement,
|
|
1155
|
-
* when `TeamRuntime.live()` already answers `null` - so an id re-derived from
|
|
1156
|
-
* `live()` was always null, `session.continued` was never set, and every later
|
|
1157
|
-
* `agent_end` earned the same follow-up turn: an unbounded model loop that
|
|
1158
|
-
* never lets the user type.
|
|
1177
|
+
* Every attention notice the lead has not been PROVEN to have: the queue plus the
|
|
1178
|
+
* relay's ledger, oldest first. The governor's one input.
|
|
1159
1179
|
*/
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1180
|
+
private owedAttention;
|
|
1181
|
+
/**
|
|
1182
|
+
* Register THE host of wake requests (one at a time). The terminal app and the
|
|
1183
|
+
* desktop coordinator both do it through `host/team-wake-driver.ts`.
|
|
1184
|
+
*/
|
|
1185
|
+
subscribeTeamWake(listener: (request: TeamWakeRequest) => void): () => void;
|
|
1186
|
+
/**
|
|
1187
|
+
* The fire-time re-check: still owed, lead still idle, no user message waiting - and
|
|
1188
|
+
* the `<team_signal>` text to submit, rendered NOW so anything that arrived during
|
|
1189
|
+
* the countdown is in it. Synchronous and never throws (I-WK10).
|
|
1190
|
+
*/
|
|
1191
|
+
confirmTeamWake(requestId: string): TeamWakeBegin;
|
|
1192
|
+
ackTeamWake(requestId: string, result: TeamWakeAck): void;
|
|
1193
|
+
/** Whether any attention notice is undelivered. `team_collect` stops waiting on it. */
|
|
1194
|
+
hasPendingTeamAttention(): boolean;
|
|
1195
|
+
/**
|
|
1196
|
+
* `team_collect` has just put this dispatch's report in a tool result, so the settle
|
|
1197
|
+
* notice must not deliver it again (RC-8).
|
|
1198
|
+
*/
|
|
1199
|
+
acknowledgeTeamSettle(dispatchId: string): void;
|
|
1200
|
+
/** The runtime's live roster as `still running` count: queued + running + paused. */
|
|
1201
|
+
private stillRunningCount;
|
|
1202
|
+
/** Forget everything the team owed the previous conversation. */
|
|
1203
|
+
private resetTeamSignals;
|
|
1165
1204
|
/**
|
|
1166
1205
|
* Turn one runtime event into a notice (section 5.3.1).
|
|
1167
1206
|
*
|
|
@@ -1169,8 +1208,21 @@ export declare class AgentController {
|
|
|
1169
1208
|
* queue must agree about what happened, and the only way to guarantee that is for
|
|
1170
1209
|
* all three to read the same event. The queue adds nothing but the "exactly once"
|
|
1171
1210
|
* bookkeeping.
|
|
1211
|
+
*
|
|
1212
|
+
* ONLY DETACHED DISPATCHES (I-WK3). A blocking dispatch already returns its report
|
|
1213
|
+
* in the `task` result, so a notice about it would deliver the same report twice -
|
|
1214
|
+
* and, now that notices wake the lead, would also start a turn for nothing. The one
|
|
1215
|
+
* exception to "seen `dispatch_start` first" is `dispatch_end.detached`, which the
|
|
1216
|
+
* runtime sets itself so a dispatch that died before it could announce its start
|
|
1217
|
+
* still reaches the lead (I-WK15).
|
|
1172
1218
|
*/
|
|
1173
1219
|
private onTeamEvent;
|
|
1220
|
+
/** `done` / `aborted` are chatter; `failed` is a SIGNAL and arrives as `child_failed`. */
|
|
1221
|
+
private noteChildSettled;
|
|
1222
|
+
private noteChildFailed;
|
|
1223
|
+
private noteStalled;
|
|
1224
|
+
private noteDispatchEnd;
|
|
1225
|
+
private raiseSignal;
|
|
1174
1226
|
/** Refused mid-dispatch by `/team`; half a dispatch under two ceilings is not
|
|
1175
1227
|
* a result anything can afterwards explain (the reasoning `/reload` uses). */
|
|
1176
1228
|
isTeamBusy(): boolean;
|