@@ -2080,18 +2080,21 @@ describe("cron method validation", () => {
20802080 expectResponseError ( systemEvent . respond , { code : "INVALID_REQUEST" , messageIncludes : "text" } ) ;
20812081 } ) ;
20822082
2083- it ( "rejects ambiguous announce delivery on add when multiple channels are configured " , async ( ) => {
2083+ it ( "forwards implicit announce delivery to the service-owned ambiguity validation " , async ( ) => {
20842084 setRuntimeConfig ( telegramSlackConfig ( { includeMainSession : true } ) ) ;
20852085
2086+ // Implicit routing (no channel given) is validated by the cron service on the
2087+ // merged job, where session-backed and best-effort shapes are visible; the
2088+ // method layer must not pre-reject it (see assertAnnounceDeliveryChannelSupport).
20862089 const { context, respond } = await invokeCronAdd (
20872090 agentTurnCronParams ( {
2088- name : "ambiguous announce add" ,
2091+ name : "implicit announce add" ,
20892092 delivery : { mode : "announce" } ,
20902093 } ) ,
20912094 ) ;
20922095
2093- expect ( context . cron . add ) . not . toHaveBeenCalled ( ) ;
2094- expectResponseError ( respond , { messageIncludes : "delivery.channel is required" } ) ;
2096+ expect ( context . cron . add ) . toHaveBeenCalled ( ) ;
2097+ expectCronSuccess ( respond ) ;
20952098 } ) ;
20962099
20972100 it ( "ignores stale ownerless channel config when validating default announce delivery" , async ( ) => {
@@ -3273,13 +3276,14 @@ describe("cron method validation", () => {
32733276 expectResponseError ( respond , { messageIncludes : "belongs to synology-chat, not slack" } ) ;
32743277 } ) ;
32753278
3276- it ( "rejects ambiguous announce delivery on update when multiple channels are configured " , async ( ) => {
3279+ it ( "forwards implicit announce delivery updates to the service-owned ambiguity validation " , async ( ) => {
32773280 setRuntimeConfig ( telegramSlackConfig ( { includeMainSession : true } ) ) ;
32783281
3279- const { context, respond } = await invokeCronUpdateDelivery ( { mode : "announce" } ) ;
3282+ // Same ownership as the add path: the service validates the merged job, so an
3283+ // implicit announce patch must reach it instead of dying at the method layer.
3284+ const { context } = await invokeCronUpdateDelivery ( { mode : "announce" } ) ;
32803285
3281- expect ( context . cron . update ) . not . toHaveBeenCalled ( ) ;
3282- expectResponseError ( respond , { messageIncludes : "delivery.channel is required" } ) ;
3286+ expect ( context . cron . update ) . toHaveBeenCalled ( ) ;
32833287 } ) ;
32843288
32853289 it ( "loads the cron job before validating update delivery patches" , async ( ) => {
@@ -3315,7 +3319,7 @@ describe("cron method validation", () => {
33153319 params : {
33163320 id : "cron-1" ,
33173321 patch : {
3318- delivery : { mode : "announce" } ,
3322+ delivery : { mode : "announce" , channel : "whatsapp" } ,
33193323 } ,
33203324 } as never ,
33213325 respond : respond as never ,
@@ -3327,7 +3331,7 @@ describe("cron method validation", () => {
33273331 expect ( context . cron . readJob ) . toHaveBeenCalledWith ( "cron-1" ) ;
33283332 expect ( context . cron . getJob ) . not . toHaveBeenCalled ( ) ;
33293333 expect ( context . cron . update ) . not . toHaveBeenCalled ( ) ;
3330- expectResponseError ( respond , { messageIncludes : "delivery.channel is required " } ) ;
3334+ expectResponseError ( respond , { messageIncludes : "must be one of " } ) ;
33313335 } ) ;
33323336
33333337 it ( "does not revalidate stale delivery config for unrelated updates" , async ( ) => {
0 commit comments