File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -567,6 +567,29 @@ describe("codex manager cli commands", () => {
567567 expect ( createAuthorizationFlowMock ) . not . toHaveBeenCalled ( ) ;
568568 } ) ;
569569
570+ it ( "falls through to OAuth when backup assessment throws EBUSY" , async ( ) => {
571+ setInteractiveTTY ( true ) ;
572+ loadAccountsMock . mockResolvedValue ( {
573+ version : 3 ,
574+ activeIndex : 0 ,
575+ activeIndexByFamily : { codex : 0 } ,
576+ accounts : [ ] ,
577+ } ) ;
578+ const ebusy = Object . assign ( new Error ( "EBUSY: resource busy" ) , {
579+ code : "EBUSY" ,
580+ } ) ;
581+ getActionableNamedBackupRestoresMock . mockRejectedValueOnce ( ebusy ) ;
582+ selectMock . mockResolvedValueOnce ( "cancel" ) ;
583+
584+ const { runCodexMultiAuthCli } = await import ( "../lib/codex-manager.js" ) ;
585+ const exitCode = await runCodexMultiAuthCli ( [ "auth" , "login" ] ) ;
586+
587+ expect ( exitCode ) . toBe ( 0 ) ;
588+ expect ( getActionableNamedBackupRestoresMock ) . toHaveBeenCalledTimes ( 1 ) ;
589+ expect ( confirmMock ) . not . toHaveBeenCalled ( ) ;
590+ expect ( createAuthorizationFlowMock ) . toHaveBeenCalledTimes ( 1 ) ;
591+ } ) ;
592+
570593 it ( "skips startup restore prompt in fallback login mode" , async ( ) => {
571594 setInteractiveTTY ( true ) ;
572595 isInteractiveLoginMenuAvailableMock . mockReturnValue ( false ) ;
You can’t perform that action at this time.
0 commit comments