-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathcommit-msg.txt
More file actions
32 lines (27 loc) · 1.63 KB
/
Copy pathcommit-msg.txt
File metadata and controls
32 lines (27 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
fix(subagent): populate CompletedCache in onTerminal; refactor tasks stdin TODO
## BLOCKER: CompletedCache never populated
`SubagentManager.forkSubagent` built a `CompletedCache` and exposed it via
`manager.completed`, but the `onTerminal` callback only called
`this.active.delete(id)`, `this.abortGraph.dispose(id)`, and
`void logWriter?.close()` -- `completed.add()` was never called. After
`onTerminal` fired, `manager.get(id)` returned `undefined` for every
completed subagent, making `/tasks:view` unable to locate any finished handle
from the in-memory path.
Fix: add `CompletedCache.recordHandle()` -- a convenience method that builds
a lightweight `SubagentResult` from terminal handle-state fields (all
fully populated by `run()` before `_onTerminal()` fires) and calls `add()`
internally. `onTerminal` now calls `this.completed.recordHandle(...)`.
The `message` field is intentionally omitted from the cached result because
`/tasks:view` uses `SubagentLogReader` for full conversation replay.
## Medium: subagent.ts file-size ceiling
Adding the completion-cache wiring pushed `subagent.ts` briefly above the
350 code-line ceiling. Extracting the result-building logic into
`CompletedCache.recordHandle()` brings it back to 344 code lines.
## Medium: direct process.stdin access in tasks.ts
Added a TODO comment on the `process.stdin.on('data', onKeypress)` line,
noting that direct stdin listeners bypass the compositor's routing and
should route through `compositor.enterPickerMode()` instead.
## Tests
Added 4 tests for `CompletedCache.recordHandle()` covering succeeded,
succeeded-with-stopReason, failed, and cancelled cases (17 tests total,
up from 13).