zed/crates/eval/src
Richard Feldman 756637fef5
Subagents PR 2: Thread spawning + execution (#46187)
This PR implements the behind-the-scenes subagent execution logic:

### Core subagent execution
- Add `Thread::new_subagent()` constructor for creating subagent threads
- Implement `SubagentTool::run()` to spawn and manage subagent lifecycle
- Add `SubagentContext` for parent-child thread relationship
- Implement `submit_user_message()`, `interrupt_for_summary()`,
`request_final_summary()`
- Add timeout support and context-low detection (25% threshold)
- Propagate cancellation from parent to child threads

### Thread management
- Add `MAX_SUBAGENT_DEPTH` (4) and `MAX_PARALLEL_SUBAGENTS` (8) limits
- Add `register/unregister_running_subagent()` for tracking
- Add `restrict_tools()` for allowed_tools filtering
- Add `is_subagent()`, `depth()`, `is_turn_complete()` accessors

### Thread changes
- Add `ToolCallContent::SubagentThread` variant
- Add `ToolCallUpdateSubagentThread` for UI updates
- Add `tool_name` field for subagent detection
- Add `is_subagent()` method on `ToolCall`
- Add image support in `ContentBlock`

Release Notes:

- N/A

---------

Co-authored-by: Amp <amp@ampcode.com>
2026-01-12 18:07:41 +00:00
..
examples gpui: Actually remove the Result from AsyncApp (#45809) 2026-01-07 12:48:24 -08:00
assertions.rs Fix a bunch of other low-hanging style lints (#36498) 2025-08-19 21:26:17 +02:00
eval.rs gpui: Actually remove the Result from AsyncApp (#45809) 2026-01-07 12:48:24 -08:00
example.rs Subagents PR 2: Thread spawning + execution (#46187) 2026-01-12 18:07:41 +00:00
explorer.html evals: Fix bug that prevented multiple turns from displaying (#34128) 2025-07-09 15:31:58 +00:00
explorer.rs Auto-fix clippy::collapsible_if violations (#36428) 2025-08-19 13:27:24 +00:00
ids.rs Use anyhow more idiomatically (#31052) 2025-05-20 23:06:07 +00:00
instance.rs gpui: Actually remove the Result from AsyncApp (#45809) 2026-01-07 12:48:24 -08:00
judge_diff_prompt.hbs eval: Fine-grained assertions (#29246) 2025-04-22 23:58:58 -03:00
judge_thread_prompt.hbs eval: Fine-grained assertions (#29246) 2025-04-22 23:58:58 -03:00
tool_metrics.rs eval: Fine-grained assertions (#29246) 2025-04-22 23:58:58 -03:00