@@ -523,8 +523,9 @@ describe("gateway agent handler", () => {
523523 resetAgentTaskRegistryForTests ( ) ;
524524 resetSubagentRegistryForTests ( { persist : false } ) ;
525525 const persistSubagentRunsToDiskOrThrow = vi . fn ( ) ;
526+ const persistenceError = Object . assign ( new Error ( "disk full" ) , { code : "SQLITE_FULL" } ) ;
526527 persistSubagentRunsToDiskOrThrow . mockImplementationOnce ( ( ) => {
527- throw new Error ( "disk full" ) ;
528+ throw persistenceError ;
528529 } ) ;
529530 applyGatewaySubagentRegistryTestDeps ( {
530531 persistSubagentRunsToDiskOrThrow,
@@ -586,8 +587,11 @@ describe("gateway agent handler", () => {
586587 expect ( persistSubagentRunsToDiskOrThrow ) . toHaveBeenCalledTimes ( 1 ) ;
587588 expect ( mocks . agentCommand ) . toHaveBeenCalledTimes ( commandCallCount ) ;
588589 expect ( findTaskByRunId ( runId ) ) . toBeUndefined ( ) ;
589- const error = expectRespondError ( respond , { code : ErrorCodes . UNAVAILABLE } ) ;
590- expectStringFieldContains ( error , "message" , "run was not started" ) ;
590+ expectRespondError ( respond , {
591+ code : ErrorCodes . UNAVAILABLE ,
592+ message :
593+ "plugin subagent registry persistence failed; run was not started | disk full | SQLITE_FULL" ,
594+ } ) ;
591595 expect ( context . logGateway . warn ) . toHaveBeenCalledWith (
592596 expect . stringContaining ( "rejecting untracked dispatch" ) ,
593597 ) ;
@@ -636,8 +640,11 @@ describe("gateway agent handler", () => {
636640 pauseReason : "sessions_yield" ,
637641 } ) ;
638642 expect ( getSubagentRunByChildSessionKey ( childSessionKey ) ?. runId ) . not . toBe ( adoptionRunId ) ;
639- const adoptionError = expectRespondError ( adoptionRespond , { code : ErrorCodes . UNAVAILABLE } ) ;
640- expectStringFieldContains ( adoptionError , "message" , "run was not started" ) ;
643+ expectRespondError ( adoptionRespond , {
644+ code : ErrorCodes . UNAVAILABLE ,
645+ message :
646+ "plugin subagent registry persistence failed; run was not started | disk full during paused-run adoption" ,
647+ } ) ;
641648
642649 resetSubagentRegistryForTests ( { persist : false } ) ;
643650 const retryRunId = "plugin-subagent-registry-retry" ;
0 commit comments