Files
zed/crates/copilot
Parker Loflin 4e2c957a6d Remove dead code and redundant checks in agent and language model crates (#67218)
## Summary

Removes unused code and redundant work. No behavior changes.

- Removes about 25 unused items. Examples:
  - `TerminalProviderCommand`
  - `AgentPanel::activate_retained_thread`
  - `Thread::is_generating_summary`
  - `LanguageModelResponseMessage`
- the fake provider's `ToolUseRequest`, along with `language_model`'s
`serde_json` dependency
- `ResolvedSymbol::{line_text, truncated}` were never read, so symbol
lookups no longer build a display string.
- `SandboxWrap::is_local` has gone unread since #59790 moved the check
into `terminal_tool`.
- Removes `cx.notify()` after `set_server_state`, `add_to_queue`,
`set_editor_is_expanded` and `clear_thread_error`, which always notify.
- `ProfileSelector::ensure_picker` and `ThreadView::toggle_search`
create or reuse their entity in one step instead of re-checking an
`Option` they just set. This removes an `unwrap()`.
- Copilot: once both completion futures finished, the result-tracking
state could only produce an empty `Vec`. Removes it.
- Smaller redundancies:
  - Bedrock reuses its `current_message` binding.
- The context server listener uses the request id it already has instead
of `request.id.unwrap()`.
- `action_log` drops an `is_empty` check that `Buffer::edit` already
makes.
- Drops clones made only to be borrowed, and 17 `arc_with_non_send_sync`
allows in agent tests that no longer fire.

## Testing

- `./script/clippy`
- `cargo test -p agent -p agent_ui -p acp_thread -p agent_servers -p
copilot -p language_model -p language_models`

## Self-review

- [x] I've reviewed my diff for quality, security, reliability, and
performance.
- [x] UI changes follow the
[checklist](https://zed.dev/docs/development/ui-checklist).
- [x] Tests cover the new or changed behavior.

Release Notes:

- N/A
2026-11-19 23:43:59 +00:00
..