Skip to content

feat: add grok harness support#204

Merged
willwashburn merged 2 commits into
mainfrom
codex/add-grok-harness
Jun 6, 2026
Merged

feat: add grok harness support#204
willwashburn merged 2 commits into
mainfrom
codex/add-grok-harness

Conversation

@willwashburn

@willwashburn willwashburn commented Jun 5, 2026

Copy link
Copy Markdown
Member

User description

Summary

  • add grok to persona-kit harness enum/schema and skill target mapping
  • translate Grok Build interactive and one-shot launch args, permission mode, plugin dirs, and AGENTS.md sidecars
  • wire CLI mount/sidecar/metadata/docs/tests for grok

Tests

  • corepack pnpm --filter @agentworkforce/persona-kit test
  • corepack pnpm --filter @agentworkforce/cli... build
  • corepack pnpm --filter @agentworkforce/cli test

CodeAnt-AI Description

Add Grok harness support across persona launches and skill setup

What Changed

  • Grok is now recognized as a supported harness in the CLI, persona schemas, and launch metadata
  • Persona launches for Grok can use AGENTS.md, .grok/skills, permission mode, and Grok Build’s one-shot launch flow
  • Skill installs and cleanup now account for Grok’s repo paths, and the sandbox mount is used by default for Grok interactive sessions
  • Help text, README guidance, and tests were updated to include Grok in supported harness lists and behavior

Impact

✅ Launch personas with Grok
✅ Keep Grok skill installs out of the real repo
✅ Apply AGENTS.md sidecars and permission mode in Grok sessions

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@codeant-ai

codeant-ai Bot commented Jun 5, 2026

Copy link
Copy Markdown

CodeAnt AI is reviewing your PR.

@coderabbitai

coderabbitai Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Too much diff to scan? Review this PR in Change Stack to start with the highest-impact changes.

Review Change Stack

Warning

Review limit reached

@willwashburn, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 41 minutes and 50 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

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.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 5d23c615-63a4-4081-befd-54aea5c5a8c5

📥 Commits

Reviewing files that changed from the base of the PR and between 5b5fb12 and 422373a.

📒 Files selected for processing (11)
  • packages/cli/README.md
  • packages/cli/src/cli.ts
  • packages/persona-kit/schemas/persona.schema.json
  • packages/persona-kit/src/execute.test.ts
  • packages/persona-kit/src/execute.ts
  • packages/persona-kit/src/interactive-spec.test.ts
  • packages/persona-kit/src/interactive-spec.ts
  • packages/persona-kit/src/plan.test.ts
  • packages/persona-kit/src/types.ts
  • packages/runtime/src/cloud-defaults.ts
  • packages/runtime/src/runner.test.ts
📝 Walkthrough

Walkthrough

This PR adds comprehensive support for the grok harness as a first-class citizen alongside claude, codex, and opencode. Changes span harness constants, CLI sandbox/mount configuration, persona-to-harness command translation (both interactive and one-shot modes), spawn plan sidecar resolution, and user documentation.

Changes

Grok Harness Integration

