acp: Model-specific prompt capabilities for 1PA (#36879)

Adds support for per-session prompt capabilities and capability changes
on the Zed side (ACP itself still only has per-connection static
capabilities for now), and uses it to reflect image support accurately
in 1PA threads based on the currently-selected model.

Release Notes:

- N/A
This commit is contained in:
Cole Miller 2025-08-25 14:28:11 -04:00 committed by GitHub
parent f1204dfc33
commit 5fd29d37a6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 98 additions and 53 deletions

View file

@ -162,6 +162,19 @@ impl<T> Receiver<T> {
pending_waker_id: None,
}
}
/// Creates a new [`Receiver`] holding an initial value that will never change.
pub fn constant(value: T) -> Self {
let state = Arc::new(RwLock::new(State {
value,
wakers: BTreeMap::new(),
next_waker_id: WakerId::default(),
version: 0,
closed: false,
}));
Self { state, version: 0 }
}
}
impl<T: Clone> Receiver<T> {