@@ -94,6 +94,47 @@ describe("runEmbeddedAgent prompt timeout fallback handoff", () => {
9494 expect ( mockedRunEmbeddedAttempt ) . toHaveBeenCalledTimes ( 1 ) ;
9595 } ) ;
9696
97+ it ( "preserves provider aborts when no model fallback is configured" , async ( ) => {
98+ mockedClassifyFailoverReason . mockReturnValue ( "timeout" ) ;
99+ mockedRunEmbeddedAttempt . mockResolvedValueOnce (
100+ makeAttemptResult ( {
101+ aborted : true ,
102+ externalAbort : false ,
103+ assistantTexts : [ ] ,
104+ promptError : Object . assign ( new Error ( "This operation was aborted" ) , {
105+ name : "AbortError" ,
106+ } ) ,
107+ promptErrorSource : "prompt" ,
108+ } ) ,
109+ ) ;
110+
111+ const result = await runEmbeddedAgent ( {
112+ ...overflowBaseRunParams ,
113+ provider : "amazon-bedrock" ,
114+ model : "global.anthropic.claude-sonnet-4-6" ,
115+ runId : "run-bedrock-prompt-abort-without-fallback" ,
116+ config : makeModelFallbackCfg ( {
117+ agents : {
118+ defaults : {
119+ model : {
120+ primary : "amazon-bedrock/global.anthropic.claude-sonnet-4-6" ,
121+ fallbacks : [ ] ,
122+ } ,
123+ } ,
124+ } ,
125+ } ) ,
126+ } ) ;
127+
128+ expect ( result . payloads ) . toEqual ( [
129+ {
130+ text : "⚠️ Agent couldn't generate a response. Please try again." ,
131+ isError : true ,
132+ } ,
133+ ] ) ;
134+ expect ( result . meta ?. aborted ) . toBe ( true ) ;
135+ expect ( mockedRunEmbeddedAttempt ) . toHaveBeenCalledTimes ( 1 ) ;
136+ } ) ;
137+
97138 it ( "preserves visible output from a provider abort instead of handing off fallback" , async ( ) => {
98139 mockedClassifyFailoverReason . mockReturnValue ( "timeout" ) ;
99140 mockedRunEmbeddedAttempt . mockResolvedValueOnce (
0 commit comments