Restore ACP slash commands when reopening threads (#53209)

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the UI/UX checklist
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes #52239

## Summary

Note - The code in this fix is AI generated.

OpenCode ACP chats lost slash-command support after Zed restarted and a
thread was reopened. The UI no longer showed `/ for commands`, and slash
commands like `/help` were treated as unsupported.

## Root Cause

ACP available commands were treated as transient UI state instead of
durable thread state.

- `AcpThread` handled `AvailableCommandsUpdate` but did not retain the
commands on the thread
- restored thread views rebuilt `SessionCapabilities` with an empty
`available_commands` list
- the message-editor placeholder started in the wrong state for restored
threads
- live command updates could be applied to the wrong thread view

## Fix

- persisted `available_commands` on `AcpThread`
- restored `SessionCapabilities` from thread state
- reused the same command augmentation logic for restore and live update
paths
- updated live command handling to target the correct thread view
- initialized the message-editor placeholder from current command
availability
- added a regression test for the restore path

## Verification

- `cargo test -p agent_ui
conversation_view::tests::test_restored_threads_keep_available_commands
-- --exact --nocapture`
- `./script/clippy -p agent_ui --tests`

Release Notes:

- Fixed ACP slash commands disappearing after reopening restored
threads.

---------

Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
3a5dc8ef6aYoni Sirote committed on 4/6/2026, 10:08:49 PM· committed by GitHubparenta018333
3 files changedLine totals unavailable