@@ -23,7 +23,10 @@ import {
2323import { withReplyDispatcher } from "./dispatch-dispatcher.js" ;
2424import type { CommandSessionMetadataChange } from "./reply/command-session-metadata.js" ;
2525import { dispatchReplyFromConfig } from "./reply/dispatch-from-config.js" ;
26- import type { DispatchFromConfigResult } from "./reply/dispatch-from-config.types.js" ;
26+ import type {
27+ DispatchFromConfigResult ,
28+ DispatchReplyFromConfig ,
29+ } from "./reply/dispatch-from-config.types.js" ;
2730import type {
2831 InternalGetReplyFromConfig ,
2932 InternalGetReplyOptions ,
@@ -200,6 +203,7 @@ export async function dispatchInboundMessage(params: {
200203 toolsAllow ?: string [ ] ;
201204 replyOptions ?: InternalDispatchReplyOptions ;
202205 replyResolver ?: InternalGetReplyFromConfig ;
206+ dispatchReplyFromConfig ?: DispatchReplyFromConfig ;
203207 onSessionMetadataChanges ?: ( changes : CommandSessionMetadataChange [ ] ) => void ;
204208 replyPayloadRunState ?: ReplyPayloadRunState ;
205209 /** Observe-only turns run the agent without entering outbound hook stages. */
@@ -240,7 +244,7 @@ export async function dispatchInboundMessage(params: {
240244 measureDiagnosticsTimelineSpan (
241245 "auto_reply.dispatch_reply_from_config" ,
242246 ( ) =>
243- dispatchReplyFromConfig ( {
247+ ( params . dispatchReplyFromConfig ?? dispatchReplyFromConfig ) ( {
244248 ctx : finalized ,
245249 cfg : params . cfg ,
246250 dispatcher : params . dispatcher ,
@@ -269,6 +273,7 @@ type BufferedInboundDispatcherParams = {
269273 toolsAllow ?: string [ ] ;
270274 replyOptions ?: InternalDispatchReplyOptions ;
271275 replyResolver ?: InternalGetReplyFromConfig ;
276+ dispatchReplyFromConfig ?: DispatchReplyFromConfig ;
272277 onSessionMetadataChanges ?: ( changes : CommandSessionMetadataChange [ ] ) => void ;
273278} ;
274279
@@ -348,6 +353,7 @@ async function dispatchInboundMessageWithBufferedDispatcherCore(
348353 dispatcher,
349354 toolsAllow : params . toolsAllow ,
350355 replyResolver : params . replyResolver ,
356+ dispatchReplyFromConfig : params . dispatchReplyFromConfig ,
351357 replyOptions : {
352358 ...params . replyOptions ,
353359 ...replyOptions ,
0 commit comments