@@ -8,6 +8,14 @@ const CODE_INTELLIGENCE_SHUTDOWN_GRACE: Duration = Duration::from_secs(5);
88const CODE_INTELLIGENCE_SHUTDOWN_SETTLE : Duration = Duration :: from_secs ( 1 ) ;
99const CODE_INTELLIGENCE_ABORT_SETTLE : Duration = Duration :: from_millis ( 250 ) ;
1010
11+ fn sandbox_load_warning ( error : & anyhow:: Error ) -> String {
12+ format ! (
13+ "Local command sandbox failed its bounded OS capability probe: {error:#}. \
14+ Default mode will ask before exact host Bash execution; Auto mode will deny \
15+ Bash. Repair the reported platform prerequisite and restart `a3s code`"
16+ )
17+ }
18+
1119fn with_tui_prompt_context (
1220 options : SessionOptions ,
1321 instructions : Option < & str > ,
@@ -688,14 +696,7 @@ pub(crate) async fn run_in(
688696 Some ( Arc :: new ( sandbox) as Arc < dyn a3s_code_core:: sandbox:: BashSandbox > ) ,
689697 None ,
690698 ) ,
691- Err ( error) => (
692- None ,
693- Some ( format ! (
694- "Local command sandbox failed its bounded OS capability probe: {error}. \
695- Default mode will ask before exact host Bash execution; Auto mode will deny \
696- Bash. Repair the reported platform prerequisite and restart `a3s code`"
697- ) ) ,
698- ) ,
699+ Err ( error) => ( None , Some ( sandbox_load_warning ( & error) ) ) ,
699700 } ,
700701 None => ( None , managed_srt. warning ) ,
701702 } ;
@@ -1380,6 +1381,19 @@ mod tests {
13801381 assert ! ( rendered. contains( "a3s code resume session-42" ) ) ;
13811382 }
13821383
1384+ #[ test]
1385+ fn sandbox_warning_includes_the_complete_error_chain ( ) {
1386+ let error = anyhow:: anyhow!( "No such file or directory (os error 2)" )
1387+ . context ( "failed to scan SRT workspace /workspace/transient" )
1388+ . context ( "managed SRT failed its Core capability handshake" ) ;
1389+
1390+ let warning = sandbox_load_warning ( & error) ;
1391+
1392+ assert ! ( warning. contains( "managed SRT failed its Core capability handshake" ) ) ;
1393+ assert ! ( warning. contains( "failed to scan SRT workspace /workspace/transient" ) ) ;
1394+ assert ! ( warning. contains( "No such file or directory (os error 2)" ) ) ;
1395+ }
1396+
13831397 #[ tokio:: test]
13841398 async fn initial_tui_options_inject_and_remove_materialized_preferences ( ) {
13851399 let temp = tempfile:: tempdir ( ) . unwrap ( ) ;
0 commit comments