@@ -7307,6 +7307,81 @@ describe("dispatchReplyFromConfig", () => {
73077307 expect ( ( finalCalls [ 0 ] ?. [ 0 ] as ReplyPayload | undefined ) ?. text ) . toBe ( "The answer is 42" ) ;
73087308 } ) ;
73097309
7310+ it ( "suppresses short internal final status text after a group source reply was delivered" , async ( ) => {
7311+ setNoAbort ( ) ;
7312+ const dispatcher = createDispatcher ( ) ;
7313+ const hasRepliedRef = { value : true } ;
7314+ const ctx = buildTestCtx ( { Provider : "slack" , Surface : "slack" , ChatType : "group" } ) ;
7315+ const replyResolver = async ( ) => ( { text : "Sent." } ) satisfies ReplyPayload ;
7316+
7317+ await dispatchReplyFromConfig ( {
7318+ ctx,
7319+ cfg : emptyConfig ,
7320+ dispatcher,
7321+ replyResolver,
7322+ replyOptions : { hasRepliedRef } ,
7323+ } ) ;
7324+
7325+ expect ( dispatcher . sendFinalReply ) . not . toHaveBeenCalled ( ) ;
7326+ } ) ;
7327+
7328+ it ( "suppresses done-posted internal final status text after a group source reply was delivered" , async ( ) => {
7329+ setNoAbort ( ) ;
7330+ const dispatcher = createDispatcher ( ) ;
7331+ const hasRepliedRef = { value : true } ;
7332+ const ctx = buildTestCtx ( { Provider : "slack" , Surface : "slack" , ChatType : "group" } ) ;
7333+ const replyResolver = async ( ) =>
7334+ ( { text : "Done - posted to #research-tasks." } ) satisfies ReplyPayload ;
7335+
7336+ await dispatchReplyFromConfig ( {
7337+ ctx,
7338+ cfg : emptyConfig ,
7339+ dispatcher,
7340+ replyResolver,
7341+ replyOptions : { hasRepliedRef } ,
7342+ } ) ;
7343+
7344+ expect ( dispatcher . sendFinalReply ) . not . toHaveBeenCalled ( ) ;
7345+ } ) ;
7346+
7347+ it ( "keeps substantive group final text even when a source reply was delivered" , async ( ) => {
7348+ setNoAbort ( ) ;
7349+ const dispatcher = createDispatcher ( ) ;
7350+ const hasRepliedRef = { value : true } ;
7351+ const ctx = buildTestCtx ( { Provider : "slack" , Surface : "slack" , ChatType : "group" } ) ;
7352+ const reply = { text : "Here is the actual answer." } satisfies ReplyPayload ;
7353+ const replyResolver = async ( ) => reply ;
7354+
7355+ await dispatchReplyFromConfig ( {
7356+ ctx,
7357+ cfg : emptyConfig ,
7358+ dispatcher,
7359+ replyResolver,
7360+ replyOptions : { hasRepliedRef } ,
7361+ } ) ;
7362+
7363+ expect ( dispatcher . sendFinalReply ) . toHaveBeenCalledWith ( reply ) ;
7364+ } ) ;
7365+
7366+ it ( "keeps direct-chat final status text after source reply delivery" , async ( ) => {
7367+ setNoAbort ( ) ;
7368+ const dispatcher = createDispatcher ( ) ;
7369+ const hasRepliedRef = { value : true } ;
7370+ const ctx = buildTestCtx ( { Provider : "slack" , Surface : "slack" , ChatType : "direct" } ) ;
7371+ const reply = { text : "Sent." } satisfies ReplyPayload ;
7372+ const replyResolver = async ( ) => reply ;
7373+
7374+ await dispatchReplyFromConfig ( {
7375+ ctx,
7376+ cfg : emptyConfig ,
7377+ dispatcher,
7378+ replyResolver,
7379+ replyOptions : { hasRepliedRef } ,
7380+ } ) ;
7381+
7382+ expect ( dispatcher . sendFinalReply ) . toHaveBeenCalledWith ( reply ) ;
7383+ } ) ;
7384+
73107385 it ( "suppresses isReasoning payloads from block replies (generic dispatch path)" , async ( ) => {
73117386 setNoAbort ( ) ;
73127387 const dispatcher = createDispatcher ( ) ;
0 commit comments