Skip to content

Fix Dreaming workflow: repin gh-aw setup action to v0.79.8 so it can open its PR - #14363

Closed
jankratochvilcz wants to merge 1 commit into
mainfrom
jankratochvilcz-dreaming-workflow
Closed

jankratochvilcz wants to merge 1 commit into
mainfrom
jankratochvilcz-dreaming-workflow

Conversation

@jankratochvilcz

@jankratochvilcz jankratochvilcz commented Jul 15, 2026 •

Copy link
Copy Markdown
Contributor

What this changes

One pin in dreaming.agent.lock.yml: github/gh-aw-actions/setup v0.82.8 → v0.79.8 (7 identical lines). Nothing else.

Why (and why it's not an arbitrary manual edit)

On its first run the Dreaming agent worked correctly and produced a good learning-atom proposal, but the safe_outputs job crashed before creating the PR:

Error: Cannot find module '.../gh-aw/actions/extract_base_branch_from_agent_output.cjs'
  code: 'MODULE_NOT_FOUND'

The lock body is generated by gh-aw v0.79.8, which emits require('extract_base_branch_from_agent_output.cjs'). That helper is staged by the setup action, whose script bundle is version-coupled to the compiler. The body's setup pin had drifted to v0.82.8, whose bundle no longer ships that file (source-verified below), so the require fails.

Repinning setup to v0.79.8 is the value the repo's own tooling already declares — this is a reconciliation back to the declared inputs, not a hand-picked number:

  • .github/aw/actions-lock.json pins github/gh-aw-actions/[email protected] (c0338fef).
  • A clean gh aw compile dreaming.agent (compiler v0.79.8) independently emits the same [email protected] pin.

Source-level confirmation of the coupling:

github/gh-aw-actions/setup ships setup/js/extract_base_branch_from_agent_output.cjs?
v0.79.8 (c0338fef) — matches the compiler ✅ present
v0.82.8 (99d9d888) — the drifted body pin ❌ absent

I kept the change to the single poisoned pin rather than committing a full recompile, because a clean local recompile also reverts actions/checkout v7.0.0 → v6.0.3 (my local toolchain is out of sync with the fleet's codemods) — an unrelated churn. This PR keeps checkout at the fleet's v7.0.0 and touches only setup.

Fleet-wide note (tracked separately)

flaky-test-fixer and flaky-test-detector carry the same drifted [email protected] pin and fail identically at safe_outputs whenever they try to open a PR — every scheduled flaky-test-fixer run has been failing this way. Filed as a separate issue for the infra owners to fix fleet-wide (or at the gh aw upgrade codemod / actions-lock.json level).

Verification / testing

The copilot-pat-pool environment (which the workflow's pre_activation job gates on) has a deployment-branch policy restricted to main, so an end-to-end branch test can't get past the token gate — the fix must be on main to run for real. Confirmed at the source level (table above) and by clean recompile that this is the correct pin; once merged I'll re-trigger to confirm the learning-atom PR opens end-to-end.

Outcome evidence (first run, 29402080275)

The agent's proposal, exactly the intended small / evidence-based / edit-over-add / no-duplicate behavior:

docs: reinforce #nullable disable prohibition in test file instructions — adds two sentences to .github/instructions/tests.instructions.md; the same miss recurred independently in 3 PRs in the past week (#14305, #14307, #14315). AGENTS.md covers it repo-wide but it keeps getting missed in new test files, so the path-scoped instruction file is where agents will actually see it.

…piler

The lock body is generated by gh-aw v0.79.8, which emits
`require('extract_base_branch_from_agent_output.cjs')` in the safe_outputs
job. That script is staged by the `github/gh-aw-actions/setup` action, whose
bundle is version-coupled to the compiler. The body pin had drifted to
v0.82.8 (99d9d888), whose bundle no longer ships that file, so the
safe_outputs job crashed with MODULE_NOT_FOUND and the curated PR was never
created.

Repin `setup` to v0.79.8 (c0338fef), matching both the compiler version and
the canonical pin in .github/aw/actions-lock.json. This stages the expected
script and lets the workflow open its learning-atom PR.

Note: flaky-test-fixer and flaky-test-detector share the same drifted pin and
fail identically when they try to create a PR; they need the same fix.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 1b63f3d4-d050-4905-9e00-bee816df8a94
@jankratochvilcz
jankratochvilcz requested a review from a team as a code owner July 15, 2026 09:07
Copilot AI review requested due to automatic review settings July 15, 2026 09:07
@jankratochvilcz

Copy link
Copy Markdown
Contributor Author

Confirmed the root cause directly against the github/gh-aw-actions source tree:

Version setup/js/extract_base_branch_from_agent_output.cjs
v0.79.8 (c0338fef) ✅ present
v0.82.8 (99d9d888) ❌ absent

The v0.79.8 compiler emits require(".../actions/extract_base_branch_from_agent_output.cjs"), so the setup action that stages it must also be v0.79.8. v0.82.8 refactored that helper away, which is exactly why the safe_outputs job hit MODULE_NOT_FOUND. This repin restores the matched pair.

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 Dreaming agentic workflow’s safe_outputs failure by repinning the github/gh-aw-actions/setup action in the compiled lock workflow so the staged helper scripts match the gh-aw compiler version that produced the workflow body.

Changes:

  • Repin github/gh-aw-actions/setup from v0.82.8 (99d9d888...) to v0.79.8 (c0338fef...) in all jobs within the compiled workflow.
  • Update the “Custom actions used” header comment to reflect the corrected setup action pin.

@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: Fix Dreaming workflow — repin gh-aw setup action to v0.79.8

Correctness ✅

The root cause analysis is correct. The version mismatch between the lock body (generated by v0.79.8, which emits require('extract_base_branch_from_agent_output.cjs')) and the setup action (pinned to v0.82.8, which dropped that file) is a well-understood version skew problem. Repinning to v0.79.8 (c0338fef) is the right fix to restore consistency.

Consistency ✅

All 6 uses: occurrences are updated, and the comment block at the top is also updated to match. No stale references left behind.

Risk: Low (for this workflow)

Downgrading setup from v0.82.8 → v0.79.8 is low risk here because the lock body was already generated against v0.79.8. This restores a known-compatible pairing rather than introducing anything new.

Completeness ⚠️

The PR description explicitly acknowledges that flaky-test-fixer and flaky-test-detector carry the same drifted pin and fail identically, but scopes this fix only to Dreaming. If those workflows are actively running and failing, this creates a situation where the same known breakage exists in two other places. Consider whether a follow-up PR is tracked or whether this PR's scope should be widened.

Forward-looking concern

This is a regression-to-fix-a-regression pattern. The proper long-term fix is to either:

  1. Regenerate the lock file against v0.82.8, or
  2. Pin all gh-aw components to a single coherent version set going forward.

The PR is acceptable as a targeted hotfix, but a follow-up to align all three workflows (Dreaming, flaky-test-fixer, flaky-test-detector) to a single current version would be cleaner.

Generated by Expert Code Review (on open) for #14363 · 34.5 AIC · ⊞ 30.3K

@jankratochvilcz

Copy link
Copy Markdown
Contributor Author

Fleet-wide breakage tracked in #14364 (flaky-test-fixer / flaky-test-detector fail identically). This PR is the minimal per-workflow fix for dreaming so its learning-atom PRs can be created.

jankratochvilcz added a commit that referenced this pull request Jul 15, 2026
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).

Co-authored-by: Copilot App <[email protected]>
@jankratochvilcz

Copy link
Copy Markdown
Contributor Author

Superseded by #14365 (merged), which upgraded the whole gh-aw fleet to v0.82.9 and repinned github/gh-aw-actions/setup consistently. Main now has dreaming.agent.lock.yml pinned to setup v0.82.9, so this minimal v0.79.8-only fix is no longer needed. Closing.

This branch had an error being deployed

1 failed deployment
copilot-pat-pool — ad72d6ee Deployed Jul 15, 2026 by jankratochvilcz via pre_activation #3
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