@dreb/coding-agent 2.72.0 → 2.73.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 +2 -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 +46 -3
- package/docs/json.md +2 -2
- package/docs/rpc.md +24 -5
- package/docs/settings.md +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -398,7 +398,7 @@ Task tracking is prompt-driven: the system prompt includes guidelines for when t
|
|
|
398
398
|
|
|
399
399
|
## Subagents
|
|
400
400
|
|
|
401
|
-
The optional `subagent` tool runs focused, role-matched work in independent child agent processes. Each subagent runs in its own process with its own context window, and notifies the parent when complete. In the dashboard, a live child's transcript view can accept the user's own steering messages directly; repeated messages use that child's configured one-at-a-time or all-at-once steering queue. Completed and rehydrated transcripts remain read-only.
|
|
401
|
+
The optional `subagent` tool runs focused, role-matched work in independent child agent processes. Each subagent runs in its own process with its own context window, and notifies the parent when complete. In that notification the child's own output sits between `--- agent output ---` and `--- end of agent output ---` lines (`--- agent output (partial) ---` when the child was cancelled or failed). System lines such as execution metadata, warnings, errors, and the session log stay outside those lines. A chain delimits each step's output. In the dashboard, a live child's transcript view can accept the user's own steering messages directly; repeated messages use that child's configured one-at-a-time or all-at-once steering queue. Its ■ stop cancels just that child — the parent and other subagents keep running, and the parent gets a cancellation notice (with any partial output) without being woken. Esc in the TUI (or the parent's stop) cancels all running subagents. Stops are graceful: the child aborts its own run first, so running tools such as a hung bash command are killed rather than orphaned. Completed, cancelled, and rehydrated transcripts remain read-only.
|
|
402
402
|
|
|
403
403
|
When `agent` is omitted, dreb selects the default `Explore` agent. Explore retrieves concrete, bounded evidence: files, symbols, documentation, call sites, exact snippets, tests for a named behavior, and explicitly named data flows. The primary agent must synthesize that evidence and owns root-cause diagnosis, ambiguous-requirement interpretation, architecture/design decisions, implementation recommendations, planning, and final conclusions.
|
|
404
404
|
|
|
@@ -419,7 +419,7 @@ Set `backgroundAgents.maxConcurrentSubagents` in `/settings`, dashboard Settings
|
|
|
419
419
|
|
|
420
420
|
**Per-agent model overrides:** The model used by each agent type can be overridden via the `agentModels.models` setting (a map of agent name → ordered fallback list) without copying or editing the agent definition `.md` files. Configure it in `settings.json` or via `/settings` → **Agent Models**. Resolution order: per-invocation `model` override → `agentModels` setting → agent definition `model` → parent session model. See [docs/agent-models.md](docs/agent-models.md).
|
|
421
421
|
|
|
422
|
-
**Single model mode:** The `singleModelMode` setting (default `false`) forces every subagent to run on the parent session's model. When enabled, per-invocation `model` overrides, `agentModels` fallback lists, agent-definition models, spawn-time probes, and the dispatch arbiter are all bypassed, and any requested model selection — even one identical to the parent's — is reported to the parent
|
|
422
|
+
**Single model mode:** The `singleModelMode` setting (default `false`) forces every subagent to run on the parent session's model. When enabled, per-invocation `model` overrides, `agentModels` fallback lists, agent-definition models, spawn-time probes, and the dispatch arbiter are all bypassed, and any requested model selection — even one identical to the parent's — is reported to the parent as a `[WARNING: ...]` note just before the child's output. If nothing requested a model, no warning appears. If the parent session has no model, the spawn fails loudly. Configure it in the TUI (`/settings`), dashboard Settings, or `settings.json`. See [docs/agent-models.md](docs/agent-models.md#single-model-mode).
|
|
423
423
|
|
|
424
424
|
**Optional Dispatch Arbiter:** A global-only `subagentArbiter` setting can enable a fully headless, direct model call after the proposal above resolves but before each child process spawns. It uses the validated routing guide, live explicit model scope, and bounded title-setter-style parent activity including useful tool outputs; existing secret scrubbing applies before inference. It may change only the existing agent type, exact scoped provider/model, and supported thinking level. It has no tools, cannot rewrite the task/cwd or agent definitions, and fails closed on configuration, guide, scope, inference, output, or validation errors. It runs once per single/parallel child and after `{previous}` substitution for every chain step. Interactive `/settings` and dashboard Settings both expose enable/disable, exact model selection, thinking, guide path, and loud readiness/validation feedback. Safe typed changed/unchanged/failure records are persisted outside parent model context and relayed to the TUI, JSON/RPC, and dashboard. See [Dispatch Arbiter](docs/agent-models.md#dispatch-arbiter) and [settings](docs/settings.md#dispatch-arbiter).
|
|
425
425
|
|
|
@@ -71,7 +71,10 @@ export type AgentSessionEvent = AgentEvent | SubagentArbitrationEvent | {
|
|
|
71
71
|
type: "background_agent_end";
|
|
72
72
|
agentId: string;
|
|
73
73
|
agentType: string;
|
|
74
|
+
/** True only for a clean, non-cancelled finish (always false when `cancelled`). */
|
|
74
75
|
success: boolean;
|
|
76
|
+
/** True when the user stopped the agent (single-agent stop or stop-all). */
|
|
77
|
+
cancelled: boolean;
|
|
75
78
|
model?: string;
|
|
76
79
|
thinking?: ThinkingLevel;
|
|
77
80
|
steps?: SubagentStepMetadata[];
|
|
@@ -199,6 +202,11 @@ export declare class AgentSession {
|
|
|
199
202
|
private _unsubscribeAgent?;
|
|
200
203
|
private _eventListeners;
|
|
201
204
|
private _agentEventQueue;
|
|
205
|
+
/**
|
|
206
|
+
* Agent events queued on `_agentEventQueue` that haven't finished processing yet.
|
|
207
|
+
* Persistence happens there, so the session log lags agent state until this is 0.
|
|
208
|
+
*/
|
|
209
|
+
private _agentEventsInFlight;
|
|
202
210
|
/** Tracks pending steering messages for UI display. Removed when delivered. */
|
|
203
211
|
private _steeringMessages;
|
|
204
212
|
/** Tracks pending follow-up messages for UI display. Removed when delivered. */
|
|
@@ -219,6 +227,14 @@ export declare class AgentSession {
|
|
|
219
227
|
private _retryResolve;
|
|
220
228
|
private _bashAbortController;
|
|
221
229
|
private _pendingBashMessages;
|
|
230
|
+
/**
|
|
231
|
+
* Background-agent cancellation notices that arrived while the parent was busy (see
|
|
232
|
+
* `_canDeliverCancellationNotices`). Appending them then could land a user message
|
|
233
|
+
* between an assistant tool call and its result, or ahead of messages not yet persisted.
|
|
234
|
+
* They are held until the parent is idle again, or are persisted to their session before
|
|
235
|
+
* it is replaced.
|
|
236
|
+
*/
|
|
237
|
+
private _pendingCancellationNotices;
|
|
222
238
|
private _extensionRunner;
|
|
223
239
|
private _turnIndex;
|
|
224
240
|
private _resourceLoader;
|
|
@@ -742,6 +758,24 @@ export declare class AgentSession {
|
|
|
742
758
|
get isBashRunning(): boolean;
|
|
743
759
|
/** Whether there are pending bash messages waiting to be flushed */
|
|
744
760
|
get hasPendingBashMessages(): boolean;
|
|
761
|
+
/**
|
|
762
|
+
* Whether deferred cancellation notices can be appended now without landing inside
|
|
763
|
+
* work that is still changing the transcript. Not while the agent streams, while
|
|
764
|
+
* earlier agent events are still being processed or persisted (the session log would
|
|
765
|
+
* get the notice ahead of them), while an auto-retry is pending (its backoff or the
|
|
766
|
+
* retried run), or while compaction or branch summarization runs.
|
|
767
|
+
*/
|
|
768
|
+
private _canDeliverCancellationNotices;
|
|
769
|
+
/**
|
|
770
|
+
* Append deferred background-agent cancellation notices to agent state and the session
|
|
771
|
+
* log, in arrival order, and render them, if the parent is idle (see
|
|
772
|
+
* `_canDeliverCancellationNotices`). Otherwise they stay queued. They are retried after
|
|
773
|
+
* each processed agent event (`_processAgentEvent`), before the next prompt, and after manual compaction or
|
|
774
|
+
* branch navigation. Never triggers a response.
|
|
775
|
+
*/
|
|
776
|
+
private _flushPendingCancellationNotices;
|
|
777
|
+
private _appendPendingCancellationNotices;
|
|
778
|
+
private _persistPendingCancellationNoticesBeforeSessionChange;
|
|
745
779
|
/**
|
|
746
780
|
* Flush pending bash messages to agent state and session.
|
|
747
781
|
* Called after agent turn completes to maintain proper message ordering.
|