[AAASM-2342] ♻️ (release): Replace tag-push trigger + silent download fallback with repository_dispatch listener#73
Conversation
agent-assembly's release workflow now emits a `repository_dispatch` event (event-type: `agent-assembly-release-published`) after the upstream GitHub Release is created and aasm-* binaries are uploaded. Listening for the dispatch guarantees the binaries exist when this workflow runs, eliminating the race that the previous tag-push trigger was vulnerable to. The publish job's guard is updated from `github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')` to `github.event_name == 'repository_dispatch'` to match the new model. Refs AAASM-2342, ai-agent-assembly/agent-assembly#842.
The dispatch payload from agent-assembly contains a `release_tag` field identifying the exact upstream release to pull binaries from. Pin each `gh release download` call to that tag via `--tag "$AASM_TAG"` so a release that happens to ship while this workflow is mid-flight cannot swap the binaries underneath us. For `workflow_dispatch` (dry-run) the env var is empty and the tag argument is omitted, preserving the existing "latest release" behavior for local validation runs. The `AASM_TAG` env var is set from `github.event.client_payload.release_tag` following the workflow-injection-safe env-then-shell pattern. Refs AAASM-2342.
Previously each platform's Stage step swallowed download failures via `2>/dev/null` and emitted an `::warning::` while the workflow continued and shipped a wheel without the bundled aasm binary. That was the race-mitigation tactic for the tag-push trigger model: aasm-* binaries might not have been uploaded yet when the python-sdk tag arrived. The new repository_dispatch trigger fires only after agent-assembly's release job has finished uploading every aasm-* binary, so failure to download an expected platform binary is now a genuine error and must abort the wheel build instead of producing a silently-degraded artifact. Each Stage step now: - runs under `set -euo pipefail` so non-zero exits abort the step - calls `gh release download` without the `2>/dev/null` swallow - drops the `if/else` warning fallback branch Refs AAASM-2342.
Claude Code review — AAASM-2342CI state — green for merge (7 SUCCESS + 6 SKIPPED, 0 failures)
Scope vs. acceptance criteria
Commit granularity3 commits, one logical concern each (matching the workspace's commit-style convention):
The publish-job guard flip ( Workflow-injection safetyThe dispatch payload's Coordination with the upstream dispatcherThis PR is the listener for the dispatcher introduced in agent-assembly PR #842 (AAASM-2336). The dispatcher fires The matching node-sdk listener is in node-sdk#66, which the user reports already merged. python-sdk has been on the silent- End-to-end verification (deferred to alpha-4 release)Live verification requires the next
If the dispatch ever fails to arrive (PAT scope issue, network), the wheels-build step now hard-errors instead of silently shipping binary-less wheels — that's the explicit AC3 win. VerdictReady for human approval and merge. All four ACs delivered or correctly waived (AC4 found nothing to fix). Commits are atomic and well-justified. Workflow-injection-safe consumption of the dispatch payload. CI clean. Recommend merging this PR alongside agent-assembly#844 in the same release cycle so the dispatch flow is verified live on alpha.4. — Claude Code (Opus 4.7, 1M context) |
Summary
Switches python-sdk's wheel-release pipeline (
release-python.yml) from apush: tagstrigger that races against upstream binary upload, to arepository_dispatch-driven listener that fires only after agent-assembly has finished publishing its release artifacts.Tracking ticket: AAASM-2342 — Subtask of AAASM-1202 (F112 Python SDK platform wheel distribution).
Upstream dispatcher: AI-agent-assembly/agent-assembly#842 — adds a
notify-downstreamjob to agent-assembly'srelease.ymlthat emitsevent-type: agent-assembly-release-publishedwithclient_payload.release_tagto both python-sdk and node-sdk after the upstream Release object exists.Changes (one commit each)
push: tagstorepository_dispatch— listens foragent-assembly-release-published; keepsworkflow_dispatchfor dry-runs. Publish-job guard updated fromgithub.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')togithub.event_name == 'repository_dispatch'.release_tag— addsAASM_TAG: ${{ github.event.client_payload.release_tag }}env to each Stage step and forwards it via--tag "$AASM_TAG"togh release download, so a release that ships mid-flight cannot swap binaries underneath us. Theworkflow_dispatch(dry-run) path passes no--tagand falls back to "latest" as before.2>/dev/nullswallow +::warning::fallback on all fourgh release downloadcalls (linux x86_64, linux aarch64, macos arm64, macos x86_64). Each Stage step now runs underset -euo pipefail; failure to download an expectedaasm-*binary becomes a hard error and aborts the wheel build. This is intentional — the dispatch trigger guarantees the binaries exist on the upstream release before this workflow runs, so a missing binary is a real problem, not transient noise.Why removing the tag-push trigger is safe
The dispatch path is now the authoritative source of truth for "a python wheel release should happen". Keeping
push: tagsin parallel would re-introduce the same race the dispatch model is designed to eliminate (tag arrives at python-sdk before binaries are uploaded).workflow_dispatchis retained for engineer-initiated dry-runs.release-staging.yml / release-validate.yml
Inspected both — neither contains the
gh release downloadswallow pattern. They delegate to centralized reusable workflows inChisanan232/GitHub-Action_Reusable_Workflows-Pythonand don't bundle the aasm sidecar binary. No changes required for AC4 in this PR.Verification
python3 -c "import yaml; yaml.safe_load(open('.github/workflows/release-python.yml'))"— passesnotify-downstreamjob fires for the first time. Until then,workflow_dispatchdry-runs against the latest existing release continue to work.Test plan
repository_dispatchand consumesrelease_tagcorrectly.aasm-<platform>from the specific tag (not "latest") by checking thegh release downloadlog line.agent_assembly/bin/aasm(e.g.unzip -lthe wheel).workflow_dispatchfrom the Actions tab — wheels should build against the latest existing aasm release; publish job should be skipped.