Skip to content

ci(publish): publish @agent-relay/harnesses on release#1049

Merged
willwashburn merged 2 commits into
mainfrom
ci/publish-harnesses
Jun 4, 2026
Merged

ci(publish): publish @agent-relay/harnesses on release#1049
willwashburn merged 2 commits into
mainfrom
ci/publish-harnesses

Conversation

@willwashburn

@willwashburn willwashburn commented Jun 4, 2026

Copy link
Copy Markdown
Member

User description

What

Wires @agent-relay/harnesses into the release pipeline so it actually gets published to npm.

Why

@agent-relay/harnesses is set up as a public package (no private flag, publishConfig.access: public, versioned in lockstep at the release version) but appeared nowhere in publish.yml — not in the package dropdown, the SDK-internal-deps matrix, or any pack step. As a result it was never published (npm view @agent-relay/harnesses → 404), even though:

  • It's the public author surface: prebuilt PTY harnesses (claude, codex, gemini, cursor, droid, opencode, aider, goose) plus definePtyHarness / defineHarness / createHuman.
  • It's documented on the public docs site (web/content/docs/harnesses.mdx, plus quickstart / typescript-sdk / migration / actions).
  • relayflows lists "@agent-relay/harnesses is NOT published to npm" as the fix(truncation): improvements #1 blocker in its v8 SDK migration plan, with "publish from the relay repo first" as the preferred resolution.

How

Adds a publish-harnesses job to the package=all path. It runs after publish-packages — the matrix where its exact-version workspace deps (@agent-relay/sdk, @agent-relay/harness-driver) land on the registry — so an external npm install @agent-relay/harnesses@<v> can always resolve its dependencies. This respects the same install-ordering discipline the broker/SDK jobs already use.

The job mirrors the existing publish pattern: --provenance (OIDC), --ignore-scripts, and the skip-if-already-exists guard for safe re-runs.

