CBox session registry stale after sandbox kill
Problem
After killing a cbox sandbox, the port registry and worktree metadata are not immediately invalidated. This causes cbox new --list to continue showing the killed sandbox as active while cbox list (which checks tmux sessions) correctly shows it as gone. The divergence between these two views confuses the manager agent — it may attempt to interact with a sandbox that no longer exists, or skip creating a replacement because the registry says one is still running. Stale registry entries also leak port allocations, potentially causing port conflicts when new sandboxes are created.
Context
Possible Solutions
Plan
Implementation Progress
- Resolved by commit
0ee158e4— "fix(cbox): converge stale session registry after sandbox kill (#450)" - Three-part fix: unconditional port release on kill, stale entry pruning on list operations, thread-safe helper (
_prune_stale_port_registry) - Test suite:
libs/cbox/test_stale_registry.py(277 lines covering kill, list, stop, and convergence scenarios) - No remaining follow-up items identified.
Review Feedback
- [ ] Review cleared