Skip to content

fix: auto-start coding agent for issue-triggered PRs#695

Merged
stranske merged 1 commit intomainfrom
fix/auto-start-issue-triggered-prs
Jan 9, 2026
Merged

fix: auto-start coding agent for issue-triggered PRs#695
stranske merged 1 commit intomainfrom
fix/auto-start-issue-triggered-prs

Conversation

@stranske
Copy link
Copy Markdown
Owner

@stranske stranske commented Jan 9, 2026

Problem

When PRs are created from issues (e.g., via verify:create-issue label), the Issue Intake workflow in consumer repos was always passing post_agent_comment: false, preventing the coding agent from automatically starting work.

This caused PRs to be stuck in agent-run-skipped state because:

  1. Issue event triggers have undefined inputs
  2. Template evaluates inputs.post_codex_comment && 'true' || 'false''false'
  3. No @codex start comment is posted
  4. Keepalive loop skips agent execution

Solution

Changed the consumer repo template to:

  • Default to 'true' for issue events (auto-start agent)
  • Respect inputs.post_codex_comment only for workflow_dispatch
  • Matches the reusable workflow's default behavior

Impact

All consumer repos using this template will now auto-start the coding agent when PRs are created from labeled issues, fixing:

  • PRs from verify:create-issue workflow
  • PRs from agent:codex labeled issues
  • Any issue-triggered PR creation

Testing

Tested the logic:

  • Issue event: post_agent_comment'true' (auto-start)
  • Manual dispatch with post_codex_comment: false: → 'false' (no auto-start)
  • Manual dispatch with post_codex_comment: true: → 'true' (auto-start)

Resolves the issue affecting:

The consumer repo template for agents-issue-intake.yml was always passing
post_agent_comment as false for issue-triggered events (when inputs are
undefined), preventing the coding agent from auto-starting.

Changed to default to 'true' for issue events, allowing workflow_dispatch
to override via the post_codex_comment input parameter. This matches the
reusable workflow's default behavior.

Fixes the issue where PRs created from issues (e.g., via verify:create-issue)
would never start the coding agent, leaving them stuck in 'agent-run-skipped'
state across all consumer repos.
Copilot AI review requested due to automatic review settings January 9, 2026 14:21
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jan 9, 2026

Automated Status Summary

Head SHA: 5129dde
Latest Runs: ⏳ pending — Gate
Required contexts: Gate / gate, Health 45 Agents Guard / Enforce agents workflow protections
Required: core tests (3.11): ⏳ pending, core tests (3.12): ⏳ pending, docker smoke: ⏳ pending, gate: ⏳ pending

Workflow / Job Result Logs
(no jobs reported) ⏳ pending

Coverage Overview

  • Coverage history entries: 1

Coverage Trend

Metric Value
Current 92.21%
Baseline 85.00%
Delta +7.21%
Minimum 70.00%
Status ✅ Pass

Top Coverage Hotspots (lowest coverage)

File Coverage Missing
scripts/workflow_health_check.py 62.6% 28
scripts/classify_test_failures.py 62.9% 37
scripts/ledger_validate.py 65.3% 63
scripts/mypy_return_autofix.py 82.6% 11
scripts/ledger_migrate_base.py 85.5% 13
scripts/fix_cosmetic_aggregate.py 92.3% 1
scripts/coverage_history_append.py 92.8% 2
scripts/workflow_validator.py 93.3% 4
scripts/update_autofix_expectations.py 93.9% 1
scripts/pr_metrics_tracker.py 95.7% 3
scripts/generate_residual_trend.py 96.6% 1
scripts/build_autofix_pr_comment.py 97.0% 2
scripts/aggregate_agent_metrics.py 97.2% 0
scripts/fix_numpy_asserts.py 98.1% 0
scripts/sync_test_dependencies.py 98.3% 1

Updated automatically; will refresh on subsequent CI/Docker completions.


Keepalive checklist

Scope

No scope information available

Tasks

  • No tasks defined

Acceptance criteria

  • No acceptance criteria defined

@stranske stranske merged commit c2564f5 into main Jan 9, 2026
42 of 43 checks passed
@stranske stranske deleted the fix/auto-start-issue-triggered-prs branch January 9, 2026 14:23
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jan 9, 2026

🤖 Keepalive Loop Status

PR #695 | Agent: Codex | Iteration 0/5

Current State

Metric Value
Iteration progress [----------] 0/5
Action wait (missing-agent-label)
Disposition skipped (transient)
Gate success
Tasks 0/7 complete
Keepalive ❌ disabled
Autofix ❌ disabled

🔍 Failure Classification

| Error type | infrastructure |
| Error category | resource |
| Suggested recovery | Confirm the referenced resource exists (repo, PR, branch, workflow, or file). |

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes an issue where the coding agent failed to auto-start for PRs created from labeled issues. The problem was that the post_agent_comment parameter was always evaluating to 'false' for issue-triggered events because inputs is undefined in those contexts.

Key Changes:

  • Modified the conditional logic for post_agent_comment to default to 'true' for issue events while respecting the inputs.post_codex_comment value only for workflow_dispatch events

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

mode: "create"
post_agent_comment: ${{ inputs.post_codex_comment && 'true' || 'false' }}
post_agent_comment: ${{ github.event_name == 'workflow_dispatch' && (inputs.post_codex_comment && 'true' || 'false') || 'true' }}
agent_pr_draft: ${{ inputs.bridge_draft_pr && 'true' || 'false' }}
Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency with line 181, this should follow the same pattern of checking github.event_name before accessing inputs.bridge_draft_pr. During issue events, inputs is undefined, and while this currently evaluates to 'false' (matching the reusable workflow's default), the pattern should be:

agent_pr_draft: ${{ github.event_name == 'workflow_dispatch' && (inputs.bridge_draft_pr && 'true' || 'false') || 'false' }}

This makes the behavior explicit and consistent with how post_agent_comment is now handled.

Suggested change
agent_pr_draft: ${{ inputs.bridge_draft_pr && 'true' || 'false' }}
agent_pr_draft: ${{ github.event_name == 'workflow_dispatch' && (inputs.bridge_draft_pr && 'true' || 'false') || 'false' }}

Copilot uses AI. Check for mistakes.
@chatgpt-codex-connector
Copy link
Copy Markdown

Summary

Testing

  • Not run (template change only).

View task →

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants