提前检测Agent是否支持fork会话,避免无效展示和操作

This commit is contained in:
xintaofei
2026-03-17 16:03:08 +08:00
parent db4ff9d1ae
commit 35f5e16c11
6 changed files with 53 additions and 1 deletions

View File

@@ -640,6 +640,15 @@ async fn run_connection(
init_resp.agent_capabilities.load_session, supports_fork
);
// Emit fork support capability
let _ = handle.emit(
"acp://event",
AcpEvent::ForkSupported {
connection_id: conn_id.clone(),
supported: supports_fork,
},
);
// Emit connected status
let _ = handle.emit(
"acp://event",

View File

@@ -105,6 +105,11 @@ pub enum AcpEvent {
connection_id: String,
prompt_capabilities: PromptCapabilitiesInfo,
},
/// Whether the agent supports session/fork
ForkSupported {
connection_id: String,
supported: bool,
},
/// Current session mode changed
ModeChanged {
connection_id: String,