diff --git a/src-tauri/src/core/manager/config.rs b/src-tauri/src/core/manager/config.rs
index a4f991331..3773224b3 100644
--- a/src-tauri/src/core/manager/config.rs
+++ b/src-tauri/src/core/manager/config.rs
@@ -88,8 +88,8 @@ fn plan_config_application(attempt: &StageAttempt) -> ConfigApplication {
}
}
-async fn ask_to_stage(path: &std::path::Path) -> StageAttempt {
- match crate::core::service::stage_runtime_by_service(path).await {
+async fn ask_to_stage(path: &std::path::Path, session: &clash_verge_service_ipc::OwnerSessionProof) -> StageAttempt {
+ match crate::core::service::stage_runtime_by_service(path, session).await {
Ok(StageRequest::Answered(outcome)) => StageAttempt::Answered(outcome),
Ok(StageRequest::Refused { code, message }) => {
let message = message.into();
@@ -433,10 +433,10 @@ impl CoreManager {
}
async fn attempt_staging(&self, path: &std::path::Path) -> StageAttempt {
- if !crate::core::service::active_service_supports_runtime_staging() {
+ let Ok(session) = crate::core::service::active_service_session() else {
return StageAttempt::Unsupported;
- }
- stage_with_confirmation(timing::STAGE_CONFIRM_TIMEOUT, || ask_to_stage(path)).await
+ };
+ stage_with_confirmation(timing::STAGE_CONFIRM_TIMEOUT, || ask_to_stage(path, &session)).await
}
/// Reload the Core from `path`, and replace the Core if it will not take it.
diff --git a/src-tauri/src/core/service.rs b/src-tauri/src/core/service.rs
index 7d690bf4c..ef39be558 100644
--- a/src-tauri/src/core/service.rs
+++ b/src-tauri/src/core/service.rs
@@ -22,9 +22,9 @@ use clash_verge_draft::Draft;
use clash_verge_logging::{Type, logging};
use clash_verge_runtime_bundle::{GEO_ASSETS, RemoteProviderRef, collect_runtime_bundle, remote_providers_of};
use clash_verge_service_ipc::{
- MacosProxyConfig, OwnerCredentials, OwnerIdentity, OwnerSessionProof, ProtocolInfo, ProxyApplyOutcome,
- RemoteProvider, RuntimeAsset, RuntimeBundle, RuntimeFileOutcome, RuntimeFileRequest, ServiceErrorCode,
- ServiceStatusSnapshot, StageRuntimeOutcome, StartClashRequest, WriterConfig,
+ MacosProxyConfig, OwnerCredentials, OwnerIdentity, OwnerSessionProof, ProxyApplyOutcome, RemoteProvider,
+ RuntimeAsset, RuntimeBundle, RuntimeFileOutcome, RuntimeFileRequest, ServiceErrorCode, ServiceStatusSnapshot,
+ StageRuntimeOutcome, StartClashRequest, WriterConfig,
};
use clash_verge_task::scheduled_task::{self, Mailbox, Next, ScheduledTask};
use clash_verge_task::watch_task;
@@ -45,7 +45,7 @@ use tokio::{sync::watch, time::Instant};
static OWNER_MONITOR_GENERATION: AtomicU64 = AtomicU64::new(0);
static PENDING_SERVICE_START: Mutex