Skip to content

Remove stale root bin fallback#905

Merged
willwashburn merged 3 commits into
mainfrom
codex/remove-legacy-bin-fallback
May 19, 2026
Merged

Remove stale root bin fallback#905
willwashburn merged 3 commits into
mainfrom
codex/remove-legacy-bin-fallback

Conversation

@willwashburn
Copy link
Copy Markdown
Member

Summary: Removes the empty repository-root bin placeholder and stale resolver probes for it; keeps active SDK bin, optional broker package, Cargo, installer, and system lookup paths. Updates build/release scripts and tests to stop assuming a root bin artifact. Tests: npx vitest run packages/sdk/src/tests/broker-path.test.ts packages/utils/src/relay-pty-path.test.ts; npx vitest run src/tests/broker-path.test.ts (from packages/sdk); npm run build:utils; npm run build:sdk; git diff --check.

@willwashburn willwashburn requested a review from khaliqgant as a code owner May 19, 2026 00:51
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 19, 2026

Review Change Stack

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: d71b8f73-11f2-4d37-bb89-bc6806181f2f

📥 Commits

Reviewing files that changed from the base of the PR and between 16f7b05 and ae0c545.

📒 Files selected for processing (1)
  • .trajectories/index.json
✅ Files skipped from review due to trivial changes (1)
  • .trajectories/index.json

📝 Walkthrough

Walkthrough

Removes ancestor/repository-root bin/ fallbacks from broker and relay-pty binary discovery, updates tests and build/release packaging accordingly, and adds trajectory records documenting the change.

Changes

Legacy bin fallback removal from binary resolution

Layer / File(s) Summary
Broker binary path resolution cleanup
packages/sdk/src/broker-path.ts, packages/sdk/src/__tests__/broker-path.test.ts
Removes getAncestorBinDirs() and the ancestor-directory bin/ search from getBrokerBinaryPath, renumbers/documentation of search order, and updates a test comment about optional-dep precedence.
Relay-pty binary path resolution cleanup
packages/utils/src/relay-pty-path.ts, packages/utils/src/relay-pty-path.test.ts
Removes derived project-root packageRoots fallback, refactors global install path expressions, expands file-descriptor close handling, updates header comments, and changes tests to assert repository-root bin/ is not included.
Build and release script updates
package.json, scripts/build-release.sh
build:rust fallback now skips local broker build when Rust is absent (relying on optional deps); release packaging copies dist/ into agent-relay/ instead of packaging bin/.
Trajectory completion records
.trajectories/completed/2026-05/traj_sqerp89tc436.json, .trajectories/completed/2026-05/traj_sqerp89tc436.md, .trajectories/index.json
Adds completed trajectory JSON/MD documenting the removal of the legacy repository-root bin/ fallback, records applied chapter/issue references and commit hash, and updates the trajectories index entry and timestamps.

Sequence Diagram(s)

sequenceDiagram
  participant Caller
  participant BrokerPath
  participant OptionalDepPackage
  participant DevTargets
  Caller->>BrokerPath: getBrokerBinaryPath()
  BrokerPath->>OptionalDepPackage: check optional-dep package path
  BrokerPath->>DevTargets: check development target paths (target/release, target/debug)
  BrokerPath->>Caller: PATH lookup / return resolved path
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • AgentWorkforce/relay#903: Overlaps in packages/sdk/src/broker-path.ts with prior broker-crate relocation and source-checkout root detection changes.

Suggested reviewers

  • khaliqgant

Poem

🐰 A fallback fond of roots now fades away,
No more bin/ wandering through the day,
Broker and relay-pty find clearer tracks,
Release bundles pack dist/ and skip old hacks,
The rabbit hops — the code now sleeps at bay.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive The description covers the main change and includes detailed test and build commands, but lacks proper template formatting with clear Summary and Test Plan sections. Restructure the description to follow the template format with a concise Summary section and a Test Plan section with checkbox completion status.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main objective of the PR: removing the repository-root bin fallback, which is the core change across all modified files.
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 codex/remove-legacy-bin-fallback

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.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/sdk/src/broker-path.ts (1)

270-277: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Fix stale PATH step numbering in resolver comments.

Line 277 still says // 7. PATH lookup, but the documented sequence now ends at step 6 after the fallback removal.

Suggested patch
-  // 7. PATH lookup
+  // 6. PATH lookup
🤖 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 `@packages/sdk/src/broker-path.ts` around lines 270 - 277, Update the stale
comment numbering in the resolver sequence: change the comment "// 7. PATH
lookup" to "// 6. PATH lookup" (or otherwise renumber to match the current
sequence) near the loop that iterates getDevelopmentBinaryPaths(ext, binDirs)
and the existsSync(developmentPath) check so the step numbers reflect the actual
order after the fallback removal; ensure any adjacent step comments are
consistent with this renumbering.
🤖 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.

Outside diff comments:
In `@packages/sdk/src/broker-path.ts`:
- Around line 270-277: Update the stale comment numbering in the resolver
sequence: change the comment "// 7. PATH lookup" to "// 6. PATH lookup" (or
otherwise renumber to match the current sequence) near the loop that iterates
getDevelopmentBinaryPaths(ext, binDirs) and the existsSync(developmentPath)
check so the step numbers reflect the actual order after the fallback removal;
ensure any adjacent step comments are consistent with this renumbering.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: ae2ea59f-a9b6-4887-8e8f-9a9eefc23499

📥 Commits

Reviewing files that changed from the base of the PR and between 040e6d9 and 8a6b9b4.

📒 Files selected for processing (10)
  • .trajectories/completed/2026-05/traj_sqerp89tc436.json
  • .trajectories/completed/2026-05/traj_sqerp89tc436.md
  • .trajectories/index.json
  • bin/.gitkeep
  • package.json
  • packages/sdk/src/__tests__/broker-path.test.ts
  • packages/sdk/src/broker-path.ts
  • packages/utils/src/relay-pty-path.test.ts
  • packages/utils/src/relay-pty-path.ts
  • scripts/build-release.sh
💤 Files with no reviewable changes (1)
  • scripts/build-release.sh

@willwashburn
Copy link
Copy Markdown
Member Author

@copilot resolve the merge conflicts in this pull request

…in-fallback

# Conflicts:
#	.trajectories/index.json

Co-authored-by: willwashburn <957608+willwashburn@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI commented May 19, 2026

@copilot resolve the merge conflicts in this pull request

Resolved and merged the branch with origin/main, including the .trajectories/index.json conflict. Commit: ae0c545.

@willwashburn willwashburn merged commit 3ab491f into main May 19, 2026
2 checks passed
@willwashburn willwashburn deleted the codex/remove-legacy-bin-fallback branch May 19, 2026 04:28
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