Layer / File(s) Summary
Harness constants and type definitions
packages/persona-kit/src/constants.ts, packages/cli/src/launch-metadata.ts, packages/persona-kit/schemas/persona.schema.json, packages/persona-kit/src/types.ts, packages/cli/src/cli.test.ts, packages/persona-kit/src/index.test.ts
HARNESS_VALUES now includes grok with asFlag: 'grok' and skill directory .grok/skills in HARNESS_SKILL_TARGETS. LaunchMetadataIngestHarness union type is extended to include 'grok'. Schema enum and JSDoc comments are updated to document grok as a recognized harness with permission-mode wiring and AGENTS.md sidecar applicability.
CLI launch metadata and session dir hints
packages/cli/src/launch-metadata.ts
launchMetadataSessionDirHint adds a grok case returning undefined, completing the launch-metadata contract for the new harness.
CLI sandbox mount and sidecar configuration
packages/cli/src/cli.ts, packages/cli/src/cli.test.ts
decideCleanMode treats grok as an interactive harness defaulting to sandbox mount (unless --install-in-repo). loadSidecarForSelection recognizes grok for AGENTS.md resolution from cwd. Ignore patterns are extended with .grok/skills to prevent skill artifacts from leaking into the repo. buildSpawnSummary conditionally reports permission-mode data for grok. CLI help text and usage descriptions are updated throughout.
Persona to interactive command translation
packages/persona-kit/src/interactive-spec.ts, packages/persona-kit/src/interactive-spec.test.ts
buildInteractiveSpec adds a grok case that generates CLI args with permission-mode flag, plugin-dir support, and conditional --always-approve. Grok-specific warnings are emitted for unsupported features (MCP injection, sandboxMode, approvalPolicy, etc.). InteractiveSpec is returned with initialPrompt: null, empty configFiles, and mcpServers passed through. Tests validate arg emission, permission-mode wiring, and warning behavior.
Persona to non-interactive command translation
packages/persona-kit/src/interactive-spec.ts
buildNonInteractiveSpec adds a grok case that constructs one-shot prompts by combining persona system prompt with task, appends grok-specific flags (--output-format plain, --single <prompt>), and conditionally adds --always-approve when approval is needed and permission-mode is not explicitly set.
Spawn plan AGENTS.md sidecar and skill materialization
packages/persona-kit/src/plan.ts, packages/persona-kit/src/skills.ts, packages/persona-kit/src/plan.test.ts, packages/persona-kit/src/index.test.ts
resolveSidecarWrite now includes grok in the harness check to stage AGENTS.md sidecars for grok personas. skillShArtifactPaths adds .grok/skills/<installedName> cleanup paths. Skill materialization validation messages updated to mention grok as a non-claude harness. Tests verify AGENTS.md sidecar resolution and skill install routing for grok.
CLI documentation and comments
packages/cli/src/cli.ts
Inline comments in runInteractive and mount-branch setup clarified to reflect grok/non-claude harness behavior for mount defaults, skill install paths, and config-file materialization strategy.
User-facing README documentation
packages/cli/README.md
Comprehensively updated to document grok across help text, harness check command, permissions wiring (mode via --permission-mode), MCP support table (not yet wired), interactive session defaults, skill staging guidance, sandbox mount behavior, and hidden/preserved path patterns.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • AgentWorkforce/workforce#49: Extends sandbox mount behavior for non-claude harnesses (codex in that PR; grok in this one) via decideCleanMode and loadSidecarForSelection.
  • AgentWorkforce/workforce#73: Foundational refactor moving harness-kit and persona code into persona-kit, which this PR builds upon by extending harness constants and spec-building logic.
  • AgentWorkforce/workforce#74: Introduced the persona spawn plan builder with harness-specific sidecar handling; this PR extends that sidecar resolution path to support grok AGENTS.md staging.

🐇 Grok joins the harness chorus,
With AGENTS.md sidecars and sandbox walls,
Permission modes wired, one-shot calls—
The workforce grows to help us more!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 55.56% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: add grok harness support' clearly summarizes the main change—adding support for the Grok harness across the codebase. It is specific, concise, and directly related to the primary objective of the changeset.
Description check ✅ Passed The description provides a clear summary of changes including Grok harness addition to persona-kit, CLI wiring, and skill setup. It is directly related to the changeset with relevant details about what was changed and its impact.
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/add-grok-harness

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.

