# Restore ACP slash commands when reopening threads \(\#53209\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/3a5dc8ef6aaed33f7c57f9eeab36bbc71a19bc59)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 3a5dc8ef6aaed33f7c57f9eeab36bbc71a19bc59

Requested commit: 3a5dc8ef6aaed33f7c57f9eeab36bbc71a19bc59

Commit: 3a5dc8ef6aaed33f7c57f9eeab36bbc71a19bc59

Tree: b43e3eeededeca5d1331e6f525ad273ba4f45d5f

Author: Yoni Sirote

Committer: GitHub

## Message

```
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>
```

## Parents

- [a018333d41bfe07102d1d0b68383ff5afac00307](https://git.cafe/gitcafe/zed/commit/a018333d41bfe07102d1d0b68383ff5afac00307?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/3a5dc8ef6aaed33f7c57f9eeab36bbc71a19bc59?format=markdown)
