@@ -17,6 +17,18 @@ import {
1717import type { Args } from "./clawsweeper-args.js" ;
1818import type { CreateReviewCommandWorkflowDependencies } from "./clawsweeper-review-command-dependencies.js" ;
1919
20+ const AUTOMATIC_REVIEW_SOURCE_ACTIONS = new Set ( [
21+ "scheduled_hot_intake" ,
22+ "scheduled_normal_backfill" ,
23+ ] ) ;
24+
25+ export function isExplicitReviewDispatch ( args : Args , hasExplicitItemSelection : boolean ) : boolean {
26+ const sourceAction = stringArg ( args . review_source_action , "" ) . trim ( ) ;
27+ const plannedAutomaticReview =
28+ boolArg ( args . planned_automatic_review ) || AUTOMATIC_REVIEW_SOURCE_ACTIONS . has ( sourceAction ) ;
29+ return ! plannedAutomaticReview && hasExplicitItemSelection ;
30+ }
31+
2032export function prepareReviewCommand (
2133 args : Args ,
2234 dependencies : CreateReviewCommandWorkflowDependencies ,
@@ -159,9 +171,10 @@ export function prepareReviewCommand(
159171 ? { mainSha : localRangeData . baseSha , releaseStateComplete : true , latestRelease : null }
160172 : loadReviewGitInfo ( ) ;
161173 const reviewPolicy = reviewPolicyHash ( { model, reasoningEffort, sandboxMode, serviceTier } ) ;
162- const plannedAutomaticReview = boolArg ( args . planned_automatic_review ) ;
163- const explicitDispatch =
164- ! plannedAutomaticReview && ( itemNumber !== undefined || itemNumbers !== undefined ) ;
174+ const explicitDispatch = isExplicitReviewDispatch (
175+ args ,
176+ itemNumber !== undefined || itemNumbers !== undefined ,
177+ ) ;
165178 const maintainerRequest = additionalPrompt . trim ( ) . length > 0 ;
166179
167180 return {
0 commit comments