Skip to content

fix(auto-pilot): use WORKFLOWS_SCRIPTS_PATH for all script calls - #939

Merged
stranske merged 1 commit into
mainfrom
fix/auto-pilot-script-paths
Jan 18, 2026
Merged

stranske merged 1 commit into
mainfrom
fix/auto-pilot-script-paths

Conversation

@stranske

Copy link
Copy Markdown
Owner

Problem

The agents:auto-pilot workflow was failing in consumer repos (e.g., Portable-Alpha-Extension-Model#1159) with:

python: can't open file '/home/runner/work/.../scripts/autopilot_step_timer.py': [Errno 2] No such file or directory

Root Cause

Two configuration issues in the template:

  1. Incomplete sparse checkout: Only .github/scripts was checked out, but the Python metrics scripts (autopilot_step_timer.py, autopilot_metrics_collector.py) are in the root scripts/ folder

  2. Incorrect script paths: Script calls used relative paths (python scripts/...) which looked in the consumer repo instead of the workflows-lib checkout

Fix

  • Add scripts to sparse-checkout alongside .github/scripts
  • Update all 26 script invocations to use $WORKFLOWS_SCRIPTS_PATH/scripts/...

Testing

After merging, re-sync to consumer repos and re-trigger the auto-pilot workflow on the test issue.

The agents-auto-pilot workflow was failing because:
1. Sparse checkout only included .github/scripts, but Python metrics
   scripts are in the root scripts/ folder
2. Script calls used relative paths (scripts/...) which looked in the
   consumer repo instead of the workflows-lib checkout

Fixes:
- Add 'scripts' to sparse-checkout alongside .github/scripts
- Update all script invocations to use $WORKFLOWS_SCRIPTS_PATH/scripts/...

Tested against: stranske/Portable-Alpha-Extension-Model#1159
Copilot AI review requested due to automatic review settings January 18, 2026 07:42
@github-actions

Copy link
Copy Markdown
Contributor

Automated Status Summary

Head SHA: f1b31fb
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 93.12%
Baseline 85.00%
Delta +8.12%
Minimum 70.00%
Status ✅ Pass

Top Coverage Hotspots (lowest coverage)

File Coverage Missing
src/cli_parser.py 81.8% 4
src/percentile_calculator.py 95.0% 1
src/aggregator.py 95.0% 2
src/__init__.py 100.0% 0
src/ndjson_parser.py 100.0% 0

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

@github-actions

Copy link
Copy Markdown
Contributor

🤖 Keepalive Loop Status

PR #939 | 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/4 complete
Timeout 45 min (default)
Timeout usage 1m elapsed (4%, 44m remaining)
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). |

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 a critical bug in the agents:auto-pilot workflow where Python scripts from the workflows-lib repository were not accessible in consumer repos. The root cause was incomplete sparse checkout configuration and incorrect script path references.

Changes:

  • Added scripts directory to sparse-checkout configuration alongside existing .github/scripts
  • Updated all 26 Python script invocations to use $WORKFLOWS_SCRIPTS_PATH environment variable instead of relative paths

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

@stranske
stranske merged commit a520c7a into main Jan 18, 2026
43 of 44 checks passed
@stranske
stranske deleted the fix/auto-pilot-script-paths branch January 18, 2026 07:44
stranske added a commit that referenced this pull request Jan 18, 2026
The linked PR detection was matching cross-references from any
repository, including references from other repos' PRs. This caused
issues when a PR in repo A mentioned an issue in repo B - the auto-pilot
would incorrectly think repo B's issue already had a linked PR.

Added check: event.source?.issue?.repository?.full_name must match
the current repo before considering it a linked PR.

Fixes: stranske/Portable-Alpha-Extension-Model#1159 was incorrectly
linked to #939 due to a mention in the PR body.
stranske added a commit that referenced this pull request Jan 18, 2026
The linked PR detection was matching cross-references from any
repository, including references from other repos' PRs. This caused
issues when a PR in repo A mentioned an issue in repo B - the auto-pilot
would incorrectly think repo B's issue already had a linked PR.

Added check: event.source?.issue?.repository?.full_name must match
the current repo before considering it a linked PR.

Fixes: stranske/Portable-Alpha-Extension-Model#1159 was incorrectly
linked to #939 due to a mention in the PR body.
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