Teach parent agents to clean up the processes they spawn
Add a `lifecycle` help topic spelling out that the caller owns the
processes it spawns and should `close_process` when a sub-agent or
spawned child is no longer needed. The `spawn_agent` and `spawn_process`
descriptions advertised via `tools/list` now restate the same duty
inline (with a pointer to `help('lifecycle')`), so vendor TUIs see the
expectation at the moment they reach for the tool. The `spawning` topic
and `topics` index cross-reference the new content.
Bundles two already-staged improvements that fall in the same area:
- OnChildSpawned primes the snapshot-replay budget for new panes so
diff-based vendor TUIs come up clean without a manual Ctrl+W/Ctrl+S
refresh.
- TODO drops the three items now actioned (prompt-injection preface,
agent cleanup duty, opencode→claude view corruption) and keeps the
unicode `<?>` entry with the investigation notes.
This commit is contained in:
21
CHANGELOG.md
21
CHANGELOG.md
@@ -6,7 +6,28 @@ loosely follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
### Fixed
|
||||
- Sub-agent panes spawned while another diff-based TUI (claude/codex/
|
||||
opencode) held focus could come up corrupted because the new child's
|
||||
first incremental updates targeted cells the host viewport hadn't
|
||||
populated yet. `OnChildSpawned` now primes the snapshot-replay budget
|
||||
for the new child, so its first PTY chunks render from the full
|
||||
styled emulator grid — the same path that fixed the symptom when the
|
||||
user manually cycled focus with Ctrl+W / Ctrl+S.
|
||||
|
||||
### Added
|
||||
- New `lifecycle` help topic spelling out that the caller owns the
|
||||
processes it spawns and should call `close_process` when a sub-agent
|
||||
or spawned process is no longer needed. The `spawn_agent` and
|
||||
`spawn_process` tool descriptions advertised via `tools/list` now
|
||||
call out the same cleanup duty (with a pointer to `help('lifecycle')`),
|
||||
and the `spawning` help topic and `topics` index cross-reference it.
|
||||
- `spawn_agent` now prepends a single-line `[system: …]` orientation
|
||||
block to the sub-agent's first prompt so vendor TUIs (claude, codex,
|
||||
opencode) know they're a sub-agent, are reminded to `send_message`
|
||||
their parent with a summary when done, and to clean up processes /
|
||||
scratchpads they created. Skipped for top-level launches and empty
|
||||
instructions.
|
||||
- Ctrl+A / Ctrl+D step focus between top-level tabs; Ctrl+W / Ctrl+S
|
||||
step through processes (root + sub-agents) inside the current tab.
|
||||
Recognised in legacy, kitty CSI u, and xterm modifyOtherKeys
|
||||
|
||||
Reference in New Issue
Block a user