diff --git a/src/modes/detector.ts b/src/modes/detector.ts index c15ce88a1..8d477b9cc 100644 --- a/src/modes/detector.ts +++ b/src/modes/detector.ts @@ -67,6 +67,7 @@ export function detectMode(context: GitHubContext): AutoDetectedMode { "synchronize", "ready_for_review", "reopened", + "labeled", ]; if (context.eventAction && supportedActions.includes(context.eventAction)) { // If prompt is provided, use agent mode (default for automation) @@ -103,6 +104,7 @@ function validateTrackProgressEvent(context: GitHubContext): void { "synchronize", "ready_for_review", "reopened", + "labeled", ]; if (!validActions.includes(context.eventAction)) { throw new Error( diff --git a/test/modes/detector.test.ts b/test/modes/detector.test.ts index c8a6c75ff..ccaf32467 100644 --- a/test/modes/detector.test.ts +++ b/test/modes/detector.test.ts @@ -61,6 +61,20 @@ describe("detectMode with enhanced routing", () => { expect(detectMode(context)).toBe("tag"); }); + it("should use tag mode when track_progress is true for pull_request.labeled", () => { + const context: GitHubContext = { + ...baseContext, + eventName: "pull_request", + eventAction: "labeled", + payload: { pull_request: { number: 1 } } as any, + entityNumber: 1, + isPR: true, + inputs: { ...baseContext.inputs, trackProgress: true }, + }; + + expect(detectMode(context)).toBe("tag"); + }); + it("should use agent mode when track_progress is false for pull_request.opened", () => { const context: GitHubContext = { ...baseContext,