fix: use agent mode for issues events with explicit prompts (#530)

Fixes #528 - Issues events now correctly use agent mode when an explicit
prompt is provided in the workflow YAML, matching the behavior of PR events.

Previously, issues events would always use tag mode (with tracking comments)
even when a prompt was provided, creating inconsistent behavior compared to
pull request events which correctly used agent mode for automation.

The fix adds a check for explicit prompts before checking for triggers,
ensuring consistent mode selection across all event types.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
kashyap murali
2025-09-06 20:32:20 -07:00
committed by GitHub
parent c1ffc8a0e8
commit 9975f36410
2 changed files with 31 additions and 0 deletions

View File

@@ -44,6 +44,10 @@ export function detectMode(context: GitHubContext): AutoDetectedMode {
// Issue events
if (isEntityContext(context) && isIssuesEvent(context)) {
// If prompt is provided, use agent mode (same as PR events)
if (context.inputs.prompt) {
return "agent";
}
// Check for @claude mentions or labels/assignees
if (checkContainsTrigger(context)) {
return "tag";