Skip to content

fix(sdk): derive placement repoKeys from repo:<key> node tags - #1276

Merged
willwashburn merged 4 commits into
mainfrom
placement-repo-keys-from-tags
Jul 16, 2026
Merged

fix(sdk): derive placement repoKeys from repo:<key> node tags#1276
willwashburn merged 4 commits into
mainfrom
placement-repo-keys-from-tags

Conversation

@willwashburn

@willwashburnwillwashburn commented Jul 15, 2026

Copy link
Copy Markdown
Member

messaging.placement.spawn({ repo }) filters candidate nodes with node.repoKeys?.includes(repo), but nothing in the stack produces a repoKeys/repo_keys/repoPaths field on the engine's node roster row — the only repo advertisement that flows end-to-end (fleet definition → provider registration → engine node row → roster) is repo:<key> tags. A repo-filtered placement therefore matched no node, ever.

toRelayNode now derives repoKeys from repo:<key> tags when no dedicated field is present. Explicit repoKeys/repo_keys/repoPaths still take precedence, so a future engine-side field slots in without SDK changes.

This makes repo-aware placement work for node definitions that tag their serviceable repos — e.g. the factory node (@agent-relay/factory/node), which advertises repo:<label> tags from its clone map.

🤖 Generated with Claude Code

Review in cubic

Node registration carries repo advertisement only as repo:<key> tags —
the engine roster row has no dedicated repo field — so the placement
repo filter could never match a node. toRelayNode now falls back to
those tags for repoKeys; explicit repoKeys/repo_keys/repoPaths fields
still win when present.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitaiBot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@willwashburn, you've reached your PR review limit, so we couldn't start this review.

Next review available in:33 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 00a742cd-5830-49ae-a6b6-b6d8a8e0eced

📥 Commits

Reviewing files that changed from the base of the PR and between 825f595 and fc66847.

📒 Files selected for processing (1)
  • CHANGELOG.md
📝 Walkthrough

Walkthrough

Node translation derives repoKeys from repo: tags when explicit repository paths are unavailable. Tests cover tag-derived keys, explicit-field precedence, and missing repository metadata.

Changes

Repository key translation

Layer / File(s)Summary
Repository key fallback and validation
packages/sdk/src/messaging/relaycast-translate.ts, packages/sdk/src/__tests__/messaging.test.ts
readRepoKeys prioritizes explicit repository paths and otherwise extracts non-empty repo: tag values; tests verify fallback, precedence, and undefined results.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers:khaliqgant

Poem

I’m a bunny with keys in a tag,
repo: trails tucked in my bag.
Explicit paths lead the way,
Empty tags hop away.
Tests thump approval—yay!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check nameStatusExplanationResolution
Description check⚠️ WarningThe description covers the summary, but it omits the required template sections and has no test plan or screenshots.Add the template headings for Summary, Test Plan, and Screenshots, and fill in the test checklist items.
✅ Passed checks (4 passed)
Check nameStatusExplanation
Title check✅ PassedThe title accurately captures the main change: deriving placement repoKeys from repo-tagged nodes.
Docstring Coverage✅ PassedNo functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch placement-repo-keys-from-tags

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.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

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

@chatgpt-codex-connectorchatgpt-codex-connectorBot 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:f3b967a85b

ℹ️ 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".

Comment on lines +170 to +174
const tagged = readStringArray(node, 'tags')
?.filter((tag) => tag.startsWith('repo:'))
.map((tag) => tag.slice('repo:'.length))
.filter(Boolean);
return tagged && tagged.length > 0 ? tagged : undefined;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Add the SDK placement fix to the changelog

This change fixes @agent-relay/sdk repo-filtered placement behavior, so it is user-visible. The root AGENTS.md requires curating CHANGELOG.md under [Unreleased] as PRs land, but this commit leaves [Unreleased] empty; release notes for the next patch would omit this fix. Please add a concise Fixed entry under [Unreleased - Patch].

Useful? React with 👍 / 👎.

@willwashburn
willwashburn merged commit 58aea1d into mainJul 16, 2026
7 checks passed
@willwashburn
willwashburn deleted the placement-repo-keys-from-tags branch July 16, 2026 01:10
willwashburn pushed a commit that referenced this pull request Jul 16, 2026
The `@agent-relay/sdk` repo-filtered placement fix landed on main
(#1276) after the merge base this branch picked up, so it was absent
from the branch's Unreleased section. Add it back under
[Unreleased - Minor] › Fixed (matching main's wording and order) so the
pending changelog is an accurate superset and the eventual merge
resolves cleanly.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01H1M6ht3owm95x4YRTSffJi
Sign up for freeto 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

@willwashburn@claude