feat: enhance abortSession method to include current directory in query
This commit is contained in:
@@ -95,22 +95,4 @@ pub async fn remove_provider_auth(provider_id: &str) -> Result<bool> {
|
||||
Ok(true)
|
||||
}
|
||||
|
||||
/// Get provider auth entry
|
||||
pub async fn get_provider_auth(provider_id: &str) -> Result<Option<Value>> {
|
||||
let auth = read_auth().await?;
|
||||
|
||||
Ok(auth
|
||||
.as_object()
|
||||
.and_then(|obj| obj.get(provider_id))
|
||||
.cloned())
|
||||
}
|
||||
|
||||
/// List all provider IDs with auth
|
||||
pub async fn list_provider_auths() -> Result<Vec<String>> {
|
||||
let auth = read_auth().await?;
|
||||
|
||||
Ok(auth
|
||||
.as_object()
|
||||
.map(|obj| obj.keys().cloned().collect())
|
||||
.unwrap_or_default())
|
||||
}
|
||||
|
||||
@@ -473,6 +473,7 @@ class OpencodeService {
|
||||
async abortSession(id: string): Promise<boolean> {
|
||||
const response = await this.client.session.abort({
|
||||
path: { id },
|
||||
query: this.currentDirectory ? { directory: this.currentDirectory } : undefined,
|
||||
throwOnError: true,
|
||||
});
|
||||
return Boolean(response.data);
|
||||
|
||||
Reference in New Issue
Block a user