@codeant-ai codeant-ai Bot added the size:L This PR changes 100-499 lines, ignoring generated files label Jun 5, 2026

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5b5fb12559

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

}
const args = ['--no-auto-update', '--model', model];
if (permissions?.mode) {
args.push('--permission-mode', permissions.mode);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Stop passing Claude permission modes to Grok

When a Grok persona sets permissions.mode, this emits grok --permission-mode <mode>, but the Grok Build docs I checked list --always-approve as the CLI approval flag and describe permission_mode only as a ~/.grok/config.toml setting with ask/always-approve values (headless flags, modes). Since this schema's modes are Claude values such as acceptEdits, bypassPermissions, and plan, those personas will either fail on an unknown/invalid option or fail to enable the intended approval behavior; the non-interactive path also suppresses --always-approve once this flag is present.

Useful? React with 👍 / 👎.

return {
bin: 'grok',
args,
initialPrompt: null,

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 Badge Preserve the system prompt for Grok sessions

For interactive Grok personas that do not also declare an agentsMd sidecar, the required persona systemPrompt is dropped: the argv only carries model/update flags, configFiles is empty, and initialPrompt is null, so runInteractive has nothing to append or materialize. Grok does read AGENTS.md instruction files from the cwd per xAI's skills/instructions docs, but this branch does not generate one from systemPrompt, so a valid Grok persona with only the required systemPrompt launches as a generic Grok session rather than with the persona's instructions.

Useful? React with 👍 / 👎.

Comment on lines +455 to 456
* when the persona runs under the opencode/codex/grok harnesses. Same resolution
* rules as {@link claudeMd}.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟠 Architect Review — HIGH

Persona docs and persona-kit now state that AGENTS.md sidecars apply to opencode/codex/grok, but the cloud runtime's sidecarForPersona in packages/runtime/src/cloud-defaults.ts still only materializes AGENTS.md for codex/opencode, so grok personas launched via runtime/cloud flows will silently skip their AGENTS.md sidecar content.

Suggestion: Extend sidecarForPersona in packages/runtime/src/cloud-defaults.ts to treat harness 'grok' like codex/opencode for AGENTS.md, ensuring grok cloud/runtime launches materialize the same sidecar content as CLI interactive launches.

Fix in Cursor | Fix in VSCode Claude

(Use Cmd/Ctrl + Click for best experience)

Prompt for AI Agent 🤖
This is an **Architect / Logical Review** comment left during a code review. These reviews are first-class, important findings — not optional suggestions. Do NOT dismiss this as a 'big architectural change' just because the title says architect review; most of these can be resolved with a small, localized fix once the intent is understood.

**Path:** packages/persona-kit/src/types.ts
**Line:** 455:456
**Comment:**
	*HIGH: Persona docs and persona-kit now state that AGENTS.md sidecars apply to opencode/codex/grok, but the cloud runtime's sidecarForPersona in packages/runtime/src/cloud-defaults.ts still only materializes AGENTS.md for codex/opencode, so grok personas launched via runtime/cloud flows will silently skip their AGENTS.md sidecar content.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
If a suggested approach is provided above, use it as the authoritative instruction. If no explicit code suggestion is given, you MUST still draft and apply your own minimal, localized fix — do not punt back with 'no suggestion provided, review manually'. Keep the change as small as possible: add a guard clause, gate on a loading state, reorder an await, wrap in a conditional, etc. Do not refactor surrounding code or expand scope beyond the finding.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix

return [];
}
if (harness === 'opencode' || harness === 'codex') {
if (harness === 'opencode' || harness === 'codex' || harness === 'grok') {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggestion: This adds Grok to local sidecar planning, but the cloud non-interactive path still only materializes AGENTS.md for codex/opencode (runtime sidecarForPersona excludes grok). That creates an integration mismatch where local Grok runs get AGENTS.md but cloud Grok runs silently lose it. Update the cloud sidecar resolver to include grok so both execution paths behave consistently. [incomplete implementation]

Severity Level: Major ⚠️
- ❌ Cloud Grok runs never materialize AGENTS.md sidecar.
- ⚠️ Grok behavior diverges between CLI and cloud runtime.
- ⚠️ Persona docs/metadata missing in Grok cloud sandboxes.
Steps of Reproduction ✅
1. Define a persona with `harness: 'grok'` and AGENTS sidecar content using the persona
schema in `packages/persona-kit/src/types.ts:22-27` and
`packages/persona-kit/src/types.ts:15-21,28-30` (fields `agentsMd`, `agentsMdMode`,
`agentsMdContent` are documented as applying to "opencode/codex/grok" harnesses).

2. Deploy this persona to the cloud and start the runtime via `startRunner` in
`packages/runtime/src/runner.ts:79-120`, which builds the execution context using
`createCloudRuntimeDefaults` (`packages/runtime/src/cloud-defaults.ts:7-38`) and wires
`harnessRunner` to `createProcessHarnessRunner`
(`packages/runtime/src/cloud-defaults.ts:412-417`).

3. Inside your handler, call `await ctx.harness.run({ prompt: '...' })`; `buildCtx` in
`packages/runtime/src/ctx.ts:10-22` binds `ctx.harness.run` to `options.harnessRunner`, so
this call executes the process harness runner created above, which in turn calls
`materializeSidecar` at `packages/runtime/src/cloud-defaults.ts:22-31`.

4. `materializeSidecar` calls `sidecarForPersona`
(`packages/runtime/src/cloud-defaults.ts:44-62`), which only returns an `AGENTS.md`
sidecar when `persona.harness === 'codex' || persona.harness === 'opencode'` (line 55);
for `persona.harness === 'grok'` it returns `undefined`, so no `/workspace/AGENTS.md` is
written in cloud runs, while the local CLI path uses `resolveSidecarWrite` in
`packages/persona-kit/src/plan.ts:139-56` (which explicitly includes `harness === 'grok'`
at line 164) and `writePersonaSidecars` in `packages/persona-kit/src/sidecars.ts:73-91` to
materialize `AGENTS.md`, creating a behavior mismatch between local and cloud Grok
executions.

Fix in Cursor | Fix in VSCode Claude

(Use Cmd/Ctrl + Click for best experience)

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** packages/persona-kit/src/plan.ts
**Line:** 164:164
**Comment:**
	*Incomplete Implementation: This adds Grok to local sidecar planning, but the cloud non-interactive path still only materializes `AGENTS.md` for `codex`/`opencode` (runtime `sidecarForPersona` excludes `grok`). That creates an integration mismatch where local Grok runs get `AGENTS.md` but cloud Grok runs silently lose it. Update the cloud sidecar resolver to include `grok` so both execution paths behave consistently.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
👍 | 👎

@codeant-ai

codeant-ai Bot commented Jun 5, 2026

Copy link
Copy Markdown

CodeAnt AI finished reviewing your PR.

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

Caution

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

⚠️ Outside diff range comments (4)
packages/cli/README.md (3)

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

--filter-harness allowed values are stale.

This line omits grok, but the rest of the README treats it as a supported harness. Please update the flag value list to include grok.

🤖 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/cli/README.md` at line 336, Update the README entry for the
--filter-harness flag to include the missing "grok" option in the allowed values
list (the line that currently shows `--filter-harness <harness>` with values
`claude | codex | opencode`); modify that list to include `grok` so it matches
the rest of the documentation that treats "grok" as a supported harness.

1172-1174: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Troubleshooting harness list should include grok.

The “install the harness CLI” list is missing grok, which can mislead users debugging PATH issues for Grok personas.

🤖 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/cli/README.md` around lines 1172 - 1174, Update the troubleshooting
bullet that lists harness CLIs to include "grok" alongside "claude", "codex",
and "opencode" so the message **`Failed to spawn "claude": binary not found on
PATH.`** (and similar entries) suggests installing the `grok` CLI when
appropriate; edit the README entry to add `grok` to the inline list of CLI
names.

783-784: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Sandbox-mount scope conflicts with later sections.

This sentence says only claude and opencode use default mount behavior, but later sections describe default sandboxing for interactive harness sessions broadly (including grok/codex behavior). Please align this section so the mount default is described consistently.

🤖 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/cli/README.md` around lines 783 - 784, Update the sentence so it
consistently describes the default sandbox-mount behavior for all interactive
harness sessions rather than only "Interactive `claude` and `opencode`
sessions"; edit the phrasing containing "Interactive `claude` and `opencode`
sessions run inside a Relayfile mount by default" to state that interactive
harness sessions (e.g., `claude`, `opencode`, `grok`, `codex`) run inside a
Relayfile mount by default and that file visibility/writability are controlled
by the persona's settings; ensure you keep the reference to "Relayfile mount"
and the persona-controlled visibility/writability language intact for clarity.
packages/persona-kit/src/interactive-spec.ts (1)

326-328: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Refresh pluginDirs warning text to include Grok support.

Line 327 and Line 396 still say plugin dirs are “claude-only”, but this PR adds Grok plugin-dir wiring. That user-facing warning is now inaccurate.

Proposed patch
-          'pluginDirs is currently claude-only; ignoring under the codex harness. Skills must be staged via codex conventions.'
+          'pluginDirs is currently supported only for claude and grok; ignoring under the codex harness. Skills must be staged via codex conventions.'
...
-          'pluginDirs is currently claude-only; ignoring under the opencode harness. Skills must be staged via opencode conventions.'
+          'pluginDirs is currently supported only for claude and grok; ignoring under the opencode harness. Skills must be staged via opencode conventions.'

Also applies to: 395-397

🤖 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/persona-kit/src/interactive-spec.ts` around lines 326 - 328, Update
the user-facing warning pushed into warnings in interactive-spec.ts for
pluginDirs to reflect that plugin-dir wiring now supports Grok (not just
Claude); change the message used in the warnings.push(...) calls (both
occurrences around the pluginDirs check) to mention Grok support and that
pluginDirs are still ignored under the codex harness (or whatever harnesss
should ignore them) so the warning is accurate.
🤖 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/cli/README.md`:
- Line 336: Update the README entry for the --filter-harness flag to include the
missing "grok" option in the allowed values list (the line that currently shows
`--filter-harness <harness>` with values `claude | codex | opencode`); modify
that list to include `grok` so it matches the rest of the documentation that
treats "grok" as a supported harness.
- Around line 1172-1174: Update the troubleshooting bullet that lists harness
CLIs to include "grok" alongside "claude", "codex", and "opencode" so the
message **`Failed to spawn "claude": binary not found on PATH.`** (and similar
entries) suggests installing the `grok` CLI when appropriate; edit the README
entry to add `grok` to the inline list of CLI names.
- Around line 783-784: Update the sentence so it consistently describes the
default sandbox-mount behavior for all interactive harness sessions rather than
only "Interactive `claude` and `opencode` sessions"; edit the phrasing
containing "Interactive `claude` and `opencode` sessions run inside a Relayfile
mount by default" to state that interactive harness sessions (e.g., `claude`,
`opencode`, `grok`, `codex`) run inside a Relayfile mount by default and that
file visibility/writability are controlled by the persona's settings; ensure you
keep the reference to "Relayfile mount" and the persona-controlled
visibility/writability language intact for clarity.

In `@packages/persona-kit/src/interactive-spec.ts`:
- Around line 326-328: Update the user-facing warning pushed into warnings in
interactive-spec.ts for pluginDirs to reflect that plugin-dir wiring now
supports Grok (not just Claude); change the message used in the
warnings.push(...) calls (both occurrences around the pluginDirs check) to
mention Grok support and that pluginDirs are still ignored under the codex
harness (or whatever harnesss should ignore them) so the warning is accurate.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 801609a7-98f4-4bb9-9fc8-a67c37b6b0f9

📥 Commits

Reviewing files that changed from the base of the PR and between e48664a and 5b5fb12.

📒 Files selected for processing (14)
  • packages/cli/README.md
  • packages/cli/src/cli.test.ts
  • packages/cli/src/cli.ts
  • packages/cli/src/launch-metadata.test.ts
  • packages/cli/src/launch-metadata.ts
  • packages/persona-kit/schemas/persona.schema.json
  • packages/persona-kit/src/constants.ts
  • packages/persona-kit/src/index.test.ts
  • packages/persona-kit/src/interactive-spec.test.ts
  • packages/persona-kit/src/interactive-spec.ts
  • packages/persona-kit/src/plan.test.ts
  • packages/persona-kit/src/plan.ts
  • packages/persona-kit/src/skills.ts
  • packages/persona-kit/src/types.ts

@cubic-dev-ai cubic-dev-ai 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.

3 issues found across 14 files

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="packages/persona-kit/src/interactive-spec.ts">

<violation number="1" location="packages/persona-kit/src/interactive-spec.ts:489">
P2: Grok permission mode is passed through without harness-specific mapping. Shared persona modes can produce unsupported Grok `--permission-mode` values and break or weaken intended approval behavior.</violation>

<violation number="2" location="packages/persona-kit/src/interactive-spec.ts:519">
P1: For interactive Grok sessions, the persona's `systemPrompt` is never passed to the harness: the args only contain model/permission/plugin flags, `initialPrompt` is `null`, and `configFiles` is empty. A Grok persona that declares only the required `systemPrompt` (without an explicit `agentsMd`/`agentsMdContent` sidecar) will launch as a generic Grok session with no persona instructions. Either generate an AGENTS.md from the system prompt, or pass it through another mechanism (e.g., `initialPrompt` or a config file).</violation>
</file>

<file name="packages/persona-kit/src/plan.ts">

<violation number="1" location="packages/persona-kit/src/plan.ts:164">
P2: This adds `grok` to the local sidecar resolution path, but the cloud runtime's `sidecarForPersona` in `packages/runtime/src/cloud-defaults.ts` still only materializes AGENTS.md for `codex`/`opencode`. Cloud Grok runs will silently skip their AGENTS.md sidecar content, creating a behavioral mismatch between local and cloud execution paths. The cloud sidecar resolver should be updated to include `grok`.</violation>
</file>

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

Re-trigger cubic

Comment thread packages/persona-kit/src/interactive-spec.ts
Comment thread packages/persona-kit/src/interactive-spec.ts Outdated
return [];
}
if (harness === 'opencode' || harness === 'codex') {
if (harness === 'opencode' || harness === 'codex' || harness === 'grok') {

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.

P2: This adds grok to the local sidecar resolution path, but the cloud runtime's sidecarForPersona in packages/runtime/src/cloud-defaults.ts still only materializes AGENTS.md for codex/opencode. Cloud Grok runs will silently skip their AGENTS.md sidecar content, creating a behavioral mismatch between local and cloud execution paths. The cloud sidecar resolver should be updated to include grok.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/persona-kit/src/plan.ts, line 164:

<comment>This adds `grok` to the local sidecar resolution path, but the cloud runtime's `sidecarForPersona` in `packages/runtime/src/cloud-defaults.ts` still only materializes AGENTS.md for `codex`/`opencode`. Cloud Grok runs will silently skip their AGENTS.md sidecar content, creating a behavioral mismatch between local and cloud execution paths. The cloud sidecar resolver should be updated to include `grok`.</comment>

<file context>
@@ -161,7 +161,7 @@ function resolveSidecarWrite(
     return [];
   }
-  if (harness === 'opencode' || harness === 'codex') {
+  if (harness === 'opencode' || harness === 'codex' || harness === 'grok') {
     if (selection.agentsMdContent !== undefined) {
       return [
</file context>

@willwashburn willwashburn merged commit 47c74a1 into main Jun 6, 2026
3 checks passed
@willwashburn willwashburn deleted the codex/add-grok-harness branch June 6, 2026 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant