@@ -785,7 +785,6 @@ pub struct AcpThread {
785785 session_id : acp:: SessionId ,
786786 token_usage : Option < TokenUsage > ,
787787 prompt_capabilities : acp:: PromptCapabilities ,
788- available_commands : Vec < acp:: AvailableCommand > ,
789788 _observe_prompt_capabilities : Task < anyhow:: Result < ( ) > > ,
790789 determine_shell : Shared < Task < String > > ,
791790 terminals : HashMap < acp:: TerminalId , Entity < Terminal > > ,
@@ -805,6 +804,7 @@ pub enum AcpThreadEvent {
805804 LoadError ( LoadError ) ,
806805 PromptCapabilitiesUpdated ,
807806 Refusal ,
807+ AvailableCommandsUpdated ( Vec < acp:: AvailableCommand > ) ,
808808}
809809
810810impl EventEmitter < AcpThreadEvent > for AcpThread { }
@@ -860,7 +860,6 @@ impl AcpThread {
860860 action_log : Entity < ActionLog > ,
861861 session_id : acp:: SessionId ,
862862 mut prompt_capabilities_rx : watch:: Receiver < acp:: PromptCapabilities > ,
863- available_commands : Vec < acp:: AvailableCommand > ,
864863 cx : & mut Context < Self > ,
865864 ) -> Self {
866865 let prompt_capabilities = * prompt_capabilities_rx. borrow ( ) ;
@@ -900,7 +899,6 @@ impl AcpThread {
900899 session_id,
901900 token_usage : None ,
902901 prompt_capabilities,
903- available_commands,
904902 _observe_prompt_capabilities : task,
905903 terminals : HashMap :: default ( ) ,
906904 determine_shell,
@@ -911,10 +909,6 @@ impl AcpThread {
911909 self . prompt_capabilities
912910 }
913911
914- pub fn available_commands ( & self ) -> Vec < acp:: AvailableCommand > {
915- self . available_commands . clone ( )
916- }
917-
918912 pub fn connection ( & self ) -> & Rc < dyn AgentConnection > {
919913 & self . connection
920914 }
@@ -1010,6 +1004,9 @@ impl AcpThread {
10101004 acp:: SessionUpdate :: Plan ( plan) => {
10111005 self . update_plan ( plan, cx) ;
10121006 }
1007+ acp:: SessionUpdate :: AvailableCommandsUpdate { available_commands } => {
1008+ cx. emit ( AcpThreadEvent :: AvailableCommandsUpdated ( available_commands) )
1009+ }
10131010 }
10141011 Ok ( ( ) )
10151012 }
@@ -3080,7 +3077,6 @@ mod tests {
30803077 audio : true ,
30813078 embedded_context : true ,
30823079 } ) ,
3083- vec ! [ ] ,
30843080 cx,
30853081 )
30863082 } ) ;
0 commit comments