@dreb/coding-agent 2.23.0 → 2.25.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.
Files changed (43) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/README.md +2 -0
  3. package/dist/core/agent-session.d.ts +11 -0
  4. package/dist/core/agent-session.d.ts.map +1 -1
  5. package/dist/core/agent-session.js +35 -2
  6. package/dist/core/agent-session.js.map +1 -1
  7. package/dist/core/extensions/index.d.ts +1 -1
  8. package/dist/core/extensions/index.d.ts.map +1 -1
  9. package/dist/core/extensions/index.js.map +1 -1
  10. package/dist/core/extensions/types.d.ts +14 -1
  11. package/dist/core/extensions/types.d.ts.map +1 -1
  12. package/dist/core/extensions/types.js.map +1 -1
  13. package/dist/core/sdk.d.ts.map +1 -1
  14. package/dist/core/sdk.js +4 -0
  15. package/dist/core/sdk.js.map +1 -1
  16. package/dist/core/settings-manager.d.ts +14 -0
  17. package/dist/core/settings-manager.d.ts.map +1 -1
  18. package/dist/core/settings-manager.js +41 -0
  19. package/dist/core/settings-manager.js.map +1 -1
  20. package/dist/core/tools/index.d.ts +1 -1
  21. package/dist/core/tools/index.d.ts.map +1 -1
  22. package/dist/core/tools/index.js +1 -1
  23. package/dist/core/tools/index.js.map +1 -1
  24. package/dist/core/tools/subagent.d.ts +5 -1
  25. package/dist/core/tools/subagent.d.ts.map +1 -1
  26. package/dist/core/tools/subagent.js +51 -13
  27. package/dist/core/tools/subagent.js.map +1 -1
  28. package/dist/modes/interactive/components/settings-selector.d.ts +36 -1
  29. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  30. package/dist/modes/interactive/components/settings-selector.js +195 -1
  31. package/dist/modes/interactive/components/settings-selector.js.map +1 -1
  32. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  33. package/dist/modes/interactive/interactive-mode.js +51 -1
  34. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  35. package/dist/modes/interactive/tab-title.d.ts +5 -0
  36. package/dist/modes/interactive/tab-title.d.ts.map +1 -1
  37. package/dist/modes/interactive/tab-title.js +6 -0
  38. package/dist/modes/interactive/tab-title.js.map +1 -1
  39. package/docs/agent-models.md +64 -0
  40. package/docs/extensions.md +13 -0
  41. package/docs/mach6.md +2 -0
  42. package/docs/settings.md +18 -0
  43. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -34,10 +34,14 @@
