Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/modes/detector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -103,6 +104,7 @@ function validateTrackProgressEvent(context: GitHubContext): void {
"synchronize",
"ready_for_review",
"reopened",
"labeled",
];
if (!validActions.includes(context.eventAction)) {
throw new Error(
Expand Down
14 changes: 14 additions & 0 deletions test/modes/detector.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down