Skip to content

Fix #14364: upgrade gh-aw to v0.82.9 and repin setup - #14365

Merged
jankratochvilcz merged 1 commit into
mainfrom
fix-gh-aw-setup-pin-drift
Jul 15, 2026
Merged

jankratochvilcz merged 1 commit into
mainfrom
fix-gh-aw-setup-pin-drift

Conversation

@jankratochvilcz

@jankratochvilcz jankratochvilcz commented Jul 15, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #14364.

Root cause

The agentic-workflow lock files (*.agent.lock.yml) are generated by the gh aw compiler, and their inlined helper scripts are staged at runtime by the pinned github/gh-aw-actions/setup action. That setup bundle is version-coupled to the compiler.

On main the lock bodies were compiled by gh-aw v0.79.8 — which require()s extract_base_branch_from_agent_output.cjs in the create-pull-request safe-outputs path — but the setup pin had drifted to v0.82.8, whose bundle no longer ships that helper. Result: every workflow that creates a PR crashed its safe_outputs job with Cannot find module '.../extract_base_branch_from_agent_output.cjs' (MODULE_NOT_FOUND) and no PR was ever created. This broke flaky-test-fixer, flaky-test-detector, and dreaming alike.

Fix

Recompile the whole fleet with gh-aw v0.82.9 and repin github/gh-aw-actions/setup to v0.82.9 (ca8678ca22a7aab577514482576720da641e5661), so the generated bodies and the staged helpers come from one consistent toolchain. The v0.82.9 bodies no longer require the dropped helper.