Notes

  • First publish must be done manually (with a token) to create the package on npm, after which the npm trusted publisher (OIDC) can be configured to point at this repo + publish.yml. Subsequent releases then publish via provenance with no token.
  • No change needed to the post-publish verification workflow — it's CLI-install-focused and doesn't enumerate harnesses (which isn't a dep of the agent-relay CLI).

🤖 Generated with Claude Code


CodeAnt-AI Description

Publish @agent-relay/harnesses to npm during releases

What Changed

  • Release runs now publish @agent-relay/harnesses alongside the other packages
  • The package is published only after its runtime dependencies are already on npm, so installs like npm install @agent-relay/harnesses@<version> can resolve cleanly
  • Repeated release runs still skip publishing if that exact version is already on npm

Impact

✅ External SDK users can install harnesses
✅ Fewer broken installs for released versions
✅ Safer repeat release runs

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

@agent-relay/harnesses was set up as a public package (no private flag,
publishConfig.access public, versioned in lockstep) but was never wired
into the publish workflow, so it never reached npm. External SDK
consumers (e.g. relayflows) need it for the prebuilt PTY harnesses and
the definePtyHarness/createHuman author helpers.

Add a publish-harnesses job to the package=all path. It runs after
publish-packages — where its exact-version workspace deps
(@agent-relay/sdk, @agent-relay/harness-driver) land on the registry —
so an external `npm install @agent-relay/harnesses@<v>` can always
resolve its dependencies. Mirrors the existing provenance +
skip-if-exists publish pattern.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@willwashburn willwashburn requested a review from khaliqgant as a code owner June 4, 2026 13:19
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@codeant-ai

codeant-ai Bot commented Jun 4, 2026

Copy link
Copy Markdown

CodeAnt AI is reviewing your PR.

@coderabbitai

coderabbitai Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: bee35067-75b8-4461-be2d-52bc061642da

📥 Commits

Reviewing files that changed from the base of the PR and between 4e78e52 and 4da8efc.

📒 Files selected for processing (2)
  • .github/workflows/publish.yml
  • CHANGELOG.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • CHANGELOG.md

📝 Walkthrough

Walkthrough

This PR adds automated NPM publishing for the @agent-relay/harnesses package. A new GitHub Actions job downloads build artifacts, provisions npm with updated security features, performs a version existence check to avoid duplicates, and publishes with provenance support when triggered. The changelog announces the new npm availability of prebuilt PTY harnesses for external SDK consumers.

Changes

Publish harnesses to NPM

Layer / File(s) Summary
publish-harnesses workflow job and changelog
.github/workflows/publish.yml, CHANGELOG.md
Adds a publish-harnesses GitHub Actions job to publish packages/harnesses to NPM (artifact download, npm update for OIDC/provenance, dry-run support, version-existence check, provenance/tagged publish). Adds changelog entry announcing the published @agent-relay/harnesses package.
create-release gating and summary updates
.github/workflows/publish.yml
Makes create-release depend on publish-harnesses (allowing success or skipped) and updates the summary job to include publish-harnesses in its needs and results table.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested labels

size:M

Suggested reviewers

  • khaliqgant

Poem

🐇 I packed the harness, snug and bright,
Bounced through CI in the quiet night,
Tagged with provenance, version in hand,
Off to npm, across the land—
Hops of joy for a publish done right.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The PR title clearly and specifically describes the main change: publishing the @agent-relay/harnesses package during the release process.
Description check ✅ Passed The PR description is comprehensive, covering what changed, why it matters, and how it works. However, it does not follow the provided template structure which requires Summary, Test Plan, and Screenshots sections.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/publish-harnesses

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codeant-ai codeant-ai Bot added the size:M This PR changes 30-99 lines, ignoring generated files label Jun 4, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4e78e52144

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

# the same install race the broker/sdk ordering above is built to avoid.
publish-harnesses:
name: Publish @agent-relay/harnesses
needs: [build, publish-packages]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Gate the release on harness publication

For package=all, this new job starts after publish-packages, but nothing downstream waits for it: publish-main only waits on publish-packages and create-release only waits on publish-main. That means if @agent-relay/harnesses publishing fails or is delayed during the first trusted-publisher setup, the workflow can still publish agent-relay and create the GitHub tag/release for that version, leaving the official release without the package this change is meant to ship. Please include this job in the release gating path (or otherwise make create-release wait for it) so a partial release cannot be finalized.

Useful? React with 👍 / 👎.

@codeant-ai

codeant-ai Bot commented Jun 4, 2026

Copy link
Copy Markdown

CodeAnt AI finished reviewing your PR.

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/publish.yml:
- Around line 981-990: Replace the floating action tags used in the job
(actions/checkout@v4, actions/setup-node@v4, actions/download-artifact@v4) with
immutable commit SHAs: locate the official GitHub repos for each action
(actions/checkout, actions/setup-node, actions/download-artifact), find the
commit SHA that corresponds to the v4 release you intend to use, and update the
workflow to reference the full SHA (e.g., actions/checkout@<SHA>) instead of
`@v4`; keep the existing inputs (node-version, registry-url, etc.) unchanged and
ensure each action ref is pinned consistently across the new job.
- Around line 973-976: The create-release and summary jobs should be gated on
the new publish-harnesses job so a release/tag isn't created if harness
publication fails; update the workflow so the create-release job's needs array
(and the summary job's needs array) include "publish-harnesses" (or add
publish-harnesses to any higher-level job group they depend on) ensuring that
create-release and summary will only run after publish-harnesses succeeds.

In `@CHANGELOG.md`:
- Line 12: Shorten the changelog bullet to an impact-first single sentence:
replace the detailed implementation list with a concise user-facing statement
mentioning that the `@agent-relay/harnesses` package is now published to npm and
available for SDK consumers, omitting specific harness names and helper
identifiers (e.g., definePtyHarness, defineHarness, createHuman, claude, codex,
gemini). Make the entry one short bullet that emphasizes availability and user
impact only.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 9efc92b2-13fb-4a61-b726-8dd06f150eb6

📥 Commits

Reviewing files that changed from the base of the PR and between d8d00e2 and 4e78e52.

📒 Files selected for processing (2)
  • .github/workflows/publish.yml
  • CHANGELOG.md

Comment thread .github/workflows/publish.yml
Comment on lines +981 to +990
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22.14.0'
registry-url: 'https://registry.npmjs.org'

- name: Download build artifacts
uses: actions/download-artifact@v4

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.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Pin action references to commit SHAs in this new job.

The new steps use tag refs (@v4) for third-party actions. Static policy flags this as required-to-fix; pinning to immutable SHAs avoids supply-chain drift.

Example pattern
-      - name: Checkout code
-        uses: actions/checkout@v4
+      - name: Checkout code
+        uses: actions/checkout@<full_commit_sha>

-      - name: Setup Node.js
-        uses: actions/setup-node@v4
+      - name: Setup Node.js
+        uses: actions/setup-node@<full_commit_sha>

-      - name: Download build artifacts
-        uses: actions/download-artifact@v4
+      - name: Download build artifacts
+        uses: actions/download-artifact@<full_commit_sha>
🧰 Tools
🪛 zizmor (1.25.2)

[error] 981-981: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)

