Skip to content

fix: SDK publish includes freshly built broker binary#461

Merged
khaliqgant merged 1 commit intomainfrom
fix/publish-version-commit
Feb 27, 2026
Merged

fix: SDK publish includes freshly built broker binary#461
khaliqgant merged 1 commit intomainfrom
fix/publish-version-commit

Conversation

@khaliqgant
Copy link
Copy Markdown
Member

@khaliqgant khaliqgant commented Feb 27, 2026

Summary

  • publish-sdk-only job was shipping a stale broker binary — it only depended on the TS build job and used --ignore-scripts (skipping prepackbundle:binary), so it published whatever old binary was checked into packages/sdk/bin/ instead of the freshly compiled one from build-broker
  • Fix: Added build-broker to needs, download CI-built broker artifacts into packages/sdk/bin/, and make them executable before npm publish
  • Removed 13MB broker binary from git tracking — CI builds it fresh every publish, and local dev resolves to target/release/ via resolveDefaultBinaryPath() in client.ts
  • Fixed stale .gitignore — updated from packages/broker-sdk/bin/ (old package name) to packages/sdk/bin/agent-relay-broker*, kept packages/broker-sdk/ for the leftover local directory
  • Fixed version commit staging — separated required paths from optional ones so git add doesn't fail when optional paths are missing

Test plan

  • Trigger a dry-run SDK publish (package: sdk, dry_run: true) and verify the tarball includes broker binaries in bin/
  • Verify local dev still resolves broker from target/release/ after removing the checked-in binary
  • Confirm git status no longer shows packages/sdk/bin/agent-relay-broker as tracked

🤖 Generated with Claude Code

@khaliqgant khaliqgant changed the title fix silent publishing errors fix: SDK publish includes freshly built broker binary Feb 27, 2026
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

View 5 additional findings in Devin Review.

Open in Devin Review

publish-sdk-only:
name: Publish SDK to NPM
needs: build
needs: [build, build-broker]
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.

🔴 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.
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@khaliqgant khaliqgant merged commit c7b4cad into main Feb 27, 2026
31 checks passed
@khaliqgant khaliqgant deleted the fix/publish-version-commit branch February 27, 2026 19:30
khaliqgant added a commit that referenced this pull request Feb 27, 2026
- 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>
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.

1 participant