Repository navigation
chore: consume AgentWorkforce 4.1.16 - #397
Conversation
|
Warning Review limit reached
Next review available in: 53 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughWorkforce 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. ChangesWorkforce runtime upgrade
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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.
| cli: packageCommand, | ||
| args: ['agent', 'persona-maker'] | ||
| })) | ||
| expect(execFileSync(packageCommand!, ['--version'], { encoding: 'utf8' }).trim()).toBe('4.1.16') |
There was a problem hiding this comment.
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.
| 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') |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (3)
package.jsonsrc/main/broker.test.tssrc/main/broker.ts
There was a problem hiding this comment.
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
| await manager.shutdown() | ||
| }) | ||
|
|
||
| it('uses Pear pinned Workforce 4.1.16 when the project has no local CLI', async () => { |
There was a problem hiding this comment.
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>
| 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 |
|
@cubic-dev-ai This finding is already addressed in the reviewed head |
@khaliqgant You're right, I missed that. Both new tests in the diff start with: if (process.platform === 'win32') return...before any Tip: get faster answers by chatting with cubic’s review copilot in the review UI |
Summary
npxfallback to the same exact versionBROKER_BINARY_PATHwins overAGENT_RELAY_BINRed-first evidence
Against the previous 4.1.14 lock, the two new checks failed as intended:
harness.relay_mcp.broker_args_invalid_jsonfrom/usr/bin/true, receivedharness.relay_mcp.broker_args_failedfrom the old/usr/bin/falseprecedenceThe existing project-local fixture check remains green and now explicitly asserts its local
.bin/agentworkforcewins.Published release evidence
Validation
npm ci(real install, no symlink)npm run verify:mcp-resources-driftnpm run lintnpm run typechecknpm test: 128 passedenv -u AGENT_RELAY_BIN npx vitest run: 35 files, 525 passednpm run buildgit diff --checknpm ls agentworkforce @agentworkforce/cli @agentworkforce/runtime @agentworkforce/deploy @agentworkforce/persona-kit @agentworkforce/workload-router --depth=2: all 4.1.16The 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.23requirement (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.