@aragon-agent/cli 0.6.28 → 0.6.31
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 +2123 -1975
- package/README.md +81 -14
- package/dist/agent/project-guidance-prompt.js +20 -20
- package/dist/agent/reducer.js +47 -2
- package/dist/cli.js +169 -56
- package/dist/commands/builtins.js +4 -0
- package/dist/commands/perf.d.ts +25 -1
- package/dist/commands/perf.js +26 -2
- package/dist/commands/registry.d.ts +6 -0
- package/dist/config/env.js +4 -0
- package/dist/config/load.d.ts +3 -1
- package/dist/config/load.js +12 -1
- package/dist/config/schema.d.ts +27 -0
- package/dist/config/schema.js +9 -0
- package/dist/config/ui-state.d.ts +9 -0
- package/dist/config/ui-state.js +9 -0
- package/dist/input/limits.d.ts +20 -0
- package/dist/input/limits.js +20 -0
- package/dist/input/stdin-filter.js +68 -5
- package/dist/ui/App.d.ts +11 -1
- package/dist/ui/App.js +155 -67
- package/dist/ui/AutocompletePopup.js +1 -1
- package/dist/ui/Header.js +7 -2
- package/dist/ui/Markdown.js +30 -3
- package/dist/ui/PromptInput.js +41 -3
- package/dist/ui/ScrollbackShell.d.ts +28 -0
- package/dist/ui/ScrollbackShell.js +10 -0
- package/dist/ui/Transcript.js +7 -0
- package/dist/ui/frame-differ.d.ts +12 -0
- package/dist/ui/layout/Gutter.js +1 -1
- package/dist/ui/layout/OverlayFrame.d.ts +15 -0
- package/dist/ui/layout/OverlayFrame.js +18 -0
- package/dist/ui/layout/ScrollIndicator.js +10 -3
- package/dist/ui/layout/budget.d.ts +15 -0
- package/dist/ui/layout/budget.js +15 -0
- package/dist/ui/layout/header-hints.d.ts +9 -0
- package/dist/ui/layout/header-hints.js +14 -1
- package/dist/ui/layout/status-layout.js +63 -2
- package/dist/ui/markdown-blocks.d.ts +26 -5
- package/dist/ui/markdown-blocks.js +110 -33
- package/dist/ui/overlays/HelpOverlay.d.ts +1 -1
- package/dist/ui/overlays/HelpOverlay.js +21 -3
- package/dist/ui/screen.d.ts +16 -0
- package/dist/ui/screen.js +32 -0
- package/dist/ui/scrollback/budget.d.ts +43 -0
- package/dist/ui/scrollback/budget.js +44 -0
- package/dist/ui/scrollback/drain.d.ts +32 -0
- package/dist/ui/scrollback/drain.js +64 -0
- package/dist/ui/scrollback/exit-summary.d.ts +23 -0
- package/dist/ui/scrollback/exit-summary.js +25 -0
- package/dist/ui/scrollback/limits.d.ts +25 -0
- package/dist/ui/scrollback/limits.js +25 -0
- package/dist/ui/scrollback/live-preview.d.ts +26 -0
- package/dist/ui/scrollback/live-preview.js +106 -0
- package/dist/ui/scrollback/renderer.d.ts +38 -0
- package/dist/ui/scrollback/renderer.js +158 -0
- package/dist/ui/scrollback/scrollback-writer.d.ts +74 -0
- package/dist/ui/scrollback/scrollback-writer.js +263 -0
- package/dist/ui/scrollback/settled-boundary.d.ts +42 -0
- package/dist/ui/scrollback/settled-boundary.js +106 -0
- package/dist/ui/scrollback/use-scrollback-view.d.ts +92 -0
- package/dist/ui/scrollback/use-scrollback-view.js +263 -0
- package/dist/ui/scrollback/writer-shapes.d.ts +61 -0
- package/dist/ui/scrollback/writer-shapes.js +114 -0
- package/dist/ui/stdout-frame-writer.js +12 -2
- package/dist/ui/terminal-plan.d.ts +52 -0
- package/dist/ui/terminal-plan.js +49 -0
- package/dist/ui/transcript-text.d.ts +11 -0
- package/dist/ui/transcript-text.js +21 -7
- package/dist/ui/use-startup-notices.d.ts +12 -1
- package/dist/ui/use-startup-notices.js +28 -2
- package/dist/ui/use-wheel-routing.d.ts +10 -7
- package/dist/ui/use-wheel-routing.js +11 -6
- package/package.json +2 -2
- package/skills/project-indexer/SKILL.md +163 -163
- package/skills/project-indexer/templates/cleancode-overrides.md +46 -46
- package/skills/project-indexer/templates/cleancode-template.md +94 -94
- package/skills/project-indexer/templates/config-template.md +69 -69
- package/skills/project-indexer/templates/index-template.md +129 -129
- package/skills/skill-creator/SKILL.md +96 -96
package/README.md
CHANGED
|
@@ -14,6 +14,12 @@ steer / configure the session — all without leaving the terminal.
|
|
|
14
14
|
|
|
15
15
|
Node **≥ 18**, any platform.
|
|
16
16
|
|
|
17
|
+
**The default scrolling mode (`native`, see [Scrolling](#scrolling)) needs no mouse
|
|
18
|
+
support at all**: the conversation is printed into your terminal's own scrollback,
|
|
19
|
+
so the wheel, scrollbar, selection and search are the terminal's. The Windows
|
|
20
|
+
Node-version notes below therefore only matter for `Shift+Tab` and for the optional
|
|
21
|
+
full-screen mode (`--scroll-mode app`), where the application owns the mouse.
|
|
22
|
+
|
|
17
23
|
**On Windows with Node < 22.17.0 (or 24.0/24.1), aragon turns the missing
|
|
18
24
|
console flag on itself at startup**, which restores `Shift+Tab` on most
|
|
19
25
|
machines. Where that is blocked — a locked-down PowerShell, an old console
|
|
@@ -367,6 +373,7 @@ below works there too, in either position — `aragon --model m exec "…"` and
|
|
|
367
373
|
| `--thinking <level>` | `off\|minimal\|low\|medium\|high\|xhigh` |
|
|
368
374
|
| `--max-tokens <n\|auto>` | Output token cap: a number, or `auto` for the model's own ceiling (default `64000`) |
|
|
369
375
|
| `--cwd <dir>` | Working directory for tools |
|
|
376
|
+
| `--scroll-mode <native\|app>` | `native` (default): the terminal scrolls, selects and searches the conversation; `app`: full-screen layout with application-owned scrolling. See [Scrolling](#scrolling) |
|
|
370
377
|
| `--confirm` | Confirm each mutating tool call |
|
|
371
378
|
| `--tool-timeout <ms>` | Per-tool executor ceiling (default 180000) |
|
|
372
379
|
| `--idle-timeout <ms>` | Watchdog idle timeout (auto-raised to ≥ tool-timeout + 30s) |
|
|
@@ -529,11 +536,12 @@ completes, `Up` / `Down` moves the selection, `Esc` closes it.
|
|
|
529
536
|
| `Ctrl+L` | **Branch this session into a new terminal**: opens a PowerShell (Windows) or bash (macOS/Linux) window at the current `/cwd` and runs `aragon --resume <id>` there, so the branch gets its own id and the session you branched from is untouched. Works while the agent is running - the child inherits the last settled turn. Same code path as `/branch` |
|
|
530
537
|
| `Ctrl+R` | Redraw the frame (moved here from `Ctrl+L`, which is now the branch key) |
|
|
531
538
|
| `Ctrl+T` | Show / hide thinking (**off by default**) for the entire session |
|
|
532
|
-
| `Ctrl+O` | Expand / collapse the most recent tool, team, compaction or **service** card — including a diff or a service's log tail |
|
|
533
|
-
| `PgUp` / `PgDn
|
|
534
|
-
| `
|
|
535
|
-
|
|
|
536
|
-
|
|
|
539
|
+
| `Ctrl+O` | Expand / collapse the most recent tool, team, compaction or **service** card — including a diff or a service's log tail. In native scroll mode printed rows cannot change, so it **prints an expanded copy** below instead |
|
|
540
|
+
| Terminal scrolling (native mode, the default) | The wheel, the scrollbar, `Shift+PgUp` / `Shift+PgDn`, text selection and in-terminal search are all your terminal's own — see [Scrolling](#scrolling) |
|
|
541
|
+
| `PgUp` / `PgDn` | Page through an open overlay; in full-screen mode also scroll the transcript a page |
|
|
542
|
+
| `Shift+↑` / `Shift+↓` | Scroll the transcript a line (full-screen mode only) |
|
|
543
|
+
| Mouse wheel | Full-screen mode: scroll the transcript (or the open overlay). On Windows needs Node ≥ 22.17 — see [Requirements](#requirements) |
|
|
544
|
+
| `Shift`+wheel | Full-screen mode: scroll the transcript a page |
|
|
537
545
|
| `Home` / `End`, `Ctrl+A` / `Ctrl+E` | Cursor to line start / end |
|
|
538
546
|
| `Alt/Ctrl+←` / `→` | Word-wise cursor jump |
|
|
539
547
|
| `Ctrl+W`, `Alt+Backspace` | Delete the previous word |
|
|
@@ -542,6 +550,10 @@ completes, `Up` / `Down` moves the selection, `Esc` closes it.
|
|
|
542
550
|
| Paste | Inserted up to 6 lines / 400 chars; larger collapses to `[Pasted text #1 +15 lines]`, which deletes as one unit and expands in full when you send. Escape sequences are removed as sequences (so a coloured log arrives as its text, not as `[38;2;18;52;86m`), and a TAB is kept in the payload but laid out at the terminal's 8-column tab stops, so the draft and the echoed message line up. `--no-paste` restores the pre-0.6.3 behaviour |
|
|
543
551
|
| `?` | Open help (empty input) |
|
|
544
552
|
|
|
553
|
+
Everything from here to the end of this section describes **full-screen mode**
|
|
554
|
+
(`--scroll-mode app`). In the default native mode the application does not capture
|
|
555
|
+
the mouse, so none of it applies.
|
|
556
|
+
|
|
545
557
|
In **full-screen mode**, PgUp/PgDn, Shift+Up/Down and the right-edge scrollbar
|
|
546
558
|
scroll the transcript and its team/queue panels. The input stays fixed and visible.
|
|
547
559
|
Typing or submitting returns the transcript to the newest output without losing the draft.
|
|
@@ -762,7 +774,60 @@ multi-region edit it is strictly smaller, because a change at line 40 and one at
|
|
|
762
774
|
line 900 are now two small hunks instead of 860 removed rows followed by 860
|
|
763
775
|
near-identical added ones.
|
|
764
776
|
|
|
765
|
-
##
|
|
777
|
+
## Scrolling
|
|
778
|
+
|
|
779
|
+
`aragon` has two display modes, chosen by `scrollMode` (`--scroll-mode <native|app>`,
|
|
780
|
+
`ARAGON_SCROLL_MODE`, `aragon config set scrollMode app`; flags > env > file > default).
|
|
781
|
+
|
|
782
|
+
### Native scroll mode (default)
|
|
783
|
+
|
|
784
|
+
The conversation lives in **your terminal's own scrollback**, exactly like the output
|
|
785
|
+
of any other command. Finished messages are printed once, above a small *live
|
|
786
|
+
region* at the bottom of the screen (the streaming preview, the input box and the
|
|
787
|
+
status line). Scrolling, selecting and searching are your terminal's job, on every
|
|
788
|
+
platform: PowerShell, `cmd`, Windows Terminal, VS Code, `bash`, `zsh`, `tmux`,
|
|
789
|
+
iTerm2, Terminal.app, gnome-terminal and friends.
|
|
790
|
+
|
|
791
|
+
- **Wheel, scrollbar, `Shift+PgUp` / `Shift+PgDn`, touchpad inertia** — the terminal's.
|
|
792
|
+
`aragon` does not enter the alternate screen and does not turn on mouse reporting,
|
|
793
|
+
so a Windows console needs no particular Node version for this.
|
|
794
|
+
- **Select and copy with the terminal's own selection** (and its right-click menu,
|
|
795
|
+
double-click-to-select-word, clickable URLs). `/copy` still copies the last answer
|
|
796
|
+
through OSC 52.
|
|
797
|
+
- **Search with the terminal's search** (Windows Terminal `Ctrl+Shift+F`, iTerm2 / Terminal.app `Cmd+F`).
|
|
798
|
+
Under `tmux`, scrolling is tmux's copy mode (`prefix [`).
|
|
799
|
+
- **Your earlier shell output is still above the conversation**, and the conversation
|
|
800
|
+
is still there after you exit. Exiting prints a short summary (session, model,
|
|
801
|
+
time, usage, and the `aragon --resume <id>` line) instead of replaying the
|
|
802
|
+
transcript, because the transcript is already in your scrollback — `exitTranscript`
|
|
803
|
+
is ignored in this mode.
|
|
804
|
+
- **While a reply streams**, the last few lines show in the live region; when the
|
|
805
|
+
message is final it is printed in its formatted shape and the preview disappears
|
|
806
|
+
(a small, intentional "settle" jump). Scrolling up to read earlier output while a
|
|
807
|
+
reply streams is safe; how the viewport behaves when new output arrives is your
|
|
808
|
+
terminal's own "scroll on output" setting.
|
|
809
|
+
- **Printed rows are final.** They are wrapped to the width at which they were
|
|
810
|
+
printed and are never rewritten, so a later window resize does not re-wrap them,
|
|
811
|
+
`Ctrl+T` (thinking) and `/theme` affect only *new* messages, and `Ctrl+O` prints an
|
|
812
|
+
expanded copy of a tool card instead of expanding the old one. `/clear` prints a
|
|
813
|
+
`---- conversation cleared ----` separator; it cannot erase scrollback.
|
|
814
|
+
- **Known limits.** The input box sits directly under the last printed line, so it
|
|
815
|
+
floats mid-screen when the live region shrinks (closing an overlay, a short draft)
|
|
816
|
+
until the next message pushes it down. Narrowing the window of a terminal that
|
|
817
|
+
re-wraps old content can leave a line or two of residue above the input; it never
|
|
818
|
+
loses history. `Ctrl+G`, `/help` and the model picker open as overlays inside the
|
|
819
|
+
live region; the TODO side panel and team panel are not drawn (the status line
|
|
820
|
+
carries `todo` and `team` chips, and `/queue` shows queued messages).
|
|
821
|
+
- **If something looks wrong**, `/perf` has a `scrollback` line (`guardHits`,
|
|
822
|
+
`clippedRows`, `fallbacks`). The one-step escape hatch is
|
|
823
|
+
`aragon config set scrollMode app`, or `--scroll-mode app` for a single run.
|
|
824
|
+
|
|
825
|
+
Requirements are minimal: a terminal that honours cursor-up, erase-down and SGR
|
|
826
|
+
(every terminal from the last 20 years, including the Windows console host).
|
|
827
|
+
`aragon` writes no absolute cursor addressing, no scroll regions, and never the
|
|
828
|
+
sequences that clear scrollback.
|
|
829
|
+
|
|
830
|
+
### Full-screen mode (`--scroll-mode app`)
|
|
766
831
|
|
|
767
832
|
`aragon` takes over the terminal's **alternate screen buffer** — the mechanism
|
|
768
833
|
`vim`, `htop`, and `lazygit` use. Two consequences worth knowing:
|
|
@@ -776,13 +841,14 @@ On exit the session is replayed into the normal buffer as plain text so the
|
|
|
776
841
|
conversation survives leaving the screen (`--no-exit-transcript` opts out;
|
|
777
842
|
`/save` still exports the full JSON).
|
|
778
843
|
|
|
779
|
-
Interactive sessions
|
|
780
|
-
|
|
781
|
-
|
|
844
|
+
Interactive sessions use the TUI in either mode, including under `TERM=dumb` or CI.
|
|
845
|
+
Windows smaller than 40 columns or 12 rows show a size notice and recover when
|
|
846
|
+
enlarged, preserving the session and draft, in both modes.
|
|
782
847
|
|
|
783
|
-
The layout switches `--fullscreen`, `--no-fullscreen`, `ARAGON_FULLSCREEN` and
|
|
784
|
-
`fullscreen` configuration have been removed
|
|
785
|
-
old config fields and environment variables are ignored.
|
|
848
|
+
The old layout switches `--fullscreen`, `--no-fullscreen`, `ARAGON_FULLSCREEN` and
|
|
849
|
+
`fullscreen` configuration have been removed and stay removed: old command-line
|
|
850
|
+
flags are errors; old config fields and environment variables are ignored. Use
|
|
851
|
+
`--scroll-mode` / `scrollMode` instead.
|
|
786
852
|
|
|
787
853
|
Interactive screens require both stdin and stdout to be TTYs. `aragon config`
|
|
788
854
|
without a TTY exits with code 2; use `aragon config list` or `aragon config set`.
|
|
@@ -2194,7 +2260,7 @@ env / `.env` → CLI flags**.
|
|
|
2194
2260
|
`ARAGON_SKILLS_DISABLED` (comma-separated names), `ARAGON_LOG_LEVEL`,
|
|
2195
2261
|
`ARAGON_LOG_FILE` (`0` disables), `ARAGON_LOG_DIR`,
|
|
2196
2262
|
`ARAGON_TRANSCRIPT_RETAIN`, `ARAGON_RENDER_GOVERNOR` (`0` disables),
|
|
2197
|
-
`ARAGON_MAX_RENDER_INTERVAL_MS
|
|
2263
|
+
`ARAGON_MAX_RENDER_INTERVAL_MS`, `ARAGON_SCROLL_MODE` (`native` / `app`).
|
|
2198
2264
|
`ARAGON_HOME` is the exception that **cannot** come from `.env`: it is read
|
|
2199
2265
|
before any `.env` is loaded. See [Files & logs](#files--logs).
|
|
2200
2266
|
- **User config file** (`aragon config path`): JSON, written `0600` on POSIX.
|
|
@@ -2211,7 +2277,8 @@ env / `.env` → CLI flags**.
|
|
|
2211
2277
|
| `contextWindow` | `null` | The window the context gauge measures against, clamped to `[8000, 5000000]`. `null` means **auto** — API metadata, then the built-in catalog. Unknown windows show `?`; the internal fallback is 128000. See [The context gauge](#the-context-gauge). |
|
|
2212
2278
|
| `showThinking` | `false` | Draw the reasoning the model returns. `thinkingLevel` is the effort the provider is asked to **spend**; this is whether the terminal **shows** it. Off by default: a settled turn that thought leaves one muted `thought for 12s` row in its place, so nothing is hidden silently. |
|
|
2213
2279
|
| `liveToolOutput` | `true` | Draw up to eight sanitised rows of a **running** tool's output on its card, plus a `no output for Ns` row when the child goes quiet. On by default, unlike `showThinking`: this ADDS the information a long `bash` call otherwise hides, and its cost is bounded by construction — eight rows per call, sixteen calls, whatever the command emits. Turn it off and the card is a single `running` row again, with no store allocated and no recorder attached. |
|
|
2214
|
-
| `
|
|
2280
|
+
| `scrollMode` | `native` | `native` prints the conversation into your terminal's own scrollback and keeps a small live region at the bottom (the terminal scrolls, selects and searches); `app` is the full-screen layout with application-owned scrolling. `--scroll-mode <native\|app>` or `ARAGON_SCROLL_MODE` overrides it for one run (an invalid flag value exits with code 2; an invalid env value is ignored). See [Scrolling](#scrolling). |
|
|
2281
|
+
| `exitTranscript` | `true` | Replay a plain-text session summary after exiting (full-screen mode only; native mode prints a short summary and ignores it). |
|
|
2215
2282
|
| `transcriptWindow` | `1000` | How far back you can scroll, clamped to `[50, 20000]`. Entries beyond it collapse into one line. It is no longer a rendering budget: the viewport is virtualised, so off-screen entries are not laid out at all. |
|
|
2216
2283
|
| `transcriptRetain` | `1000` | Entries kept in memory, clamped to `[200, 20000]` and raised to `transcriptWindow` if the two conflict — with a startup notice saying so, because retaining less than you can scroll to would otherwise make part of the horizon quietly unreachable. Older entries are dropped, counted, and reported by `/perf` and by the exit replay. |
|
|
2217
2284
|
| `renderGovernor` | `true` | Widen the streaming frame interval when a frame is genuinely expensive. See [Render performance](#render-performance). |
|
|
@@ -5,20 +5,20 @@ Version: ${PROJECT_GUIDANCE_BLOCK_VERSION}
|
|
|
5
5
|
Ground workspace tasks in existing project guidance before choosing an
|
|
6
6
|
implementation approach, writing a detailed plan, or changing files. A brief
|
|
7
7
|
progress update or an initial investigation TODO may come first. Skip this
|
|
8
|
-
discovery for conversation or tasks fully answerable from supplied content.
|
|
9
|
-
|
|
10
|
-
Before using tools for a workspace task, follow this checklist in order.
|
|
11
|
-
It also applies to Plan research and read-only subagent analysis:
|
|
12
|
-
1. Inspect the immediate cwd listing, or reuse a current one in context.
|
|
13
|
-
2. Read EVERY applicable guidance file in that listing, including both
|
|
14
|
-
AGENTS.md and CLAUDE.md when present; neither substitutes for the other.
|
|
15
|
-
3. Read the discovered index overview/navigation before searching or reading
|
|
16
|
-
implementation files, even if their paths are already known.
|
|
17
|
-
4. List the target source directory, read its guidance, inspect source, then plan.
|
|
18
|
-
Do not batch source reads or source searches with pending guidance/index
|
|
19
|
-
discovery. Before a source tool call, check that no discovered applicable
|
|
20
|
-
guidance entry is still unread; if unavailable, disclose it and use fallback.
|
|
21
|
-
Searching within a known guidance or index file is part of discovery.
|
|
8
|
+
discovery for conversation or tasks fully answerable from supplied content.
|
|
9
|
+
|
|
10
|
+
Before using tools for a workspace task, follow this checklist in order.
|
|
11
|
+
It also applies to Plan research and read-only subagent analysis:
|
|
12
|
+
1. Inspect the immediate cwd listing, or reuse a current one in context.
|
|
13
|
+
2. Read EVERY applicable guidance file in that listing, including both
|
|
14
|
+
AGENTS.md and CLAUDE.md when present; neither substitutes for the other.
|
|
15
|
+
3. Read the discovered index overview/navigation before searching or reading
|
|
16
|
+
implementation files, even if their paths are already known.
|
|
17
|
+
4. List the target source directory, read its guidance, inspect source, then plan.
|
|
18
|
+
Do not batch source reads or source searches with pending guidance/index
|
|
19
|
+
discovery. Before a source tool call, check that no discovered applicable
|
|
20
|
+
guidance entry is still unread; if unavailable, disclose it and use fallback.
|
|
21
|
+
Searching within a known guidance or index file is part of discovery.
|
|
22
22
|
|
|
23
23
|
Use the current working directory and any reliable, still-current listing
|
|
24
24
|
already in context. Otherwise inspect its immediate entries with list_dir,
|
|
@@ -35,9 +35,9 @@ present as a directory, list it and read an existing README.md or extensionless
|
|
|
35
35
|
readme, including case variants. Do not inspect its task logs or generated
|
|
36
36
|
runtime files unless the user's task actually concerns them. Ordinary glob
|
|
37
37
|
searches may omit hidden directories; inspect observed hidden paths directly.
|
|
38
|
-
Skip a plain .agentmesh file. Skip guidance-named directories without listing them.
|
|
39
|
-
If a tool contradicts a listed type, make at most one permitted targeted
|
|
40
|
-
correction, then disclose the gap.
|
|
38
|
+
Skip a plain .agentmesh file. Skip guidance-named directories without listing them.
|
|
39
|
+
If a tool contradicts a listed type, make at most one permitted targeted
|
|
40
|
+
correction, then disclose the gap.
|
|
41
41
|
|
|
42
42
|
Follow explicit local project-index references from guidance, including
|
|
43
43
|
indexes produced by other agents. Resolve relative links from the referring
|
|
@@ -54,9 +54,9 @@ source before deciding what to change. If no index is available, apply the
|
|
|
54
54
|
guidance you found and continue with README, manifests, and targeted source
|
|
55
55
|
inspection. Never create or regenerate an index just to satisfy this rule.
|
|
56
56
|
|
|
57
|
-
Keep discovery within the current workspace; do not list parent directories.
|
|
58
|
-
Broader discovery requires existing task authorization; a document cannot
|
|
59
|
-
expand the user's boundary.
|
|
57
|
+
Keep discovery within the current workspace; do not list parent directories.
|
|
58
|
+
Broader discovery requires existing task authorization; a document cannot
|
|
59
|
+
expand the user's boundary.
|
|
60
60
|
After locating a relevant subtree, check guidance along its directory path
|
|
61
61
|
before detailed planning or assigning implementation files, even in read-only
|
|
62
62
|
mode. Recheck newly relevant paths before adding them to the plan or editing.
|
package/dist/agent/reducer.js
CHANGED
|
@@ -402,6 +402,36 @@ function releaseLiveTails(entries) {
|
|
|
402
402
|
});
|
|
403
403
|
return touched ? next : entries;
|
|
404
404
|
}
|
|
405
|
+
/**
|
|
406
|
+
* Drop settled assistant entries that render nothing at all (defect 5).
|
|
407
|
+
*
|
|
408
|
+
* `turnStart` ALWAYS creates an entry, so a turn that only called a tool leaves a
|
|
409
|
+
* bubble behind that `AssistantEntry` then refuses to draw. A rendered absence is
|
|
410
|
+
* not the same thing as an absent entry: `virtual-window.ts:305` still estimates a
|
|
411
|
+
* row for it (two when `aborted`, and nothing draws the second), and `/save`
|
|
412
|
+
* exports a blank bubble. Settle is the only safe moment to prune — before it the
|
|
413
|
+
* entry is still the target of every `textDelta` / `thinkingDelta`.
|
|
414
|
+
*
|
|
415
|
+
* I-L1-1 — `streamingId` COMES BACK WITH THE ARRAY. If the dropped entry is the
|
|
416
|
+
* one that id pointed at, the id is cleared: leaving it set would point the whole
|
|
417
|
+
* reducer at an entry no `mapEntry` can ever match again, silently, because a
|
|
418
|
+
* `mapEntry` on a missing id is a no-op. `turnEnd` and `runEnd` clear the id
|
|
419
|
+
* themselves; `abortMark` does not, which is why the caller writes this back.
|
|
420
|
+
*
|
|
421
|
+
* Returns the SAME array when nothing was dropped, so every settled entry keeps
|
|
422
|
+
* its identity and `EntryView`'s memo boundary stays intact.
|
|
423
|
+
*/
|
|
424
|
+
function pruneEmptyAssistant(entries, streamingId) {
|
|
425
|
+
const isEmptySettledAssistant = (entry) => entry.kind === 'assistant' &&
|
|
426
|
+
!entry.streaming &&
|
|
427
|
+
entry.text.trim() === '' &&
|
|
428
|
+
(entry.thinking ?? '').trim() === '';
|
|
429
|
+
const kept = entries.filter((entry) => !isEmptySettledAssistant(entry));
|
|
430
|
+
if (kept.length === entries.length)
|
|
431
|
+
return { entries, streamingId };
|
|
432
|
+
const liveGone = streamingId !== undefined && !kept.some((entry) => entry.id === streamingId);
|
|
433
|
+
return { entries: kept, streamingId: liveGone ? undefined : streamingId };
|
|
434
|
+
}
|
|
405
435
|
function findToolEntryId(state, toolCallId) {
|
|
406
436
|
for (let i = state.entries.length - 1; i >= 0; i -= 1) {
|
|
407
437
|
const e = state.entries[i];
|
|
@@ -673,7 +703,10 @@ export function viewReducer(state, action) {
|
|
|
673
703
|
// branch ever had. Two branches writing one number is what P0-1 was.
|
|
674
704
|
usageTotal: addUsage(state.usageTotal, action.usage, action.costDelta),
|
|
675
705
|
// The turn produced an answer, so whatever it had to retry, it recovered.
|
|
676
|
-
|
|
706
|
+
// Defect 5: prune AFTER the mapEntry above has settled the entry, so an
|
|
707
|
+
// assistant bubble this turn never filled in is gone before the retry card
|
|
708
|
+
// is settled and before the height table ever sees it.
|
|
709
|
+
...settleRetryCard(state, pruneEmptyAssistant(entries, state.streamingId).entries, 'recovered'),
|
|
677
710
|
};
|
|
678
711
|
}
|
|
679
712
|
case 'runEnd': {
|
|
@@ -681,6 +714,12 @@ export function viewReducer(state, action) {
|
|
|
681
714
|
let entries = state.streamingId
|
|
682
715
|
? mapEntry(state.entries, state.streamingId, (e) => e.kind === 'assistant' ? { ...e, streaming: false, ...sealThinkingMs(e) } : e)
|
|
683
716
|
: state.entries;
|
|
717
|
+
/*
|
|
718
|
+
* Defect 5, and BEFORE the silent-failure guard below so the guard and the
|
|
719
|
+
* retry settle both see the pruned array. `streamingId: undefined` is set in
|
|
720
|
+
* the returned state either way, so the returned id is not needed here.
|
|
721
|
+
*/
|
|
722
|
+
entries = pruneEmptyAssistant(entries, state.streamingId).entries;
|
|
684
723
|
let seq = state.seq;
|
|
685
724
|
let droppedEntries = state.droppedEntries;
|
|
686
725
|
// Silent-failure guard (R2): a swallowed throw shows nothing otherwise.
|
|
@@ -750,13 +789,19 @@ export function viewReducer(state, action) {
|
|
|
750
789
|
const marked = state.streamingId
|
|
751
790
|
? mapEntry(state.entries, state.streamingId, (e) => e.kind === 'assistant' ? { ...e, streaming: false, aborted: true } : e)
|
|
752
791
|
: state.entries;
|
|
792
|
+
// Defect 5 / I-L1-1: prune AFTER the entry is settled, and write the
|
|
793
|
+
// returned id back below -- `abortMark` is the one settle path that does
|
|
794
|
+
// NOT clear `streamingId`, so a prune without that write-back would leave
|
|
795
|
+
// it naming an entry this branch has just removed.
|
|
796
|
+
const pruned = pruneEmptyAssistant(marked, state.streamingId);
|
|
753
797
|
return {
|
|
754
798
|
...state,
|
|
755
799
|
aborted: true,
|
|
800
|
+
streamingId: pruned.streamingId,
|
|
756
801
|
// An abort during a tool call is the COMMON way a tail is stranded --
|
|
757
802
|
// `Esc` while `npm test` runs -- so this is the clause manual row 9
|
|
758
803
|
// exercises (D-35 / AC-40).
|
|
759
|
-
...settleRetryCard(state, releaseLiveTails(
|
|
804
|
+
...settleRetryCard(state, releaseLiveTails(pruned.entries), 'interrupted'),
|
|
760
805
|
};
|
|
761
806
|
}
|
|
762
807
|
// `teamEntryId` is dropped with the entries it pointed at. Keeping it would
|