fix: SDK publish includes freshly built broker binary#461
Conversation
| publish-sdk-only: | ||
| name: Publish SDK to NPM | ||
| needs: build | ||
| needs: [build, build-broker] |
There was a problem hiding this comment.
🔴 publish-sdk-only job will always be skipped because build-broker is skipped when package == 'sdk'
The publish-sdk-only job now depends on build-broker (line 487: needs: [build, build-broker]), but build-broker only runs when package == 'all' || package == 'main' (line 76). Since publish-sdk-only only runs when package == 'sdk' (line 489), the build-broker job will always be skipped in that scenario.
Root Cause: GitHub Actions skips dependent jobs when required jobs are skipped
In GitHub Actions, when a job listed in needs is skipped (due to its if condition evaluating to false), the dependent job is also skipped by default — unless the dependent job has an explicit if condition that uses always() or checks needs.*.result.
Here, publish-sdk-only at .github/workflows/publish.yml:487 has:
needs: [build, build-broker]
if: github.event.inputs.package == 'sdk'But build-broker at .github/workflows/publish.yml:76 has:
if: github.event.inputs.package == 'all' || github.event.inputs.package == 'main'When package == 'sdk', build-broker is skipped → publish-sdk-only is also skipped. The SDK can never be published standalone. This completely defeats the purpose of this PR.
Impact: Selecting package: sdk in the workflow dispatch will silently skip the publish job — the exact class of bug this PR claims to fix.
Prompt for agents
In .github/workflows/publish.yml, the build-broker job (line 76) has an if condition that only allows it to run when package is 'all' or 'main'. But publish-sdk-only (line 487) depends on build-broker and only runs when package is 'sdk'. This means build-broker is always skipped when publish-sdk-only should run, causing publish-sdk-only to also be skipped.
Two possible fixes:
1. Update the build-broker job's if condition at line 76 to also include 'sdk':
if: github.event.inputs.package == 'all' || github.event.inputs.package == 'main' || github.event.inputs.package == 'sdk'
2. Alternatively, update the publish-sdk-only if condition at line 489 to handle the skipped dependency:
if: github.event.inputs.package == 'sdk' && !cancelled()
But this would mean broker binaries are not available, so option 1 is the correct fix.
Was this helpful? React with 👍 or 👎 to provide feedback.
- Add 'sdk' to build-broker if condition so it runs for standalone SDK publishes - Add broker binary download to publish-packages matrix job (for package == 'all') - publish-sdk-only already had the fix from #461 but was dead because build-broker was skipped Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
publish-sdk-onlyjob was shipping a stale broker binary — it only depended on the TSbuildjob and used--ignore-scripts(skippingprepack→bundle:binary), so it published whatever old binary was checked intopackages/sdk/bin/instead of the freshly compiled one frombuild-brokerbuild-brokertoneeds, download CI-built broker artifacts intopackages/sdk/bin/, and make them executable beforenpm publishtarget/release/viaresolveDefaultBinaryPath()inclient.ts.gitignore— updated frompackages/broker-sdk/bin/(old package name) topackages/sdk/bin/agent-relay-broker*, keptpackages/broker-sdk/for the leftover local directorygit adddoesn't fail when optional paths are missingTest plan
package: sdk,dry_run: true) and verify the tarball includes broker binaries inbin/target/release/after removing the checked-in binarygit statusno longer showspackages/sdk/bin/agent-relay-brokeras tracked🤖 Generated with Claude Code