34
34
  - `/copy` now opens a multi-select message picker instead of copying only the last assistant message. All message types are listed (user, assistant, tool results, bash executions, branch/compaction summaries, custom). Navigate with arrow keys, toggle selection with Space, select-all with Ctrl+A, confirm with Enter. Copies source text without wrap-induced line breaks. Status message distinguishes between native clipboard and OSC 52 (SSH/mosh) delivery. New `app.clipboard.copyMessages` keybinding (Ctrl+Shift+C) opens the picker directly. ([#217](https://github.com/aebrer/dreb/issues/217))
35
35
  - Added TUI handling for `stream_retry` events: stale streaming components are removed, a retry spinner with attempt count is shown, and `agent_end` unconditionally clears retry state. ([#230](https://github.com/aebrer/dreb/issues/230))
36
36
  - Added `stream_retry` to the extension event surface so extensions can observe and react to provider stream retries. ([#230](https://github.com/aebrer/dreb/issues/230))
37
+ - Added TUI handling for `length_retry` events: when a response is truncated at the model's token limit, stale streaming components are removed and a retry spinner shows "Response truncated, retrying with larger token budget" with attempt count. Reuses the same retry-state cleanup as `stream_retry`. ([#240](https://github.com/aebrer/dreb/issues/240))
38
+ - Added `length_retry` to the extension event surface so extensions can observe and react to token-budget truncation retries. Carries `attempt`, `maxAttempts`, `previousMaxTokens`, `nextMaxTokens`, and an optional `discardedPartial`. ([#240](https://github.com/aebrer/dreb/issues/240))
37
39
  - Added `/dream` memory consolidation command — backs up all memory directories, merges duplicates, scans session history for unrecorded patterns, prunes stale entries, and validates links. Uses tar.gz archives with retention policy (keep last 10), lockfile-based concurrency protection, and a 10-step LLM pipeline with explicit backup verification. Configurable archive path via `dream.archivePath` setting. ([#99](https://github.com/aebrer/dreb/issues/99))
38
40
 
39
41
  ### Fixed
40
42
 
43
+ - Fixed subagents silently returning empty results when a child's final response was truncated at the model's token limit. The subagent spawn handler now inspects the last assistant message's `stopReason`: a clean exit with no output now surfaces a descriptive error (truncation, loud truncation failure, or "completed with no output") instead of a silent empty string, and a clean exit with partial output now flags the truncation via `errorMessage` while preserving the partial text — covering both raw `length` truncation and the loud `error` stopReason produced when the core agent loop exhausts its length retries. The parent renders these errors even on a clean (exit code 0) exit. ([#240](https://github.com/aebrer/dreb/issues/240))
44
+
41
45
  - Fixed ghost whitespace appearing after the TUI content shrinks (e.g., closing the copy selector, filtering slash-command autocomplete, editor line deletion). The differential renderer now triggers a full screen redraw when content shrinks instead of clearing extra lines individually, which some terminals would not collapse. ([#217](https://github.com/aebrer/dreb/issues/217))
42
46
 
43
47
  - Added missing `ajv` direct dependency; previously relied on transitive install via `@mariozechner/pi-ai` which broke standalone installs ([#2252](https://github.com/badlogic/pi-mono/issues/2252))
package/README.md CHANGED
@@ -359,6 +359,8 @@ The `subagent` tool delegates tasks to independent child agent processes. Each s
359
359
 
360
360
  **Model availability probes:** When an agent definition specifies a fallback list (comma-separated models), each model is verified with a lightweight API call via the same `streamSimple` path the agent loop uses before the subagent is spawned. The probe uses normal coding-agent thinking defaults and does not pass a synthetic `maxTokens` override, which keeps the request shape representative for reasoning models as well as non-reasoning models. Models that fail the probe (rate limit, quota exhaustion, auth failure, timeout) are skipped with a loud log line, and the next fallback is tried. If all configured models fail, the parent session's model is used as a last resort. Per-invocation model overrides and single-model configs skip probing entirely.
361
361
 
362
+ **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).
363
+
362
364
  **Session metadata:** Each child process records its agent type in the session JSONL header (`agentType` field), providing an audit trail of which agent definition executed the work.
363
365
 
364
366
  ---
@@ -246,6 +246,17 @@ export declare class AgentSession {
246
246
  * Used after both initial load (sdk.ts) and user-initiated reload.
247
247
  */
248
248
  warnResourceDiagnostics(resourceLoader: ResourceLoader): void;
249
+ /**
250
+ * Detect agentModels settings keys that reference agents which no longer exist
251
+ * (e.g. an upstream agent was renamed or removed) and surface a LOUD warning.
252
+ *
253
+ * Such keys are silently ignored during resolution — getAgentModelsForAgent
254
+ * never matches them — so without this check a stale override would vanish
255
+ * with no signal to the user. The agent-name keys must match exactly how
256
+ * discoverAgentTypes keys agents (case-sensitive, e.g. "Explore"), which is
257
+ * the same lookup getAgentModelsForAgent uses.
258
+ */
259
+ warnStaleAgentModelKeys(): void;
249
260
  /**
250
261
  * Surface a warning in the session so both the human and the AI agent can see it.
251
262
  * During streaming: steers the warning as a user message into the conversation.