Skip to content

Fix packaged Codex and OpenCode spawns with Relay v11#427

Merged
khaliqgant merged 2 commits into
mainfrom
fix/packaged-cli-shim-spawns
Jul 23, 2026
Merged

Fix packaged Codex and OpenCode spawns with Relay v11#427
khaliqgant merged 2 commits into
mainfrom
fix/packaged-cli-shim-spawns

Conversation

@khaliqgant

@khaliqgant khaliqgant commented Jul 23, 2026

Copy link
Copy Markdown
Member

Summary

  • upgrade Pear's directly imported Agent Relay runtime packages to v11.1.0 and the latest published agent-relay CLI to v11.0.2
  • preserve version-manager CLI shims through the packaged broker, fixing Codex installed through mise/asdf/rtx-style shims
  • search ~/.opencode/bin before Homebrew fallbacks so Finder-launched Pear selects the working official OpenCode install
  • keep Pear fleet spawns explicitly on PTY runtime across Relay v11's managed-harness type change
  • guard the release lock so the harness driver and every platform broker remain on aligned Relay v11 versions

Root cause

The released app was shipping an older broker that canonicalized ~/.local/share/mise/shims/codex to the mise executable. mise then received Codex-only permission arguments and exited before Codex started.

OpenCode had a separate path-resolution failure. Finder-launched Pear did not search ~/.opencode/bin, so it selected /opt/homebrew/bin/opencode instead. On the affected machine that npm-installed fallback is broken because its postinstall script was not run, while ~/.opencode/bin/opencode is healthy.

Verification

  • npm test: 130 passed
  • npx vitest run: 612 passed
  • npm run typecheck
  • ESLint on all touched TypeScript files
  • npm run verify:mcp-resources-drift
  • npm run build
  • live Relay 11.1.0 broker smoke: mise-backed Codex spawned and emitted codex-cli 0.144.0
  • live Relay 11.1.0 broker smoke: ~/.opencode/bin/opencode registered, emitted worker_ready, and stayed alive

package.json changes are limited to eight Agent Relay version entries. The dev script remains electron-vite dev, so npm run dev is unchanged.

@cursor

cursor Bot commented Jul 23, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Updates Relay dependencies to v11, expands packaged MCP runtime resources, aligns harness typing, adds lock consistency validation, and prioritizes the user-local OpenCode binary directory.

Changes

Relay v11 alignment

Layer / File(s) Summary
Runtime dependencies and packaging
package.json, electron-builder.mcp-resources.yml, src/main/__tests__/agent-relay-runtime-lock.test.ts, src/main/ipc-handlers.test.ts
Relay packages move to v11, MCP runtime globs are expanded, and tests validate broker lock alignment and the updated Relay version.
Harness type wiring
src/main/pear-fleet-node.ts
Static harness configuration and PEAR_LOCAL_SPAWN_HARNESSES use StaticPtyHarnessDefinition from the harness driver.
OpenCode binary discovery
src/main/broker.ts, src/main/broker.test.ts
commonUserBinDirs is exported, accepts a home directory, includes ~/.opencode/bin, and tests its precedence.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

Suggested reviewers: willwashburn, kjgbot, miyaontherelay

Poem

I’m a rabbit with Relay v11 in my pack,
Shipping fresh MCP paths along the track.
Harness types hop neatly in line,
OpenCode bins now resolve just fine.
Lockfiles thump: all versions agree—
Carrots and runtimes bundled with glee!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title clearly matches the main change: fixing packaged Codex and OpenCode spawns with Relay v11.
Description check ✅ Passed The description is directly related to the changeset and accurately summarizes the dependency, broker, and runtime fixes.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/packaged-cli-shim-spawns

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.

@khaliqgant khaliqgant changed the title Fix Codex spawns through version-manager shims Fix packaged Codex and OpenCode spawns with Relay v11 Jul 23, 2026
@khaliqgant
khaliqgant merged commit 504134e into main Jul 23, 2026
5 checks passed
@khaliqgant
khaliqgant deleted the fix/packaged-cli-shim-spawns branch July 23, 2026 06:43
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