Source-level verification (can't be tested via a branch run)

These workflows gate on environment: copilot-pat-pool, whose deployment-branch policy is restricted to main, so an end-to-end dispatch from a branch fails instantly at pre_activation. Instead I verified statically: all 39 .cjs helpers the recompiled fleet require()s are present in the pinned setup tree at ca8678ca (which ships 370). In particular the create-PR path now uses create_pull_request.cjs / create_pull_request_helpers.cjs / push_to_pull_request_branch.cjs, all present. gh aw compile is idempotent on the committed state.

About the diff (please read)

A gh-aw version bump legitimately regenerates large portions of every lock file — that churn is expected, not hand-editing.

  • .github/workflows/agentics-maintenance.yml (new, ~633 lines) is auto-generated by gh aw compile at v0.82.9 — it's the companion "maintenance" workflow the compiler emits for workflows that use expiring safe outputs. It is generated output, not something authored here. It can be disabled by setting {"maintenance": false} in .github/workflows/aw.json if the team prefers not to have it.
  • The one-line-per-file *.agent.md changes collapse the multi-line COPILOT_GITHUB_TOKEN: case(...) block to a single line — required, because v0.82.9's compiler rejects the old multi-line form.
  • I intentionally did not include the .github/agents/agentic-workflows.md and .github/skills/agentic-workflows/SKILL.md authoring-helper files: they are not produced by gh aw compile (they come from a separate scaffolding step), aren't needed for this fix, and would add a redundant agent+skill pair to the repo.

Supersedes the minimal dreaming-only #14363 (left open for the maintainer to close).

Copilot AI review requested due to automatic review settings July 15, 2026 09:38
@jankratochvilcz
jankratochvilcz requested a review from a team as a code owner July 15, 2026 09:38
@jankratochvilcz jankratochvilcz added the Area: Our Own Build Problems affecting the build or build infrastructure of the MSBuild repo itself. label Jul 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Skill Validator Results

⛔ Findings need attention

Scope Checked
Skills 1
Agents 0
Total 1
Severity Count
--- ---:
❌ Errors 1
⚠️ Warnings 2
ℹ️ Advisories 0

Summary

Level Finding
❌ No agents found in the specified paths: "/home/runner/work/msbuild/msbuild/.github/agents"
Full validator output ```text Found 1 skill(s) [agentic-workflows] 📊 agentic-workflows: 1,055 BPE tokens [chars/4: 973] (detailed ✓), 1 sections, 0 code blocks [agentic-workflows] ⚠ No code blocks — agents perform better with concrete snippets and commands. [agentic-workflows] ⚠ No numbered workflow steps — agents follow sequenced procedures more reliably. ✅ All checks passed (1 skill(s)) ❌ No agents found in the specified paths: "/home/runner/work/msbuild/msbuild/.github/agents" ```
> **Note:** The validator returned a non-zero exit code. Please review the findings above before merge.

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 the agentic-workflow toolchain drift behind #14364 by upgrading the repo’s gh-aw compilation output to v0.82.9, repinning the github/gh-aw-actions/setup / setup-cli actions to the matching SHA, and regenerating the affected workflow lock files so the staged helper bundle and compiled workflow bodies agree again.

Changes:

  • Upgrade gh-aw-generated workflow fleet to v0.82.9 and repin github/gh-aw-actions/setup / setup-cli to ca8678ca22a7aab577514482576720da641e5661.
  • Normalize the COPILOT_GITHUB_TOKEN expression in the .agent.md sources so gh-aw emits valid lock YAML consistently.
  • Add the newly-generated maintenance workflow and add repo-local agent/skill routing docs for working on gh-aw workflows.

Reviewed changes

Copilot reviewed 13 out of 16 changed files in this pull request and generated no comments.

Show a summary per file
File Description
.github/aw/actions-lock.json Updates the repo’s gh-aw action pin lock entries to the v0.82.9 setup/setup-cli SHA.
.github/workflows/review.agent.md Normalizes COPILOT_GITHUB_TOKEN to a single YAML scalar expression for v0.82.9 compilation.
.github/workflows/review.agent.lock.yml Regenerated by gh-aw v0.82.9; repins setup action and refreshes runtime/safe-outputs plumbing.
.github/workflows/review-on-open.agent.md Same token-expression normalization as other agent sources.
.github/workflows/review-on-open.agent.lock.yml Regenerated by gh-aw v0.82.9 to match the repinned setup bundle and current compiler output.
.github/workflows/flaky-test-fixer.agent.md Same token-expression normalization as other agent sources.
.github/workflows/flaky-test-fixer.agent.lock.yml Regenerated by gh-aw v0.82.9 to keep helper requirements in sync with setup bundle.
.github/workflows/flaky-test-detector.agent.md Same token-expression normalization as other agent sources.
.github/workflows/flaky-test-detector.agent.lock.yml Regenerated by gh-aw v0.82.9 to keep helper requirements in sync with setup bundle.
.github/workflows/dreaming.agent.md Same token-expression normalization as other agent sources.
.github/workflows/dreaming.agent.lock.yml Regenerated by gh-aw v0.82.9 to keep helper requirements in sync with setup bundle.
.github/workflows/close-stale-prs.agent.md Same token-expression normalization as other agent sources.
.github/workflows/close-stale-prs.agent.lock.yml Regenerated by gh-aw v0.82.9; updates pins and refreshes runtime/safe-outputs plumbing.
.github/workflows/agentics-maintenance.yml New gh-aw-generated maintenance workflow for repo agentic maintenance operations.
.github/skills/agentic-workflows/SKILL.md Adds a repo-local skill router for gh-aw workflow create/update/debug/upgrade requests.
.github/agents/agentic-workflows.md Adds a dispatcher agent description for gh-aw workflow work in this repo.

Recompile the gh-aw workflow fleet with gh-aw v0.82.9 and repin
github/gh-aw-actions/setup to v0.82.9 (ca8678ca) so the generated lock
bodies and the staged helper scripts come from the same toolchain
version. Previously the lock bodies were compiled by v0.79.8 (which
require()s extract_base_branch_from_agent_output.cjs) while the setup
pin had drifted to v0.82.8, whose bundle no longer ships that helper,
so every create-pull-request safe-outputs job crashed with
MODULE_NOT_FOUND and no PR was ever created.

The v0.82.9 bodies no longer require that helper; verified at the
source level that the pinned setup tree ships all 39 .cjs helpers the
recompiled fleet requires.

Also regenerated .github/workflows/agentics-maintenance.yml, which
'gh aw compile' produces automatically at v0.82.9 as the companion
maintenance workflow for expiring safe outputs.

Fixes #14364

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 1b63f3d4-d050-4905-9e00-bee816df8a94
@jankratochvilcz
jankratochvilcz force-pushed the fix-gh-aw-setup-pin-drift branch from 8a7b3a8 to 7352019 Compare July 15, 2026 09:47

@github-actions github-actions Bot 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.

Caution

agentic threat detected
Threat detection flagged this output in warn mode. Manual review is REQUIRED before any follow-up automation.

Details

The threat detection results could not be parsed.

Review the workflow run logs for details.

Review: gh-aw v0.79.8 → v0.82.9 upgrade

Summary: Clean, well-scoped toolchain upgrade. No blocking concerns.

Security ✅

  • All six lock files consistently pin github/gh-aw-actions/setup and setup-cli to SHA ca8678ca22a7aab577514482576720da641e5661 (v0.82.9). No old SHAs (c0338fef..., 99d9d888...) appear on any added line.
  • The new agentics-maintenance.yml uses top-level permissions: {} with narrowly scoped per-job overrides (discussions: write, issues: write, pull-requests: write, actions: write). The broadest combination (actions: write + contents: write + pull-requests: write) is correctly gated behind workflow_dispatch/workflow_call with explicit operation guards and a fork exclusion check.
  • persist-credentials: false on the checkout step in the maintenance workflow is good hygiene.

Version consistency ✅

  • actions-lock.json: both setup and setup-cli entries updated to v0.82.9 / ca8678ca....
  • The removed actions/[email protected] top-level entry is still SHA-pinned inline in each lock file's manifest comment — not a regression.
  • Container images bumped consistently across all six lock files (firewall agent/proxy/squid 0.27.2→0.27.31, mcpg v0.3.25→v0.4.1, github-mcp-server v1.1.2→v1.5.0), all with digest pins.

Scope ✅

  • All changes are strictly within .github/. No MSBuild source, test, or build infrastructure is touched.
  • The three new files (agentic-workflows.md, skills/agentic-workflows/SKILL.md, agentics-maintenance.yml) are expected outputs of the v0.82.9 compiler — maintenance workflow generation and skill/agent metadata are standard additions in this toolchain version.
  • The .agent.md PAT-pool normalization (multi-line block scalar → single-line quoted scalar) is a valid fix required by v0.82.9's YAML parser, and the compiled output in the lock files is semantically equivalent.

Minor observation (non-blocking)

The apply_safe_outputs job in agentics-maintenance.yml (lines ~540–600) holds actions: write + contents: write + pull-requests: write simultaneously. This is the widest permission set in the file. Since it's auto-generated and guarded by the fork/dispatch checks, it's acceptable — but worth noting for future audits if the maintenance workflow scope expands.

Generated by Expert Code Review (on open) for #14365 · 65.7 AIC · ⊞ 30.4K

@jankratochvilcz
jankratochvilcz enabled auto-merge (squash) July 15, 2026 09:48
@jankratochvilcz
jankratochvilcz merged commit bd01c1d into main Jul 15, 2026
14 checks passed
@jankratochvilcz
jankratochvilcz deleted the fix-gh-aw-setup-pin-drift branch July 15, 2026 10:51
jankratochvilcz added a commit that referenced this pull request Jul 15, 2026
… curation PR (#14369)

## Problem

The Dreaming workflow (added in #14357) ran end-to-end successfully for
the first time after the fleet gh-aw upgrade (#14365), produced a
high-quality proposal (two small "learning atom" edits to
`.github/instructions/*.instructions.md`) — but **never opened a PR**.
It fell back to opening a review *issue* (#14368) instead.

### Root cause

The workflow's whole job is to curate the "learning atoms": `AGENTS.md`
and everything under `.github/instructions`, `.github/skills`,
`.github/agents`. Those are *exactly* the paths gh-aw's default
file-protection policy guards:

- `AGENTS.md` is in the built-in `protected_files` list, and
- `protect_top_level_dot_folders: true` (a v0.82.9 default) marks every
`.github/**` path as protected.

The default `protected-files` policy is `request_review`. When a run
edited the protected instruction files, the safe-outputs **signed-commit
push was refused**:

```
pushSignedCommits: refusing unsigned push for branch 'dreaming/…':
Signed-commit payload violates file-protection policy (request_review):
.github/instructions/tasks.instructions.md, .github/instructions/tests.instructions.md
```

…so the run silently degraded to a review issue.

## Fix

Set `protected-files: allowed` on the `create-pull-request` safe output.

Verified against the pinned setup action (`github/gh-aw-actions/setup`
v0.82.9, `ca8678ca`): both `checkFileProtection` (pre-apply) and
`checkFileProtectionPostApply` (the exact function the signed-push gate
calls) short-circuit to `{ action: "allow" }` when the policy is
`allowed`, **before** the manifest/dot-folder checks run.

### Why this is safe

- The tight `allowed-files` allowlist (`AGENTS.md`,
`.github/instructions/**`, `.github/skills/**`, `.github/agents/**`) is
the real guardrail. It is enforced **independently and ahead of** the
protected-files check, so the agent still cannot touch product code,
tests, build manifests, or the workflow definitions.
- The PR still needs **maintainer approval** before it can merge, so
human review is preserved at the PR gate — the `request_review` issue
fallback was redundant friction for a workflow whose only output is a PR
against these files.

## Diff

Two files, minimal:

- `.github/workflows/dreaming.agent.md` — one `protected-files: allowed`
line (+ explanatory comment) in the `create-pull-request` config.
- `.github/workflows/dreaming.agent.lock.yml` — regenerated via `gh aw
compile dreaming.agent --approve`; the only functional change is
`protected_files_policy: request_review` → `allowed` (plus the
auto-generated frontmatter/EOF hashes).

Once merged, a re-run should open the curation PR directly instead of
issue #14368.

Co-authored-by: Copilot App <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: Our Own Build Problems affecting the build or build infrastructure of the MSBuild repo itself.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Agentic workflows can't open PRs: gh-aw-actions/setup pin drifted to v0.82.8, dropping a helper the v0.79.8-compiled bodies require

3 participants