(unpinned-uses)


[error] 984-984: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)

(unpinned-uses)


[error] 990-990: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)

(unpinned-uses)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/publish.yml around lines 981 - 990, Replace the floating
action tags used in the job (actions/checkout@v4, actions/setup-node@v4,
actions/download-artifact@v4) with immutable commit SHAs: locate the official
GitHub repos for each action (actions/checkout, actions/setup-node,
actions/download-artifact), find the commit SHA that corresponds to the v4
release you intend to use, and update the workflow to reference the full SHA
(e.g., actions/checkout@<SHA>) instead of `@v4`; keep the existing inputs
(node-version, registry-url, etc.) unchanged and ensure each action ref is
pinned consistently across the new job.

Comment thread CHANGELOG.md Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

1 issue found across 2 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread .github/workflows/publish.yml
Address PR review: publish-harnesses ran outside the release gate, so a
tag/release could be cut even if harness publishing failed.

- create-release now needs publish-harnesses and its `if` requires the
  job to not have failed. It tolerates `skipped` so package=main
  releases (where publish-harnesses does not run) are not blocked.
- summary job lists the harness publish result.
- Trim the changelog bullet to impact-first per the repo changelog rule.

Leaving the new job's actions on @v4 tags to match the rest of the
workflow (the repo uses tag refs throughout; SHA-pinning would be
inconsistent and is not the enforced policy here).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@willwashburn

Copy link
Copy Markdown
Member Author

Thanks for the reviews. Addressed in 4da8efc:

✅ P1 — gate the release on harness publication (flagged by Codex, CodeRabbit, and cubic). Valid: create-release only reached publish-packages transitively via publish-main, and publish-harnesses ran parallel to publish-main, so a tag/release could be cut even if harness publishing failed.

  • create-release now needs: [..., publish-harnesses].
  • Its if requires publish-harnesses to not have failed, using (result == 'success' || result == 'skipped') rather than the suggested == 'success'. The skipped branch matters: publish-harnesses is package=all-only, so a package=main release skips it — gating on == 'success' would have wrongly blocked every main release. This now blocks on a real failure and tolerates the skip.
  • Added a "Publish Harnesses" row to the summary job (and its needs).

✅ Changelog brevity (CodeRabbit). Trimmed to an impact-first bullet, dropping the exhaustive helper/harness name list per the repo's changelog rule.

❌ Pin actions to commit SHAs (CodeRabbit/zizmor). Declining for consistency: this workflow — and the repo's workflows generally — use @vN tag refs (163 tag refs vs 1 SHA pin across .github/workflows/). The new job deliberately matches that convention. The zizmor finding is a blanket policy the repo doesn't currently enforce (it would already flag all 163 existing refs); pinning only this one job would be inconsistent without addressing it. Happy to do a repo-wide SHA-pinning pass as a separate change if that's a direction you want.

@willwashburn willwashburn merged commit a14f65f into main Jun 4, 2026
37 of 38 checks passed
@willwashburn willwashburn deleted the ci/publish-harnesses branch June 4, 2026 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M This PR changes 30-99 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant