Skip to content

Guard against shipping a platform-incomplete CLI, and fix the channel credential README - #15

Merged
duharry0915 merged 2 commits into
mainfrom
support/release-cli-guard
Sep 30, 2026
Merged

duharry0915 merged 2 commits into
mainfrom
support/release-cli-guard

Conversation

@josephfeleke

@josephfeleke josephfeleke commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

What was broken

Plugin 0.2.1 shipped on ClawHub with only the macOS arm64 CLI binary (vendor/agentmail/darwin-arm64/agentmail). On Linux and Windows the bundled CLI failed with "Exec format error", so the CLI-backed skill could not run (support tickets T-1919, T-1777).

The vendor tree is only complete when prepack runs cli:prepare -- --all during npm pack / npm publish. If a publish skips lifecycle scripts (--ignore-scripts) or packs a host-only build, npm pack still succeeds and silently ships one platform. Nothing failed a platform-incomplete pack.

The channel README also documented a SecretRef apiKey that only resolves on 0.2.2+. On 0.2.1 the channel fails to start with unresolved SecretRef "env:default:AGENTMAIL_API_KEY".

What changed

  • scripts/assert-cli-targets-packed.mjs (npm run pack:verify): runs npm pack --dry-run --json --ignore-scripts and fails if any of the 8 CLI targets in src/cli/agentmail-cli-release.json is missing from the tarball that would publish. Added as a CI step after plugin:validate. --ignore-scripts is deliberate so the guard inspects the on-disk tree that will ship, instead of re-running prepack and masking the gap.
  • src/cli/pack-targets.ts + src/cli/pack-targets.test.ts: small pure helpers (findMissingCliTargets, expectedCliVendorPaths, normalizePackPath) with unit tests.
  • README: notes that AGENTMAIL_API_KEY in the Gateway environment works on every version and is the simplest channel credential, and that the SecretRef apiKey form needs 0.2.2+.

Not in this PR

  • The provenance-invalid / "trusted-official" blocker in the same tickets is an OpenClaw-side change: the package must be in OpenClaw's official plugin catalog (openclaw/openclaw). No change in this repo fixes it, so this PR does not by itself restore the crash-looping inbound channel.
  • A tagged release / publish workflow is intentionally left out. The package is not on public npm today (npm view returns E404) and is distributed as a ClawHub artifact, so how a provenance-signed release should publish (npm vs ClawHub, token vs OIDC) is an ops decision rather than something to guess in CI. Whatever workflow is added should gate on npm run plugin:validate then npm run pack:verify before publishing. See follow-ups.
  • The SecretRef channel bug itself is already fixed on main (0.2.2, commit d85426f) and just needs to ship.

How it was tested

  • tsc -p tsconfig.json --noEmit: clean.
  • vitest run src/cli/pack-targets.test.ts: 5/5 pass; removing the helper makes the test fail to collect, confirming it exercises the new code.
  • Guard demonstrated end to end: fails on a darwin-arm64-only tree (1/8, the exact 0.2.1 state) and an empty tree (0/8), passes on a complete 8-target tree, exits non-zero on failure.
  • The full vitest suite could not run in the dev environment because its Node (23.11.0) fails OpenClaw's runtime SQLite gate; the added test and guard do not depend on the Node version, and CI runs on Node 24.15.0.

Support tickets: T-1919, T-1777

Update after review: plugin:validate (run by prepack and CI) already fails when a CLI target is missing on disk, so the CI step alone cannot catch a release that skipped prepack, which is what happened with 0.2.1. pack:verify now also takes a tarball path (npm run pack:verify -- <package>.tgz), and the README tells release owners to run it on the exact file they upload. A CI release workflow that always does this is still the proper long-term fix.

🤖 Generated with Claude Code

josephfeleke and others added 2 commits September 23, 2026 22:23
… credential README

0.2.1 shipped only the darwin-arm64 CLI because the pack skipped the all-platform prepare step. CI now fails a pack that is missing any CLI target, and the README says which channel credential setup works on which version.

Support ticket: T-1919, T-1777

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
plugin:validate already fails on a missing CLI target on disk, so the CI step alone could not
catch a release that skipped prepack (the 0.2.1 cause). pack:verify now also accepts a .tgz
path, so the exact artifact about to be uploaded can be checked, and the README release
notes say to do that. npm output parsing moved into a tested helper, npm launches through a
shell on Windows, and the README no longer claims the env var works on every version.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@duharry0915
duharry0915 merged commit d468aa7 into main Sep 30, 2026
1 check passed
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.

2 participants