Skip to content

chore: consume AgentWorkforce 4.1.16 - #397

Merged
khaliqgant merged 3 commits into
mainfrom
chore/workforce-4.1.16-consumption
Jul 14, 2026
Merged

khaliqgant merged 3 commits into
mainfrom
chore/workforce-4.1.16-consumption

Conversation

@khaliqgant

@khaliqgant khaliqgant commented Jul 14, 2026 •

Copy link
Copy Markdown
Member

Summary

  • consume the published AgentWorkforce 4.1.16 lockstep release in Pear and pin the emergency npx fallback to the same exact version
  • preserve intentional project-local Workforce precedence, with Pear packaged 4.1.16 as the clean-project fallback
  • add artifact-level regression proof that Pear selects the published 4.1.16 CLI/runtime and that BROKER_BINARY_PATH wins over AGENT_RELAY_BIN

Red-first evidence

Against the previous 4.1.14 lock, the two new checks failed as intended:

  • clean project: expected CLI 4.1.16, received 4.1.14
  • published runtime: expected harness.relay_mcp.broker_args_invalid_json from /usr/bin/true, received harness.relay_mcp.broker_args_failed from the old /usr/bin/false precedence

The existing project-local fixture check remains green and now explicitly asserts its local .bin/agentworkforce wins.

Published release evidence

Validation

  • npm ci (real install, no symlink)
  • targeted red/green regression selection: 3 passed
  • npm run verify:mcp-resources-drift
  • npm run lint
  • npm run typecheck
  • npm test: 128 passed
  • env -u AGENT_RELAY_BIN npx vitest run: 35 files, 525 passed
  • npm run build
  • git diff --check
  • npm ls agentworkforce @agentworkforce/cli @agentworkforce/runtime @agentworkforce/deploy @agentworkforce/persona-kit @agentworkforce/workload-router --depth=2: all 4.1.16

The unqualified wide Vitest invocation inherited this workstation’s AGENT_RELAY_BIN, causing the existing packaged-broker fixture to select that valid override. The test passes in isolation once that host override is unset, and the complete clean-environment suite is green.

Lockfile note

The mechanical npm 11 lock refresh also follows the 4.1.16 packages’ newer @relayfile/local-mount ^0.10.23 requirement (resolved 0.10.24), including its OpenTelemetry transitive updates.

Composition

This is intentionally separate from held Pear PR #396. Merge this consumption PR first; revise/rebase #396 only after explicit composition authorization so package consumption and Pear transport changes remain independently provable.

Review in cubic

@coderabbitai

coderabbitai Bot commented Jul 14, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

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

Next review available in: 53 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: 98cd40cc-217c-4a58-86db-1d5a86838620

📥 Commits

Reviewing files that changed from the base of the PR and between 05b0b35 and 17a25c3.

📒 Files selected for processing (1)
  • src/main/broker.test.ts
📝 Walkthrough

Walkthrough

Workforce dependencies and the CLI fallback version are upgraded to 4.1.16. Broker tests now cover platform-specific executable resolution, packaged binary fallback, runtime version reporting, and broker-first MCP precedence.

Changes

Workforce runtime upgrade

Layer / File(s) Summary
Upgrade Workforce runtime and fallback version
package.json, src/main/broker.ts
Workforce packages and the npx fallback target version change from 4.0.2 to 4.1.16, with CLI resolution priority comments added.
Validate CLI resolution and MCP precedence
src/main/broker.test.ts
Tests cover platform-specific executable names, packaged binary resolution, version 4.1.16, and broker-first MCP precedence.

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

Possibly related PRs

Poem

A rabbit hops through versioned ground,
Four-one-six is what we found.
Local paths and packages align,
Broker-first logs now neatly shine.
\o/ squeaks, “The runtime’s fine!”

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: consuming AgentWorkforce 4.1.16.
Description check ✅ Passed The description matches the changeset and explains the version bump, fallback pinning, and regression coverage.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/workforce-4.1.16-consumption

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 gemini-code-assist 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.

Code Review

This pull request updates the @agentworkforce/deploy and agentworkforce dependencies to version 4.1.16 across the project. It also updates the BrokerManager tests to verify that the correct local or pinned CLI binary is resolved and executed, including a new test for broker-first MCP precedence. Feedback on the changes highlights a potential cross-platform test failure on Windows where execFileSync requires the shell option to successfully execute .cmd or .bat binaries.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/main/broker.test.ts
cli: packageCommand,
args: ['agent', 'persona-maker']
}))
expect(execFileSync(packageCommand!, ['--version'], { encoding: 'utf8' }).trim()).toBe('4.1.16')

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

On Windows, executing a .cmd or .bat file (which packageCommand will resolve to) using execFileSync without the shell option enabled will fail with an ENOENT error. To ensure cross-platform compatibility for this test, pass shell: process.platform === 'win32' in the options.

