@@ -17,7 +17,10 @@ import {
1717 admitSubagentCompletionDelivery ,
1818 settleSubagentCompletionDelivery ,
1919} from "./subagent-completion-admission.store.js" ;
20- import { retrySubagentCompletionDelivery } from "./subagent-completion-delivery.js" ;
20+ import {
21+ dismissSubagentCompletionDelivery ,
22+ retrySubagentCompletionDelivery ,
23+ } from "./subagent-completion-delivery.js" ;
2124import { subagentRuns } from "./subagent-registry-memory.js" ;
2225import { loadSubagentRegistryFromSqlite } from "./subagent-registry.store.sqlite.js" ;
2326import type { SubagentRunRecord } from "./subagent-registry.types.js" ;
@@ -312,6 +315,32 @@ describe("atomic subagent completion admission store", () => {
312315 reason : "completion delivery redrive limit reached" ,
313316 } ) ;
314317 expect ( resumeSubagentRun ) . not . toHaveBeenCalled ( ) ;
318+
319+ const dismissed = dismissSubagentCompletionDelivery ( input . task . taskId ) ;
320+ expect ( dismissed ) . toMatchObject ( {
321+ ok : true ,
322+ task : {
323+ deliveryStatus : "dismissed" ,
324+ terminalOutcome : "blocked" ,
325+ progressSummary : "canonical result" ,
326+ } ,
327+ } ) ;
328+ expect ( subagentRuns . get ( input . subagent . runId ) ?. delivery ) . toMatchObject ( {
329+ status : "discarded" ,
330+ disposition : "intentional_non_delivery" ,
331+ } ) ;
332+
333+ resetTaskRegistryForTests ( { persist : false } ) ;
334+ subagentRuns . clear ( ) ;
335+ for ( const [ runId , entry ] of loadSubagentRegistryFromSqlite ( ) ) {
336+ subagentRuns . set ( runId , entry ) ;
337+ }
338+ ensureTaskRegistryReady ( ) ;
339+ expect ( getTaskById ( input . task . taskId ) ) . toMatchObject ( {
340+ deliveryStatus : "dismissed" ,
341+ terminalOutcome : "blocked" ,
342+ progressSummary : "canonical result" ,
343+ } ) ;
315344 } ) ;
316345 } ) ;
317346} ) ;
0 commit comments