Skip to content

[aw-compat] Bug: serena-tools-to-shared-import codemod leaves workflows broken in two edge cases #28032

@github-actions

Description

@github-actions

The serena-tools-to-shared-import codemod (v1.0.0) has two unhandled edge cases that leave workflows in a non-compiling state after gh aw fix --write is applied. Both cases were observed in the 2026-04-23 daily compatibility run against top-starred public repositories.

Found in daily run §24831382557.

Edge Case 1 — engine: block with additional sub-fields alongside tools.serena

Affected repo: microsoft/FluidFramework (~4.5k stars)
File: .github/workflows/duplicate-code-detector.md

The workflow had tools.serena nested inside engine: alongside other engine sub-fields (model:, id:):

# BEFORE fix
engine:
  tools:
    serena:
      languages: ["typescript"]
  model: gpt-5.2
  id: copilot

After serena-tools-to-shared-import runs, it moves tools.serena to a top-level imports entry but does not preserve the sibling model: and id: fields. They end up at the wrong YAML level:

# AFTER fix (broken)
engine:
imports:
  - uses: shared/mcp/serena.md
    with:
      languages: ["typescript"]
  model: gpt-5.2      ← should be under engine:, now sibling of imports
  id: copilot         ← same problem

Compile error produced:

.../duplicate-code-detector.md:16:3: error: value is not allowed in this context
  model: gpt-5.2

Fix: when the codemod removes tools.serena from engine:, it must retain any remaining engine: sub-fields at their correct indentation level. If engine: becomes empty after removing tools, it should be collapsed to engine: copilot (or removed if default).


Edge Case 2 — source:-pinned workflow with old tools.serena + new required languages schema

Affected repo: storybookjs/storybook (~84k stars)
File: .github/workflows/duplicate-code-detector.md

This workflow uses source: to track an upstream gh-aw workflow at a specific commit:

source: github/gh-aw/.github/workflows/duplicate-code-detector.md@852cb06ad52958b402ed982b69957ffc57ca0619

The codemod successfully transforms the local tools.serena: ['typescript'] into:

imports:
  - uses: shared/mcp/serena.md
    with:
      languages: ["typescript"]

However, compile still fails:

error: import 'github/gh-aw/.github/workflows/shared/mcp/serena.md@main':
  required 'with' input "languages" is missing (declared in import-schema)

The compiler resolves the source: pin and validates the upstream workflow at commit 852cb06. That commit predates the languages required-field addition to shared/mcp/serena.md. As a result, the compiled import chain includes a serena reference without languages.

Fix options:

  1. The codemod could also rewrite the source: pin to a newer commit where the upstream workflow already uses the correct imports syntax.
  2. Alternatively, the schema validation for source:-pinned workflows could be lenient about required fields in the pinned commit's import chain (treating missing inputs as warnings rather than errors for old pins).

Reproduction

# Clone either affected repo
git clone --depth 1 https://github.com/microsoft/FluidFramework
cd FluidFramework
gh aw fix --write
gh aw compile  # Still fails

Impact

Both repos have high visibility: storybookjs/storybook (~84k stars) and microsoft/FluidFramework (~4.5k stars). Users who run gh aw fix --write will see the codemod claim success but then get compile failures — a confusing experience.

References:

Generated by Daily AW Cross-Repo Compile Check · ● 661.1K ·

  • expires on Apr 30, 2026, 11:12 AM UTC

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions