@trim21/personal-pi-extensions 0.0.281 → 0.0.283
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/package.json +1 -1
- package/src/spawn-agent.ts +8 -4
package/package.json
CHANGED
package/src/spawn-agent.ts
CHANGED
|
@@ -13,8 +13,9 @@
|
|
|
13
13
|
* Progress is a rolling log: `tool: <name>` lines for tool calls and
|
|
14
14
|
* `text: <content>` lines for completed text blocks, keeping the last
|
|
15
15
|
* `MAX_PROGRESS_LINES` lines. Consecutive tool calls are merged into a
|
|
16
|
-
* single `tool:` line (`read x 2, glob`)
|
|
17
|
-
*
|
|
16
|
+
* single `tool:` line (`read x 2, glob`) and line content is capped at
|
|
17
|
+
* `MAX_PROGRESS_CHARS_PER_LINE` characters, so a burst of tool calls or a long
|
|
18
|
+
* text block does not flood the window; any text block starts a new line.
|
|
18
19
|
*
|
|
19
20
|
* Security default: without an explicit `tools:` in the frontmatter, the
|
|
20
21
|
* subagent only gets read-only tools (read/grep/find/ls) — no bash/write/edit.
|
|
@@ -50,6 +51,8 @@ const MAX_OUTPUT_BYTES = 50 * 1024;
|
|
|
50
51
|
const DEFAULT_TOOLS = ["read", "grep", "find", "ls"];
|
|
51
52
|
/** Progress log keeps only the most recent lines (rolling window). */
|
|
52
53
|
const MAX_PROGRESS_LINES = 5;
|
|
54
|
+
/** Progress line content (without the `tool:` / `text:` prefix) is capped at 50 chars. */
|
|
55
|
+
const MAX_PROGRESS_CHARS_PER_LINE = 50;
|
|
53
56
|
|
|
54
57
|
/**
|
|
55
58
|
* Tool → extension override map: when a subagent's frontmatter enables a
|
|
@@ -375,7 +378,8 @@ export async function runAgent(
|
|
|
375
378
|
toolLineSegments.push(toolSegment(toolLine.name, toolLine.count));
|
|
376
379
|
toolLine = { name, count: 1 };
|
|
377
380
|
}
|
|
378
|
-
const
|
|
381
|
+
const parts = [...toolLineSegments, toolSegment(toolLine.name, toolLine.count)].join(", ");
|
|
382
|
+
const line = `tool: ${parts.slice(0, MAX_PROGRESS_CHARS_PER_LINE)}`;
|
|
379
383
|
if (firstInBatch) {
|
|
380
384
|
logLines.push(line);
|
|
381
385
|
if (logLines.length > MAX_PROGRESS_LINES) {
|
|
@@ -458,7 +462,7 @@ export async function runAgent(
|
|
|
458
462
|
// `text:` log line. Deltas/thinking are intentionally not logged.
|
|
459
463
|
const delta = event.assistantMessageEvent;
|
|
460
464
|
if (delta.type === "text_end") {
|
|
461
|
-
pushLogLine(`text: ${delta.content}`);
|
|
465
|
+
pushLogLine(`text: ${delta.content.slice(0, MAX_PROGRESS_CHARS_PER_LINE)}`);
|
|
462
466
|
emitUpdate();
|
|
463
467
|
}
|
|
464
468
|
|