feat: enhance abortSession method to include current directory in query

This commit is contained in:
Bohdan Triapitsyn
2025-12-27 19:13:19 +02:00
parent 4d7340bf49
commit c074b9a3f2
2 changed files with 1 additions and 18 deletions
@@ -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())
}
+1
View File
@@ -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);