@@ -9,8 +9,10 @@ use warpui::r#async::{SpawnedFutureHandle, Timer};
99use warpui:: { AppContext , Entity , EntityId , ModelContext , SingletonEntity } ;
1010
1111use crate :: ai:: active_agent_views_model:: ActiveAgentViewsModel ;
12+ #[ cfg( all( feature = "local_fs" , not( target_family = "wasm" ) ) ) ]
1213use crate :: ai:: agent:: api:: ServerConversationToken ;
1314use crate :: ai:: agent:: { conversation:: AIConversationId , extract_user_query_mode} ;
15+ #[ cfg( all( feature = "local_fs" , not( target_family = "wasm" ) ) ) ]
1416use crate :: ai:: agent_sdk:: driver:: upload_snapshot_for_handoff;
1517use crate :: ai:: ambient_agents:: spawn:: { spawn_task, submit_run_followup, AmbientAgentEvent } ;
1618use crate :: ai:: ambient_agents:: task:: HarnessConfig ;
@@ -19,6 +21,7 @@ use crate::ai::ambient_agents::AmbientAgentTaskId;
1921use crate :: ai:: ambient_agents:: {
2022 OUT_OF_CREDITS_TASK_FAILURE_MESSAGE , SERVER_OVERLOADED_TASK_FAILURE_MESSAGE ,
2123} ;
24+ #[ cfg( all( feature = "local_fs" , not( target_family = "wasm" ) ) ) ]
2225use crate :: ai:: blocklist:: handoff:: touched_repos:: TouchedWorkspace ;
2326use crate :: ai:: blocklist:: BlocklistAIHistoryModel ;
2427use crate :: ai:: cloud_environments:: CloudAmbientAgentEnvironment ;
@@ -73,6 +76,7 @@ pub enum SessionStartupKind {
7376/// the pane opens; flips to `Starting` when the user submits and the snapshot
7477/// upload runs; flips to `Failed` if the upload fails so the user can retry by
7578/// re-submitting from the same pane.
79+ #[ cfg( all( feature = "local_fs" , not( target_family = "wasm" ) ) ) ]
7680#[ derive( Debug , Clone , PartialEq , Eq , Default ) ]
7781pub enum HandoffSubmissionState {
7882 #[ default]
@@ -85,6 +89,7 @@ pub enum HandoffSubmissionState {
8589/// fresh cloud-mode pane and consumed by `submit_handoff`. Its presence is the
8690/// single source of truth for "this pane is in handoff mode" via
8791/// `is_local_to_cloud_handoff()`.
92+ #[ cfg( all( feature = "local_fs" , not( target_family = "wasm" ) ) ) ]
8893#[ derive( Debug , Clone ) ]
8994pub ( crate ) struct PendingHandoff {
9095 /// Source conversation id (the local conversation's `server_conversation_token`).
@@ -175,6 +180,7 @@ pub struct AmbientAgentViewModel {
175180 pending_followup_prompt : Option < String > ,
176181
177182 /// See [`PendingHandoff`].
183+ #[ cfg( all( feature = "local_fs" , not( target_family = "wasm" ) ) ) ]
178184 pending_handoff : Option < PendingHandoff > ,
179185}
180186
@@ -210,6 +216,7 @@ impl AmbientAgentViewModel {
210216 active_execution_session_id : None ,
211217 last_ended_execution_session_id : None ,
212218 pending_followup_prompt : None ,
219+ #[ cfg( all( feature = "local_fs" , not( target_family = "wasm" ) ) ) ]
213220 pending_handoff : None ,
214221 }
215222 }
@@ -363,7 +370,14 @@ impl AmbientAgentViewModel {
363370 /// spawn, so post-spawn flows (queued-prompt rendering, V2-input suppression,
364371 /// submit interception) all observe the same source of truth.
365372 pub ( crate ) fn is_local_to_cloud_handoff ( & self ) -> bool {
366- self . pending_handoff . is_some ( )
373+ #[ cfg( all( feature = "local_fs" , not( target_family = "wasm" ) ) ) ]
374+ {
375+ self . pending_handoff . is_some ( )
376+ }
377+ #[ cfg( not( all( feature = "local_fs" , not( target_family = "wasm" ) ) ) ) ]
378+ {
379+ false
380+ }
367381 }
368382
369383 /// True when this pane is a handoff pane AND the async
@@ -373,15 +387,23 @@ impl AmbientAgentViewModel {
373387 /// must leave the prompt and pending attachments alone instead of
374388 /// silently dropping them on the floor.
375389 pub ( crate ) fn is_handoff_ready_to_submit ( & self ) -> bool {
376- let Some ( handoff) = self . pending_handoff . as_ref ( ) else {
377- return false ;
378- } ;
379- handoff. touched_workspace . is_some ( )
380- && !matches ! ( handoff. submission_state, HandoffSubmissionState :: Starting )
390+ #[ cfg( all( feature = "local_fs" , not( target_family = "wasm" ) ) ) ]
391+ {
392+ let Some ( handoff) = self . pending_handoff . as_ref ( ) else {
393+ return false ;
394+ } ;
395+ handoff. touched_workspace . is_some ( )
396+ && !matches ! ( handoff. submission_state, HandoffSubmissionState :: Starting )
397+ }
398+ #[ cfg( not( all( feature = "local_fs" , not( target_family = "wasm" ) ) ) ) ]
399+ {
400+ false
401+ }
381402 }
382403
383404 /// Seeds the handoff context onto this pane. Called by the workspace bootstrap
384405 /// after splitting in a fresh cloud-mode pane and entering agent view.
406+ #[ cfg( all( feature = "local_fs" , not( target_family = "wasm" ) ) ) ]
385407 pub ( crate ) fn set_pending_handoff (
386408 & mut self ,
387409 pending : Option < PendingHandoff > ,
@@ -393,6 +415,7 @@ impl AmbientAgentViewModel {
393415
394416 /// Updates the touched workspace once async derivation completes.
395417 /// No-op when no handoff context is set.
418+ #[ cfg( all( feature = "local_fs" , not( target_family = "wasm" ) ) ) ]
396419 pub ( crate ) fn set_pending_handoff_workspace (
397420 & mut self ,
398421 workspace : TouchedWorkspace ,
@@ -407,6 +430,7 @@ impl AmbientAgentViewModel {
407430
408431 /// Updates the submission state on the pending handoff. No-op when no handoff
409432 /// context is set.
433+ #[ cfg( all( feature = "local_fs" , not( target_family = "wasm" ) ) ) ]
410434 pub ( crate ) fn set_pending_handoff_submission_state (
411435 & mut self ,
412436 state : HandoffSubmissionState ,
@@ -1139,6 +1163,7 @@ impl AmbientAgentViewModel {
11391163 /// set and routes it through the same `spawn_agent_with_request` path that
11401164 /// regular cloud-mode runs use — so `WaitingForSession` → `SessionStarted`
11411165 /// streaming reaches the same pane unchanged.
1166+ #[ cfg( all( feature = "local_fs" , not( target_family = "wasm" ) ) ) ]
11421167 pub ( crate ) fn submit_handoff (
11431168 & mut self ,
11441169 prompt : String ,
@@ -1221,6 +1246,16 @@ impl AmbientAgentViewModel {
12211246 ) ;
12221247 }
12231248
1249+ #[ cfg( not( all( feature = "local_fs" , not( target_family = "wasm" ) ) ) ) ]
1250+ pub ( crate ) fn submit_handoff (
1251+ & mut self ,
1252+ prompt : String ,
1253+ attachments : Vec < AttachmentInput > ,
1254+ ctx : & mut ModelContext < Self > ,
1255+ ) {
1256+ self . spawn_agent ( prompt, attachments, ctx) ;
1257+ }
1258+
12241259 /// Cancels the ambient agent task if one is currently running.
12251260 /// Sends a cancellation request to the server (if task_id is available) and transitions to the Cancelled state.
12261261 pub fn cancel_task ( & mut self , ctx : & mut ModelContext < Self > ) {
0 commit comments