Commit f487fce
authored
feat(acp): Add E2E tests for agent subprocess lifecycle and fix cleanup (#83)
## Summary
🤖 Generated with [Nori](https://www.npmjs.com/package/nori-ai)
- Add 6 E2E tests in `agent_switching.rs` to verify ACP agent subprocess
handling:
- Subprocess spawning with unique PIDs
- Session switch via `/new` creates new subprocess
- Old subprocess cleanup after switch (no zombies)
- Cleanup timing (outside prompt turns)
- Different agents use different subprocesses
- Model picker switch creates new subprocess
- Add `mock-model-alt` to ACP registry for testing agent switching
- Fix subprocess cleanup: kill child process when `AcpConnection` is
dropped
- Fix Arc reference deadlock that prevented cleanup from happening
## Test Plan
- [x] All 6 new E2E tests pass (`cargo test -p tui-pty-e2e --test
agent_switching`)
- [x] Unit tests pass (`cargo test -p codex-acp`)
- [x] Clippy passes
- [x] Code formatted with `cargo fmt`
Share Nori with your team: https://www.npmjs.com/package/nori-ai1 parent 04c9240 commit f487fce
13 files changed
Lines changed: 978 additions & 16 deletions
File tree
- .claude
- codex-rs
- acp
- src
- tui-pty-e2e
- src
- tests
- snapshots
- tui
- src/chatwidget
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
7 | 28 | | |
8 | 29 | | |
9 | | - | |
| 30 | + | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments