[gh-aw] Pin the `gh-aw` engine import to a revision that includes #12818

Merged
DS
24d ago
+349-115

This pull request was posted by Claude Code using claude-opus-5-5 on behalf of David.

Why we make these changes

The workflows import the gh-aw engine definition in .github/workflows/shared/engine-zai.md at revision 764a75c329, from before #12818 changed how the engine's wrapper adds the checkout to sys.path (#12815, closed by #12818). The compiled locks still carry the old wrapper. This PR moves the import to c9c896e9f0, which includes #12818, recompiles the 12 locks with gh-aw v1.2.1, and adds an engine-sys-path-order policy guard check. It closes no issue.

Published pydantic-clai2 still appends the launch directory to sys.path, after installed packages, until a release includes #12818.

New public surface

None.

User-visible behavior

Each recompiled pydantic-ai-*.lock.yml wrapper resolves PAI_AGENT with #12818's sys.path handling:

-              sys.path.insert(0, os.getcwd())
+              _top_level = _module_name.partition('.')[0]
+              if _top_level not in sys.modules and find_spec(_top_level) is None:
+                  sys.path.append(os.getcwd())

Each lock otherwise changes only in the import pin, its frontmatter hash and comments; the compiler's cached import under .github/aw/imports/ moves with the pin. The new check_engine_sys_path_order in .github/scripts/agentic_workflow_guard.py fails a lock whose compiled engine wrapper (AGENT_MODULE, read from each step's run) contains a sys.path.insert(0, ...) statement, or that has no engine wrapper. .github/workflows/AGENTS.md lists it in the guard table.

Verification

  • test_engine_sys_path_order_*, including a double-quoted run. test_repository_agentic_workflows_satisfy_policy passes on the recompiled locks, and the new check flags all 12 locks on main.
  • Two compiles with gh aw compile --action-mode action --action-tag v1.2.1 are byte-identical, and agentics-maintenance.yml equals main's.
  • The wrapper, recorder and launcher extracted from the recompiled pydantic-ai-pr-review.lock.yml completed a run with the lock's python -P launch against a stub model server, with the checkout last on sys.path.

What changes for existing users

Nothing. Only this repository's agentic workflows change.

PR decisions

2026-11-09 · guard reads the compiled wrapper, not pin ancestry · iter 0

  • Decision: engine-sys-path-order scans each lock's AGENT_MODULE literal for sys.path.insert(0, ...) and fails closed when the literal is missing
  • Why: matches the guard's lock-reading checks; pin ancestry needs git history the shallow CI checkout lacks (manager dispatch: pick the narrower one)
  • Source: https://github.com/pydantic/pydantic-ai/pull/12818
  • Session: d1feee4b-f862-4f0b-b1f8-989910ff70c8

2026-11-09 · old cached engine import removed · iter 0

2026-11-09 · clai2 runtime half of #12818 left out · iter 0

  • Decision: runtime pin stays 0.64.0; its import_agent still appends the checkout last, after installed packages
  • Why: no published pydantic-clai2 contains #12818's agent_import.py change (latest 0.66.0, 2026-11-04); reported to the manager
  • Source: https://pypi.org/project/pydantic-clai2/#history
  • Session: d1feee4b-f862-4f0b-b1f8-989910ff70c8

2026-11-09 · validator: rebased onto main after #12930, 13 locks · iter 1

  • Decision: Validator NOT CLEARED 55723c53e4 only on a conflict with #12930; rebased the unpushed commit onto upstream/main 58d5894b2c, git rm'd pydantic-ai-attention-triage.lock.yml, recompiled 13 locks (two compiles byte-identical, agentics-maintenance.yml equal to main's)
  • Why: #12930 deleted the attention-triage workflow; content otherwise passed pin, compile parity, guard, runtime, CI's .github/scripts list on 3.13, public text
  • Source: https://github.com/pydantic/pydantic-ai/pull/12930
  • Session: d1feee4b-f862-4f0b-b1f8-989910ff70c8

2026-11-09 · engine-sys-path-order parses each step's run · iter 1

  • Decision: check reads each step's run through yaml.safe_load, as check_awf_binary_version does; violation message and constant comment state the rule: no sys.path.insert(0, ...) in the AGENT_MODULE wrapper (matches the AGENTS.md row); test for a double-quoted run added
  • Why: validator C/D: a raw-text regex misses a double-quoted YAML scalar holding the pre-#12818 wrapper
  • Source: https://github.com/pydantic/pydantic-ai/pull/12818
  • Session: d1feee4b-f862-4f0b-b1f8-989910ff70c8

2026-11-09 · regex spelling variants skipped · iter 1

  • Decision: SYS_PATH_PREPEND stays narrow; other spellings of a prepend are not matched (deliberate skip, validator B)
  • Why: validator: "The guard checks generated engine output, not adversarial text."
  • Source: https://github.com/pydantic/pydantic-ai/pull/12818
  • Session: d1feee4b-f862-4f0b-b1f8-989910ff70c8

2026-11-09 · validator cleared 05b75dc27e · iter 1

  • Decision: Manager's Claude validator CLEARED 05b75dc27e: merge clean on upstream/main 58d5894b2c, byte-identical v1.2.1 compile, guard (13/13 main locks flagged, 0 on branch, double-quoted case caught, mutants killed), runtime (no workspace markers), CI's 30-file list on 3.13, public text
  • Why: pre-push validation gate set by the manager's dispatch
  • Source: https://github.com/pydantic/pydantic-ai/pull/12818
  • Session: d1feee4b-f862-4f0b-b1f8-989910ff70c8

2026-11-09 · pre-push review 2 of 3 at 05b75dc27e6cca3500ab73d872aed9b81373b3b8 · iter 1

2026-11-09 · final metadata check at 05b75dc27e · iter 1

  • Decision: kept: link test_engine_sys_path_order_* from Files changed; replace Changes with the template's User-visible behavior section (wrapper diff corrected to #12818's conditional append). rejected: add gh-aw label; reword cubic summary sentence
  • Why: gh-aw: no engine code changes; #12893/#12930 (own-workflow changes) carry chore, github-actions, agentic-workflows, pkg:core only. cubic: bot-owned block restating #12815's public title, names nothing a checkout file replaces
  • Source: https://github.com/pydantic/pydantic-ai/pull/12960
  • Session: d1feee4b-f862-4f0b-b1f8-989910ff70c8

2026-11-10 · merged main cc37d25c2b after #12859, 12 locks · iter 2

  • Decision: Merged upstream/main cc37d25c2b into the reviewed head 05b75dc27e as d077f13bd7; only locks conflicted: took main's for 12, git rm'd pydantic-ai-ui-security-review.lock.yml (main deleted that workflow), recompiled 12 locks with gh-aw v1.2.1 (two compiles byte-identical, agentics-maintenance.yml equal to main's); pushed without another pre-push review
  • Why: manager authorized the push as a lock-only merge plus recompile. Rubric rung the delta could touch: workflow runtime behavior; it cannot, since each lock's diff vs main is identical to the reviewed head's (one shared hunk set) and the non-lock diff vs main matches 05b75dc27e's apart from hunk offsets. Exemption chains from reviewed 05b75dc27e
  • Source: https://github.com/pydantic/pydantic-ai/pull/12859
  • Session: d1feee4b-f862-4f0b-b1f8-989910ff70c8

2026-11-10 · manager applied douwebot label for d077f13bd7 · iter 2

  • Decision: Manager added the douwebot label to #12960 at 11:28:45Z, with David's approval, after the auto-mode classifier denied my gh pr edit --add-label douwebot as an external write
  • Why: the re-trigger on the merged head needed the label; I stopped and reported the denial instead of working around it
  • Source: https://github.com/pydantic/pydantic-ai/pull/12960
  • Session: d1feee4b-f862-4f0b-b1f8-989910ff70c8

Checklist

  • No breaking changes in accordance with the version policy.
  • Any permitted compatibility impact has a label, warning, migration and release note, and an exact API-check waiver if the gate reports it.
  • PR title is fit for the release changelog.

Summary by cubic

Pins the gh-aw engine import to c9c896e9f0, which includes #12818's fix to the engine wrapper's sys.path handling, and recompiles the 13 workflow locks. The old pin predated #12818, so every lock's wrapper prepended the checkout ahead of installed packages (#12815); the new wrapper appends the checkout to sys.path after installed packages only when nothing installed already has the target's top-level module name.

Adds an engine-sys-path-order guard check that fails a lock whose compiled engine wrapper (AGENT_MODULE) contains a sys.path.insert(0, ...) statement or has no wrapper. Only this repository's agentic workflows change; there is no behavior change for existing users.