Suggested change
expect(execFileSync(packageCommand!, ['--version'], { encoding: 'utf8' }).trim()).toBe('4.1.16')
expect(execFileSync(packageCommand!, ['--version'], { encoding: 'utf8', shell: process.platform === 'win32' }).trim()).toBe('4.1.16')

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in cc9a878: the test now enables shell dispatch only on Windows for the trusted package .cmd shim. Targeted regression tests (3/3), the exact clean-env packaged-broker fixture (1/1), lint, typecheck, and diff check are green.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Follow-up: CodeRabbit correctly noted that the spawn assertion itself is also Unix-shaped. Commit 17a25c3 now guards the whole test on win32, matching the adjacent artifact test, so the temporary shell option is no longer needed.

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 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 `@src/main/broker.test.ts`:
- Around line 1389-1417: Guard the test “uses Pear pinned Workforce 4.1.16 when
the project has no local CLI” so it returns early on win32, before creating the
manager or invoking the platform-specific command assertions. Preserve the
existing behavior and assertions on non-Windows platforms, matching the sibling
test’s platform guard pattern.
🪄 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: 79fc51a9-d159-4a4c-90c6-4992dea4f377

📥 Commits

Reviewing files that changed from the base of the PR and between 8ee88d6 and 05b0b35.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (3)
  • package.json
  • src/main/broker.test.ts
  • src/main/broker.ts

Comment thread src/main/broker.test.ts

@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 and verified against the latest diff

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src/main/broker.test.ts">

<violation number="1" location="src/main/broker.test.ts:1389">
P2: This test will fail on Windows CI runners. `resolveAgentWorkforceCommand` wraps `.cmd` binaries through `node` on win32 (returning a different `cli`/`args` shape), and `execFileSync` cannot directly invoke `.cmd` files without `shell: true`. The sibling test right below guards with `if (process.platform === 'win32') return` — this test should do the same for consistency and correctness.</violation>
</file>

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

Re-trigger cubic

Comment thread src/main/broker.test.ts
await manager.shutdown()
})

it('uses Pear pinned Workforce 4.1.16 when the project has no local CLI', async () => {

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: This test will fail on Windows CI runners. resolveAgentWorkforceCommand wraps .cmd binaries through node on win32 (returning a different cli/args shape), and execFileSync cannot directly invoke .cmd files without shell: true. The sibling test right below guards with if (process.platform === 'win32') return — this test should do the same for consistency and correctness.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/main/broker.test.ts, line 1389:

<comment>This test will fail on Windows CI runners. `resolveAgentWorkforceCommand` wraps `.cmd` binaries through `node` on win32 (returning a different `cli`/`args` shape), and `execFileSync` cannot directly invoke `.cmd` files without `shell: true`. The sibling test right below guards with `if (process.platform === 'win32') return` — this test should do the same for consistency and correctness.</comment>

<file context>
@@ -1382,6 +1386,79 @@ describe('BrokerManager local + cloud coexistence', () => {
     await manager.shutdown()
   })
 
+  it('uses Pear pinned Workforce 4.1.16 when the project has no local CLI', async () => {
+    personaTempDir = await mkdtemp(join(tmpdir(), 'pear-clean-persona-spawn-'))
+    const packageCommand = resolvePackageBin('agentworkforce', 'agentworkforce')
</file context>
Suggested change
it('uses Pear pinned Workforce 4.1.16 when the project has no local CLI', async () => {
it('uses Pear pinned Workforce 4.1.16 when the project has no local CLI', async () => {
if (process.platform === 'win32') return

@khaliqgant

Copy link
Copy Markdown
Member Author

@cubic-dev-ai This finding is already addressed in the reviewed head 17a25c3: the test begins with if (process.platform === 'win32') return before creating the temp directory, manager, spawn assertion, or execFileSync call. CodeRabbit acknowledged the same fix, and targeted 3/3 plus the clean-env fixture, lint, typecheck, and diff check are green. No further code change is needed.

@cubic-dev-ai

cubic-dev-ai Bot commented Jul 14, 2026

Copy link
Copy Markdown

@cubic-dev-ai This finding is already addressed in the reviewed head 17a25c3: the test begins with if (process.platform === 'win32') return before creating the temp directory, manager, spawn assertion, or execFileSync call. CodeRabbit acknowledged the same fix, and targeted 3/3 plus the clean-env fixture, lint, typecheck, and diff check are green. No further code change is needed.

@khaliqgant You're right, I missed that. Both new tests in the diff start with:

if (process.platform === 'win32') return

...before any execFileSync, temp directory creation, or BrokerManager instantiation in the platform-sensitive test. The guard is correct and covers the concern. No change needed.

Tip: get faster answers by chatting with cubic’s review copilot in the review UI

@khaliqgant
khaliqgant merged commit 02c5cc2 into main Jul 14, 2026
5 checks passed
@khaliqgant
khaliqgant deleted the chore/workforce-4.1.16-consumption branch July 14, 2026 08:52
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