@dreb/coding-agent 2.72.0 → 2.74.0
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/README.md +4 -2
- package/dist/core/agent-session.d.ts +34 -0
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +207 -98
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/tools/index.d.ts +1 -1
- package/dist/core/tools/index.d.ts.map +1 -1
- package/dist/core/tools/index.js +1 -1
- package/dist/core/tools/index.js.map +1 -1
- package/dist/core/tools/subagent.d.ts +77 -6
- package/dist/core/tools/subagent.d.ts.map +1 -1
- package/dist/core/tools/subagent.js +312 -64
- package/dist/core/tools/subagent.js.map +1 -1
- package/dist/modes/rpc/rpc-client.d.ts +6 -0
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client.js +9 -0
- package/dist/modes/rpc/rpc-client.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +7 -1
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +11 -2
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/docs/agent-models.md +1 -1
- package/docs/dashboard.md +57 -5
- package/docs/json.md +2 -2
- package/docs/rpc.md +24 -5
- package/docs/settings.md +1 -1
- package/package.json +1 -1
package/docs/dashboard.md
CHANGED
|
@@ -140,7 +140,7 @@ networking window above.
|
|
|
140
140
|
|---|---|
|
|
141
141
|
| **Fleet** | Home. Live-first: one grid of every live session at the top — status chip (● running / ◆ needs-attention / ○ idle / ✕ error), project path, activity line, live subagent lines, tasks progress, ctx%, model, terminal provider-error reason, last activity. Live cards keep a deterministic order by project path, then session start time; needs-attention cards badge the browser tab without jumping around. Below the grid: past sessions grouped by their historical project, three compact rows per group with an "all N on disk" expander, resume and delete. Sessions remain visible when that historical directory is missing; resume opens an explicit runtime-directory chooser instead of mutating or hiding the session. |
|
|
142
142
|
| **Session view** | Full chat drill-in. Markdown streaming transcript (text, thinking blocks with expand preference, inline provider/API failures with partial output preserved, agent-result cards, tool cards with bespoke read/write/edit/bash bodies plus full expandable inputs, markdown-rendered results for markdown-contract tools like subagent/skill/web_fetch/suggest_next, and inline tool-result images, compaction/branch summaries, custom messages), per-message copy, tasks panel, a bounded scrollable subagent panel that lists every retained agent newest-first with full running/done counts, a shared dismissible banner region for model fallback, extension notices, retry/compaction/paused/provider status, and local action results, a controls-only dock line with elapsed time plus ■ stop and explicitly labelled retry/compaction aborts, a persistent session-header live indicator, and an info bar with cwd, original-session provenance when a historical session is resumed in a different runtime directory, branch, session name, token breakdown, cost/(sub)/daily rollup, ctx%, a TUI-parity latest-100 median TPS indicator (`~31 tok/s [100] · 10% ↑ median [10000]`), and a stats popover. A fleet sidebar lists every other live session beside the transcript with the fleet cards' project, status/reasons, activity/latest-assistant preview, running/done subagent summaries, task progress, model, context, cost, message count, last activity, and any original-session provenance, deterministically ordered by project path then session start time (the fleet page's comparator), so needs-attention/error entries are emphasized — a filled attention chip or outlined error chip plus an entry border — without moving position; clicking an entry navigates to that session, desktop collapse and pointer/keyboard-resizable width persist browser-locally (default expanded, 260px), the hidden toggle border reflects the highest-priority other-session status, and neither sidebar nor toggle renders when no other live sessions exist. The subagent drill-in shows the same sidebar with its parent session excluded. Closed-session banners offer direct resume when the captured runtime directory still exists and an explicit directory chooser when the historical directory is missing or should be replaced. Composer supports auto-grow, history, `/` autocomplete from `get_commands`, image attach/paste with sent images retained as user-message previews, queued-message chips with restore-all, steer/follow-up modes, and suggest-next. Registered built-in slash commands are discovered generically, deduplicated ahead of colliding resource commands, and intercepted before prompting: dashboard actions cover settings, model, scoped-models, export/import, name/session stats, fork/tree, new/compact/dream, resume/reload, and quit. `/scoped-models` deep-links to the Settings editor with the session's current cwd as project context; login/logout show an explicit not-yet-implemented notice, while copy/hotkeys/buddy give terminal-only guidance. Future built-ins are intercepted automatically. The RPC prompt boundary rejects any built-in that reaches it during command-loading races or failures, so slash text cannot leak to the model. Attachments are retained and the command is visibly rejected rather than silently discarded. The ⋯ menu covers export HTML, compact, rename, fork-from-message, loaded context, and tool expand/collapse. Session names update live from manual rename or auto-naming. Extension UI requests for select/confirm/input/editor render as modals; a rich `ask`/`ask_user` request renders inline as a single wizard that presents all its questions together — each with Markdown-formatted question text, choices, optional free text — plus an in-card Stop agent action, Escape-to-stop, and the authoritative auto-stop countdown, and is answered as one batch submit. Pending questions set needs-attention state and use the existing hidden-page notification path. Extension notifications for the viewed session render in its banner region; other sessions' and app-global notices use the fixed top-center toast stack. |
|
|
143
|
-
| **Subagent view** | Transcript of a background agent: live events via the RPC relay, hydrated from the agent's on-disk session log (`/subagents/:agentId/messages`) so the transcript survives browser reloads. Shows the task, streaming output, tool activity, and any safe Dispatch Arbiter changed/unchanged/failure records with the final agent/model/thinking. No raw arbiter output is displayed or transported. While the child is running, a composer sends the user's text unchanged to that specific child as steering input, displays its pending steering queue, and reports its effective `one-at-a-time` or `all` delivery mode. Completed, failed, rehydrated, and unavailable children remain read-only. |
|
|
143
|
+
| **Subagent view** | Transcript of a background agent: live events via the RPC relay, hydrated from the agent's on-disk session log (`/subagents/:agentId/messages`) so the transcript survives browser reloads. Shows the task, streaming output, tool activity, and any safe Dispatch Arbiter changed/unchanged/failure records with the final agent/model/thinking. No raw arbiter output is displayed or transported. While the child is running, a composer sends the user's text unchanged to that specific child as steering input, displays its pending steering queue, and reports its effective `one-at-a-time` or `all` delivery mode, and the dock shows a **■ stop** (styled like the session view's) that stops only that child — see [Stopping a subagent](#stopping-a-subagent). Completed, failed, cancelled, rehydrated, and unavailable children remain read-only. |
|
|
144
144
|
| **Files** | Host-wide browser with places shortcuts (home, /tmp, project roots), breadcrumbs to `/`, new-folder, download, drop-zone/picker upload with explicit collision prompts, and "new session here" on any directory. It also shows the **effective global nested-context trust** for the displayed canonical directory: untrusted, trusted by that root, inherited from a granting root, or global expert trust-all. You can trust the displayed folder and descendants, or untrust the actual granting root; untrusting an inherited folder removes that root's trust for all descendants. |
|
|
145
145
|
| **Memories** | Dreb-only memory management for `~/.dreb/memory` and `.dreb/memory` under active/disk project roots. It lists existing `MEMORY.md` indexes and direct child `.md` entries only (no Claude paths, create, or rename), shows entry frontmatter or metadata errors so malformed files can be repaired, renders sanitized Markdown preview beside a raw editor, and uses exact SHA-256 revisions so stale saves/deletes return conflicts while preserving drafts. The index view is complete, not truncated, and warns when it exceeds the 200-line memory-index convention. Entry deletion requires both entry and index revisions, removes only matching safe Markdown-link index lines (`file.md` / `./file.md`), writes the cleaned index atomically before unlinking the entry, and rolls back loudly if the unlink fails. |
|
|
146
146
|
| **Settings** | Persistent defaults (default model, thinking level, steering/follow-up queue modes, auto-compaction, opt-in continuation of pending work after successful automatic compaction, auto-retry) via `get_settings`/`set_settings` — validation errors are shown verbatim. The continuation option is off by default, can keep unattended model turns and costs running indefinitely, does not restart completed answers, and never affects manual `/compact`. The tab-title card exposes the default-enabled generator toggle and an exact authenticated `provider/model` picker; an unset model clearly retains Explore-agent routing, a pinned model can be cleared back to that route, and edits apply to new unnamed sessions. The scoped-models editor controls model cycling for new sessions only: grouped search, model/provider/all toggles, responsive controls, accessible up/down partial-scope ordering, and save/reset. An absent `enabledModels` is future-inclusive all models in registry order and cannot be reordered; a partial scope is a non-empty ordered list of canonical `provider/model` references. Editing legacy glob, fuzzy, or thinking-suffix values saves normalized exact references. The selected context reads effective global + project settings but writes global; a project-level `enabledModels` shadow is warned. The global-only Dispatch Arbiter card exposes enable/disable, exact authenticated model selection, thinking, guide path, and readiness guidance; model-less enablement is blocked and RPC/runtime validation remains fail-closed. Entering Settings flushes pending writes and reloads durable global + project settings, so external edits appear; read, parse, or write failures fail loudly instead of showing stale settings. The global-only nested-context policy lists every explicit trusted root for audit and revoke, offers a simple add-by-path control, and includes a prominently warned expert trust-all toggle; the Files view remains the primary place to grant trust while browsing. Most defaults seed new sessions, including **Max concurrent subagents** (default 4). Setting it to 0 starts new parents without the subagent tool and tells the parent model to perform normally delegated work itself; positive values cap running children per parent session. Context-trust changes are observed by active main/subagent processes for future lazy loads, but cannot remove already injected content. Dashboard-local preferences (always expand thinking, transcript image display mode, needs-attention notification permission) live in the browser, alongside an appearance section: a theme gallery of eight curated themes (entropist.ca, Dim, Solarized, Gruvbox, Caves of Qud, Van Gogh, and the colorblind-safe Okabe-Ito and Paul Tol) with live preview cards plus system/light/dark mode and a font picker with 36 explicit choices plus Theme default (the existing IBM Plex Mono/JetBrains Mono/Fira Code/Iosevka/OpenDyslexic/Atkinson Hyperlegible plus 15 sans-serif and 15 serif families), regular-face previews in the open listbox, saved per browser. Shows the current rotating pairing code on the host/local dashboard, the 1–3650 day lifetime used only for future pairings (180-day default), and paired-device expiry dates with unpair. |
|
|
@@ -409,7 +409,11 @@ While the agent is streaming, the send button becomes mode-aware:
|
|
|
409
409
|
- **steer** — deliver now: injected into the running turn after the current
|
|
410
410
|
tool call completes.
|
|
411
411
|
- **follow-up** — queued; delivered after the agent finishes the current work.
|
|
412
|
-
- **■ stop** — abort the current turn.
|
|
412
|
+
- **■ stop** — abort the current turn. Visible whenever something can be
|
|
413
|
+
stopped: while the agent is streaming or compacting, and while any subagent is
|
|
414
|
+
still running (including when the parent is paused waiting on them). This also
|
|
415
|
+
stops all running subagents; to stop just one, use the ■ stop in its
|
|
416
|
+
[subagent view](#stopping-a-subagent).
|
|
413
417
|
|
|
414
418
|
When the agent is idle, send is a plain prompt.
|
|
415
419
|
|
|
@@ -531,6 +535,45 @@ Background subagents are first-class:
|
|
|
531
535
|
`background_agent_event` relay (see [RPC events](rpc.md#event-types)) and
|
|
532
536
|
hydrates from the agent's on-disk session log on mount, so transcripts
|
|
533
537
|
survive browser reloads and remain viewable after the agent finishes.
|
|
538
|
+
- Each agent reports `running`, `completed`, `failed` (the child errored), or
|
|
539
|
+
`cancelled` (stopped by the user). The session panel marks cancelled agents
|
|
540
|
+
with `■` (failed ones keep `✕`) and the drill-in header chip reads
|
|
541
|
+
`cancelled`.
|
|
542
|
+
|
|
543
|
+
### Stopping a subagent
|
|
544
|
+
|
|
545
|
+
While a child is running — streaming, executing a tool, waiting for a
|
|
546
|
+
concurrency slot, or between chain steps — the drill-in dock shows a
|
|
547
|
+
**■ stop** button. It calls
|
|
548
|
+
[`abort_background_agent`](rpc.md#abort_background_agent) for that one child:
|
|
549
|
+
|
|
550
|
+
- Only that subagent stops. The parent session's run and queue, and every other
|
|
551
|
+
subagent (including its steering), keep running. The parent session's own
|
|
552
|
+
■ stop (and Esc in the TUI) still stops everything.
|
|
553
|
+
- The child is stopped gracefully: it aborts its own run first, so a hung tool
|
|
554
|
+
such as a long bash command is killed with its process group instead of being
|
|
555
|
+
orphaned, then it is terminated (SIGTERM, with a SIGKILL backstop). A child
|
|
556
|
+
stopped while it is still starting up is aborted as soon as its run begins,
|
|
557
|
+
before it can run any tool.
|
|
558
|
+
- A queued child settles immediately without taking a concurrency slot. A chain
|
|
559
|
+
is stopped as a whole; no later step starts.
|
|
560
|
+
- The parent receives a "cancelled by the user" notice in its context. Any
|
|
561
|
+
partial output sits between `--- agent output (partial) ---` and
|
|
562
|
+
`--- end of agent output ---` lines, apart from the notice's own lines. The
|
|
563
|
+
parent is **not** woken — nothing relaunches work you just
|
|
564
|
+
stopped. If the stopped agent was the last one running, the parent stays idle
|
|
565
|
+
until you prompt it. While the parent is busy (mid-run, retrying, or
|
|
566
|
+
compacting) the notice waits until it is idle again, so it never lands between
|
|
567
|
+
a tool call and its result. If you switch, start, or fork a session first, the
|
|
568
|
+
notice is still saved to the session it belongs to.
|
|
569
|
+
- The stop is recorded in the agent's session directory, so it still shows as
|
|
570
|
+
cancelled after a reload or runtime restart. This includes a chain stopped
|
|
571
|
+
between steps, and an agent stopped while queued (which then has an empty
|
|
572
|
+
transcript).
|
|
573
|
+
- Steering messages still queued in the stopped child are discarded with it.
|
|
574
|
+
- While the stop is in flight the button reads `stopping…` and steering is
|
|
575
|
+
disabled; the view turns read-only when the cancellation arrives. A failed
|
|
576
|
+
stop request is shown in the view and the button re-enables for a retry.
|
|
534
577
|
|
|
535
578
|
## Responsive behavior
|
|
536
579
|
|
|
@@ -612,6 +655,15 @@ TUI theme system** — dashboard themes intentionally do not map to TUI themes.
|
|
|
612
655
|
color vision. A separate mode toggle (system / light / dark) picks which
|
|
613
656
|
variant renders; forced light/dark works for every theme, including
|
|
614
657
|
entropist.ca. `system` follows the OS via `prefers-color-scheme`.
|
|
658
|
+
- **User-message backgrounds.** User-message bubbles use the dashboard's
|
|
659
|
+
`--user-message-bg` color, with a distinct opaque fill for each theme's light
|
|
660
|
+
and dark palettes. The fill follows the selected theme and mode: forced
|
|
661
|
+
light/dark overrides the OS, while system mode responds to OS changes without
|
|
662
|
+
reloading. Normal user-message text meets WCAG AA contrast (at least 4.5:1)
|
|
663
|
+
on these fills. Only the text bubble is filled; attached images remain outside
|
|
664
|
+
it, and assistant and tool backgrounds are unchanged. There is no additional
|
|
665
|
+
preference or custom-color editor, and the terminal theme's `userMessageBg`
|
|
666
|
+
token does not control this dashboard color.
|
|
615
667
|
- **Theme gallery and font selection.** The settings appearance section shows
|
|
616
668
|
mode and font selectors plus a grid of live preview cards (one per theme).
|
|
617
669
|
Each card previews its palette locally without touching the page until you
|
|
@@ -642,8 +694,8 @@ TUI theme system** — dashboard themes intentionally do not map to TUI themes.
|
|
|
642
694
|
- **Per-browser persistence.** Selections are stored in per-browser
|
|
643
695
|
`localStorage` (`dreb.dashboard.theme`, `dreb.dashboard.colorMode`, and
|
|
644
696
|
`dreb.dashboard.font`), with a cross-tab sync listener; a pristine install
|
|
645
|
-
(entropist.ca + system + Theme default font) leaves no keys behind and
|
|
646
|
-
|
|
697
|
+
(entropist.ca + system + Theme default font) leaves no keys behind and matches
|
|
698
|
+
the current `tokens.css` baseline, including user-message fills. No server/RPC
|
|
647
699
|
involvement, no runtime dependencies.
|
|
648
700
|
- **No wrong-appearance flash.** A synchronous bootstrap in `index.html` paints
|
|
649
701
|
the correct theme, mode, and explicit font before any CSS loads, and keeps a
|
|
@@ -743,7 +795,7 @@ persistence and licensing handling; it remains separate from this catalog.
|
|
|
743
795
|
## Limitations (deliberate, sequenced later)
|
|
744
796
|
|
|
745
797
|
- No shell passthrough from the browser.
|
|
746
|
-
- Completed, failed, rehydrated, and otherwise unavailable subagent transcripts are read-only; only a live controllable child accepts steering.
|
|
798
|
+
- Completed, failed, cancelled, rehydrated, and otherwise unavailable subagent transcripts are read-only; only a live controllable child accepts steering, and only a running child can be stopped.
|
|
747
799
|
|
|
748
800
|
## Background service / auto-restart
|
|
749
801
|
|
package/docs/json.md
CHANGED
|
@@ -19,7 +19,7 @@ type AgentSessionEvent =
|
|
|
19
19
|
| { type: "auto_retry_end"; success: boolean; attempt: number; finalError?: string }
|
|
20
20
|
| { type: "background_agent_start"; agentId: string; agentType: string; taskSummary: string; sessionDir?: string }
|
|
21
21
|
| { type: "subagent_arbitration"; agentId: string; status: "success" | "failure"; proposed: DispatchRoute; final: DispatchRoute | null; changed: ("agent" | "model" | "thinking")[]; step?: number; errorCode?: string; errorMessage?: string }
|
|
22
|
-
| { type: "background_agent_end"; agentId: string; agentType: string; success: boolean; model?: string; thinking?: ThinkingLevel; steps?: SubagentStepMetadata[]; sessionFile?: string }
|
|
22
|
+
| { type: "background_agent_end"; agentId: string; agentType: string; success: boolean; cancelled: boolean; model?: string; thinking?: ThinkingLevel; steps?: SubagentStepMetadata[]; sessionFile?: string }
|
|
23
23
|
| { type: "background_agent_event"; agentId: string; event: Record<string, unknown> }
|
|
24
24
|
| { type: "parent_paused_for_background_agents"; runningAgentCount: number; turnsUsed: number; turnLimit: number }
|
|
25
25
|
| { type: "session_name_changed"; name: string }
|
|
@@ -130,7 +130,7 @@ Events are emitted in a predictable sequence:
|
|
|
130
130
|
|
|
131
131
|
`message_update` events stream as chunks arrive — expect many per message. `tool_execution_update` events are optional (only emitted for tools that report progress).
|
|
132
132
|
|
|
133
|
-
Auto-compaction and auto-retry events can appear between turns. Background lifecycle events are asynchronous: `background_agent_start` is emitted immediately, then an enabled `subagent_arbitration` record appears before that child's first `background_agent_event`; a failed arbitration is followed by `background_agent_end` without any child event.
|
|
133
|
+
Auto-compaction and auto-retry events can appear between turns. Background lifecycle events are asynchronous: `background_agent_start` is emitted immediately, then an enabled `subagent_arbitration` record appears before that child's first `background_agent_event`; a failed arbitration is followed by `background_agent_end` without any child event. `background_agent_end.cancelled` is `true` when the user stopped the agent (then `success` is `false`).
|
|
134
134
|
|
|
135
135
|
## Example
|
|
136
136
|
|
package/docs/rpc.md
CHANGED
|
@@ -156,7 +156,9 @@ See [set_follow_up_mode](#set_follow_up_mode) for controlling how follow-up mess
|
|
|
156
156
|
|
|
157
157
|
#### abort
|
|
158
158
|
|
|
159
|
-
Abort the current agent operation.
|
|
159
|
+
Abort the current agent operation. This also stops **every** running background agent of this session (like Esc in the TUI); to stop a single child, use [`abort_background_agent`](#abort_background_agent).
|
|
160
|
+
|
|
161
|
+
Background agents are stopped gracefully: each child first receives an RPC `abort` so its own run (including any running tools — e.g. the bash tool kills its process group) unwinds, then it is terminated with SIGTERM, with a SIGKILL backstop if it is still alive. A child whose run had not started yet when it handled the abort (it was still booting or preparing its prompt) is sent the abort again as soon as that run starts, so it cannot run tools after the stop. A child that does not finish within a short grace period is terminated anyway. Stopped agents report `status: "cancelled"` and `background_agent_end` with `cancelled: true`.
|
|
160
162
|
|
|
161
163
|
```json
|
|
162
164
|
{"type": "abort"}
|
|
@@ -1149,7 +1151,7 @@ Each session has the same fields as `list_sessions`.
|
|
|
1149
1151
|
|
|
1150
1152
|
#### list_background_agents
|
|
1151
1153
|
|
|
1152
|
-
List background subagents tracked by this process's registry — running and recently completed (finished entries are pruned after ~5 minutes). `sessionDir` is the concrete per-launch directory under the global-only configured `subagentSessionDir` (or the legacy default); `sessionFile` appears once the child process exits. On a resumed parent, startup rehydration scans the configured write root first and the legacy `<agent-dir>/subagent-sessions` root second when different, skips absent roots, and deduplicates canonical paths. Files are not migrated. Live transcripts are delivered via `background_agent_event` events (see Events), not by reading these paths.
|
|
1154
|
+
List background subagents tracked by this process's registry — running and recently completed (finished entries are pruned after ~5 minutes). `status` is `"running"`, `"completed"`, `"failed"` (the child errored), or `"cancelled"` (stopped by the user via `abort_background_agent`, `abort`, or Esc). A user stop is recorded as a `cancelled.json` marker in the agent's `sessionDir`. Rehydration reports such agents as `"cancelled"`, including chains stopped between steps, children terminated after the grace period, and agents stopped while queued or before spawning. Those last ones have no `sessionFile` and are recovered from the marker alone. A rehydrated child without a marker whose last assistant message was aborted is also reported as `"cancelled"`. `sessionDir` is the concrete per-launch directory under the global-only configured `subagentSessionDir` (or the legacy default); `sessionFile` appears once the child process exits. On a resumed parent, startup rehydration scans the configured write root first and the legacy `<agent-dir>/subagent-sessions` root second when different, skips absent roots, and deduplicates canonical paths. Files are not migrated. Live transcripts are delivered via `background_agent_event` events (see Events), not by reading these paths.
|
|
1153
1155
|
|
|
1154
1156
|
```json
|
|
1155
1157
|
{"type": "list_background_agents"}
|
|
@@ -1195,6 +1197,21 @@ Read the selected live child's authoritative pending queues and effective steeri
|
|
|
1195
1197
|
|
|
1196
1198
|
The response data is `{ "steeringMode": "one-at-a-time" | "all", "pending": RpcPendingMessages }`. Multiple `steer_background_agent` commands therefore use the target child's existing queue semantics.
|
|
1197
1199
|
|
|
1200
|
+
#### abort_background_agent
|
|
1201
|
+
|
|
1202
|
+
Stop exactly one running background agent (a user stop — e.g. the dashboard subagent view's ■ stop). The parent's run, its queues, and sibling agents are untouched. Works for a child that is executing, waiting for a concurrency slot (it settles immediately without taking a slot), or between chain steps; a chain is stopped as a whole and no later step starts. The child is stopped gracefully as described under [`abort`](#abort).
|
|
1203
|
+
|
|
1204
|
+
```json
|
|
1205
|
+
{"type":"abort_background_agent","agentId":"a1b2c3d4e5f6"}
|
|
1206
|
+
```
|
|
1207
|
+
|
|
1208
|
+
Response:
|
|
1209
|
+
```json
|
|
1210
|
+
{"type": "response", "command": "abort_background_agent", "success": true}
|
|
1211
|
+
```
|
|
1212
|
+
|
|
1213
|
+
The response confirms the stop was initiated; completion arrives as `background_agent_end` with `cancelled: true`, and the agent's status becomes `"cancelled"` immediately. The parent receives a `<background-agent-complete> … cancelled` message (with any partial output) in its context **without** a new parent turn — if it was the last running agent the parent stays idle until prompted. If the parent is busy, the message is held and appended once it is idle again. Busy means mid-run, still saving the run's last events, waiting on an auto-retry, or compacting. That way it never splits a tool call from its result or lands ahead of messages not yet saved. A held message is normally appended before the next prompt starts a turn. A prompt sent while the parent is still busy (for example during an auto-retry backoff) starts its turn first, and the message is appended when that turn ends. If the session is replaced first (new session, switch, or fork), the message is saved to the session it belongs to. Any steering still queued in the child is discarded with it. The command fails (`success: false`) for unknown agents and agents that are no longer running (completed, failed, already cancelled, or rehydrated); it never falls back to the parent or another child.
|
|
1214
|
+
|
|
1198
1215
|
#### list_agent_types
|
|
1199
1216
|
|
|
1200
1217
|
List discoverable subagent types for the effective runtime working directory. This includes package-bundled agents, user-level agents, and project-level agents in `.dreb/agents/*.md`. Results are sorted by `name`.
|
|
@@ -1592,7 +1609,7 @@ Valid keys and values:
|
|
|
1592
1609
|
| `trustedContextFolders` | Replaces the global list atomically. Array of non-empty paths that expand to absolute, existing directories; each is canonicalized with native `realpath`, then deduplicated/subsumed. Relative, missing, non-directory, and broken-symlink entries are rejected. |
|
|
1593
1610
|
| `transport` | `"sse"`, `"websocket"`, `"auto"` |
|
|
1594
1611
|
| `hideThinkingBlock` | boolean |
|
|
1595
|
-
| `singleModelMode` | boolean; default `false`. When `true`, every subagent runs on the parent session's model — per-invocation overrides, per-agent model lists, agent-definition models, and the dispatch arbiter are bypassed, and any requested model selection is reported as a warning
|
|
1612
|
+
| `singleModelMode` | boolean; default `false`. When `true`, every subagent runs on the parent session's model — per-invocation overrides, per-agent model lists, agent-definition models, and the dispatch arbiter are bypassed, and any requested model selection is reported as a warning just before the child's output |
|
|
1596
1613
|
| `agentModels` | Plain object mapping agent names to arrays of non-empty model id strings; empty arrays remove the global entry for that agent |
|
|
1597
1614
|
| `enabledModels` | Non-empty ordered array of available exact `provider/model` references, or explicit `null` to remove the global filter and restore implicit all. Duplicate, glob, fuzzy, and thinking-suffix entries are rejected. |
|
|
1598
1615
|
| `subagentArbiter` | Complete global-only object or `null`. Keys: `enabled` boolean, exact available `model`, optional valid/capability-supported `thinking`, non-empty `guidePath`. Enabling requires `model`. Unknown nested keys are rejected. |
|
|
@@ -1796,7 +1813,7 @@ Response:
|
|
|
1796
1813
|
| `auto_retry_start` | Auto-retry begins (after transient error) |
|
|
1797
1814
|
| `auto_retry_end` | Auto-retry completes (success or final failure) |
|
|
1798
1815
|
| `background_agent_start` | Background subagent launched (includes `sessionDir`) |
|
|
1799
|
-
| `background_agent_end` | Background subagent finished (canonical model/thinking, per-step chain metadata, and `sessionFile` when known) |
|
|
1816
|
+
| `background_agent_end` | Background subagent finished or was stopped (`cancelled`, canonical model/thinking, per-step chain metadata, and `sessionFile` when known) |
|
|
1800
1817
|
| `background_agent_event` | Relayed event from a background subagent's own stream |
|
|
1801
1818
|
| `parent_paused_for_background_agents` | Parent paused waiting on background agents |
|
|
1802
1819
|
| `session_name_changed` | Session display name changed (manual rename, extension rename, or auto-title) |
|
|
@@ -2058,7 +2075,7 @@ When the global Dispatch Arbiter is enabled, `subagent_arbitration` fires after
|
|
|
2058
2075
|
|
|
2059
2076
|
The event is deliberately safe and programmatic: it never contains the task, guide, conversation context, prompt, raw response, or model reasoning. The parent session persists the same fields as a non-context `custom` entry. Consumers should update displayed background-agent identity from `final.agent` before child events arrive.
|
|
2060
2077
|
|
|
2061
|
-
`background_agent_end` fires after the result is delivered to the parent agent. For a single child it includes the canonical resolved `provider/model` and effective thinking level when reported; `sessionFile` is the child's session JSONL path when one was written:
|
|
2078
|
+
`background_agent_end` fires after the result is delivered to the parent agent. A cancellation that arrives while the parent is busy is queued for delivery, as described under [`abort_background_agent`](#abort_background_agent). `cancelled` is `true` when the user stopped the agent (`abort_background_agent`, `abort`, or Esc); `success` is `true` only for a clean, non-cancelled finish. For a single child it includes the canonical resolved `provider/model` and effective thinking level when reported; `sessionFile` is the child's session JSONL path when one was written:
|
|
2062
2079
|
|
|
2063
2080
|
```json
|
|
2064
2081
|
{
|
|
@@ -2066,6 +2083,7 @@ The event is deliberately safe and programmatic: it never contains the task, gui
|
|
|
2066
2083
|
"agentId": "a1b2c3d4e5f6",
|
|
2067
2084
|
"agentType": "Explore",
|
|
2068
2085
|
"success": true,
|
|
2086
|
+
"cancelled": false,
|
|
2069
2087
|
"model": "anthropic/claude-sonnet-4-20250514",
|
|
2070
2088
|
"thinking": "medium",
|
|
2071
2089
|
"sessionFile": "/home/user/.dreb/agent/subagent-sessions/a1b2c3d4e5f6/2026-07-07T12-00-00-000Z_uuid.jsonl"
|
|
@@ -2080,6 +2098,7 @@ Chain completions omit ambiguous scalar model/thinking fields and instead includ
|
|
|
2080
2098
|
"agentId": "a1b2c3d4e5f6",
|
|
2081
2099
|
"agentType": "Explore",
|
|
2082
2100
|
"success": true,
|
|
2101
|
+
"cancelled": false,
|
|
2083
2102
|
"steps": [
|
|
2084
2103
|
{"step": 1, "agent": "Explore", "success": true, "model": "anthropic/claude-sonnet-4-6", "thinking": "low"},
|
|
2085
2104
|
{"step": 2, "agent": "feature-dev", "success": true, "model": "openai/gpt-5.6-sol", "thinking": "high"}
|
package/docs/settings.md
CHANGED
|
@@ -19,7 +19,7 @@ Edit directly or use `/settings` for common options.
|
|
|
19
19
|
| `defaultModel` | string | - | Default model ID |
|
|
20
20
|
| `defaultThinkingLevel` | string | - | `"off"`, `"minimal"`, `"low"`, `"medium"`, `"high"`, `"xhigh"`, `"max"` |
|
|
21
21
|
| `hideThinkingBlock` | boolean | `false` | Hide thinking blocks in output |
|
|
22
|
-
| `singleModelMode` | boolean | `false` | Force every subagent to run on the parent session's model — per-invocation overrides, per-agent model lists, agent-definition models, and the dispatch arbiter are bypassed, and any requested model selection is reported as a warning
|
|
22
|
+
| `singleModelMode` | boolean | `false` | Force every subagent to run on the parent session's model — per-invocation overrides, per-agent model lists, agent-definition models, and the dispatch arbiter are bypassed, and any requested model selection is reported as a warning just before the child's output. See [agent-models.md](agent-models.md#single-model-mode) |
|
|
23
23
|
| `thinkingBudgets` | object | - | Custom token budgets per thinking level |
|
|
24
24
|
| `agentModels.models` | object | - | Per-agent model fallback lists for subagents (map of agent name → ordered model IDs). See [agent-models.md](agent-models.md) |
|
|
25
25
|
| `modelSettings` | object | - | Per-model thinking-display and provider/model system-prompt overrides. See [modelSettings](#modelsettings) |
|