You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For broad refactors, DeepSeek's cheap cached input suggests per-file resident sub-agents: each child gets a stable prefix containing the repo skeleton plus one target file, then receives small instructions over time. This is different from the removed swarm surface because the win is persistent cached locality, not arbitrary fan-out volume.
Current behavior
crates/tui/src/core/engine.rs:833 registers ordinary agent_spawn tools for Agent/Yolo modes.
crates/tui/src/core/engine.rs:837 builds sub-agent runtimes from the current client/model/tool context, but without a per-file resident prompt contract.
docs/TOOL_SURFACE.md notes agent_spawn as bounded full sub-agent loops and says the legacy agent_swarm surface was removed.
Introduce a cache-aware sub-agent spawn variant or prompt profile that binds a child to one file or module. The parent supplies a deterministic repo skeleton, target file contents, and refactor objective. Subsequent agent_send_input messages should preserve that prefix and only append narrow deltas. Keep the existing agent_spawn lifecycle and caps; do not resurrect agent_swarm or /swarm.
Open questions / risks
Resident agents can hold stale file contents after parent/other child edits; need invalidation or refresh messages.
Parent/child write conflicts need explicit ownership or side-worktree isolation.
Concurrency can hit output and tool-latency ceilings even when input is cached.
Thesis
For broad refactors, DeepSeek's cheap cached input suggests per-file resident sub-agents: each child gets a stable prefix containing the repo skeleton plus one target file, then receives small instructions over time. This is different from the removed swarm surface because the win is persistent cached locality, not arbitrary fan-out volume.
Current behavior
crates/tui/src/core/engine.rs:833registers ordinaryagent_spawntools for Agent/Yolo modes.crates/tui/src/core/engine.rs:837builds sub-agent runtimes from the current client/model/tool context, but without a per-file resident prompt contract.docs/TOOL_SURFACE.mdnotesagent_spawnas bounded full sub-agent loops and says the legacyagent_swarmsurface was removed.Proposed change
Introduce a cache-aware sub-agent spawn variant or prompt profile that binds a child to one file or module. The parent supplies a deterministic repo skeleton, target file contents, and refactor objective. Subsequent
agent_send_inputmessages should preserve that prefix and only append narrow deltas. Keep the existingagent_spawnlifecycle and caps; do not resurrectagent_swarmor/swarm.Open questions / risks
Acceptance signals
agent_spawn,agent_wait,agent_result, and cancellation behavior remains compatible.