Skip to content

fix(core): support Workforce persona packages 4.1.39 - #29

Merged
khaliqgant merged 1 commit into
mainfrom
codex/relayflows-workforce-4.1.39-release
Aug 11, 2026
Merged

fix(core): support Workforce persona packages 4.1.39#29
khaliqgant merged 1 commit into
mainfrom
codex/relayflows-workforce-4.1.39-release

Conversation

@barryollama

Copy link
Copy Markdown
Contributor

Summary

  • update Workforce persona dependencies and lockfile to the published 4.1.39 lockstep
  • make builder/runner narrowing compatible with persona-backed agent definitions
  • preserve raw-CLI-only repair behavior and remove an impossible persona CLI comparison
  • stabilize two timing/retry assertions exposed by the merged persona integration

Verification

  • npm ci --ignore-scripts --no-audit --no-fund
  • npm run build
  • npm run typecheck
  • env -u AGENT_RELAY_STATE_DIR npm test -- --reporter=dot (45 files, 820 tests)
  • GitHub primitive tests (3)
  • Slack primitive tests (34)
  • Slack example typecheck

The browser primitive has no test files; its required TypeScript build passes.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The PR updates persona dependencies, strengthens agent constraint typing, permits registered api CLI definitions, restricts model resolution to CLI agents, narrows repair-agent types, and stabilizes review-timeout and readiness-failure tests.

Changes

Persona agent handling

Layer / File(s) Summary
Agent contracts and persona validation
packages/core/src/builder.ts, packages/core/src/persona-runtime.ts, packages/core/package.json
Agent definitions now use the public AgentConstraints type. Persona validation accepts registered api CLI definitions. Persona package versions update to ^4.1.39.
Runner model and repair handling
packages/core/src/runner.ts, packages/core/src/__tests__/e2e-owner-review.test.ts, packages/core/src/__tests__/workflow-runner.test.ts
Model lookup now reads constraints only from CLI agents. Repair paths require CLI agents. Tests accept the timeout safety range and disable retries for the readiness-failure case.

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

Possibly related PRs

Suggested reviewers: khaliqgant, willwashburn

Poem

A rabbit checks the agent trail,
CLI bounds keep types on rail.
Models choose their proper place,
Tests wait within a safer space.
Hop, hop—persona flows prevail!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the core change: support for Workforce persona packages version 4.1.39.
Description check ✅ Passed The description directly summarizes the dependency, compatibility, behavior, and test changes in the pull request.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/relayflows-workforce-4.1.39-release

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

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 `@packages/core/src/builder.ts`:
- Around line 336-340: Update the AgentDefinition construction in the builder to
use separate CLI and persona branches instead of casting the combined object.
Validate and reject incompatible options before constructing the definition:
prevent both cli and persona from being emitted, allow constraints.model only
for CLI agents, and disallow role, preset, and interactive:false for persona
agents. Ensure the options.model handling around the existing model-copy logic
is gated by the CLI branch so toYaml() produces a valid union.
🪄 Autofix

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: 8147fed1-f017-4bd1-b760-a6d2e733d385

📥 Commits

Reviewing files that changed from the base of the PR and between 4ac88ce and 73980f2.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (6)
  • packages/core/package.json
  • packages/core/src/__tests__/e2e-owner-review.test.ts
  • packages/core/src/__tests__/workflow-runner.test.ts
  • packages/core/src/builder.ts
  • packages/core/src/persona-runtime.ts
  • packages/core/src/runner.ts

Comment on lines +336 to +340
const def = {
name,
...(options.cli ? { cli: options.cli } : {}),
...(options.persona ? { persona: options.persona } : {}),
};
} as AgentDefinition;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Build the correct AgentDefinition variant.

AgentDefinition permits constraints.model only for CLI agents. It also forbids role, preset, and interactive: false for persona agents. The cast at Line 340 bypasses this union, and Lines 366-373 copy options.model without checking options.persona. The builder can emit both cli and persona, or emit a persona with constraints.model. toYaml() can then return invalid configuration that WorkflowRunner.validateConfig rejects later.

Construct CLI and persona branches separately. Reject incompatible options before adding the definition.

Proposed guard
-    const def = {
-      name,
-      ...(options.cli ? { cli: options.cli } : {}),
-      ...(options.persona ? { persona: options.persona } : {}),
-    } as AgentDefinition;
+    const hasCli = options.cli !== undefined;
+    const hasPersona = options.persona !== undefined;
+    if (hasCli === hasPersona) {
+      throw new Error(`Agent "${name}" must define exactly one of "cli" or "persona"`);
+    }
+    if (
+      hasPersona &&
+      (options.model !== undefined ||
+        options.role !== undefined ||
+        options.preset !== undefined ||
+        options.interactive === false)
+    ) {
+      throw new Error(`Agent "${name}" has options that are not supported for persona agents`);
+    }
+    const def: AgentDefinition = hasCli
+      ? { name, cli: options.cli! }
+      : { name, persona: options.persona! };

-      if (options.model !== undefined) constraints.model = options.model;
+      if (hasCli && options.model !== undefined) constraints.model = options.model;

Also applies to: 366-373

🤖 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/core/src/builder.ts` around lines 336 - 340, Update the
AgentDefinition construction in the builder to use separate CLI and persona
branches instead of casting the combined object. Validate and reject
incompatible options before constructing the definition: prevent both cli and
persona from being emitted, allow constraints.model only for CLI agents, and
disallow role, preset, and interactive:false for persona agents. Ensure the
options.model handling around the existing model-copy logic is gated by the CLI
branch so toYaml() produces a valid union.

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

No issues found across 7 files

Re-trigger cubic

@khaliqgant
khaliqgant merged commit 6c487b2 into main Aug 11, 2026
2 checks passed
@barryollama

Copy link
Copy Markdown
Contributor Author

Addressed CodeRabbit's builder-union finding in 0913cf5:

  • construct CLI and persona definitions in separate branches
  • reject both/neither selectors and persona-incompatible fields at runtime
  • gate constraints.model to CLI definitions
  • add runtime regression coverage for untyped callers

Revalidated build, typecheck, and 83 affected persona/builder/runner tests.

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.

3 participants