Skip to content

fix(runtime): wire Relay MCP into cloud personas#205

Merged
khaliqgant merged 8 commits into
mainfrom
fix/codex-relay-mcp-cloud-personas
Jun 6, 2026
Merged

fix(runtime): wire Relay MCP into cloud personas#205
khaliqgant merged 8 commits into
mainfrom
fix/codex-relay-mcp-cloud-personas

Conversation

@khaliqgant
Copy link
Copy Markdown
Member

@khaliqgant khaliqgant commented Jun 5, 2026

Summary

  • wire cloud ctx.harness.run() Claude and Codex launches through agent-relay-broker mcp-args --register when Relay env is present
  • keep Codex ordering as exec, broker-returned MCP args, then original Codex args while passing the base args through --existing-args
  • merge broker-generated Claude mcpServers.agent-relay into the existing strict --mcp-config payload, preserving persona MCP servers and removing auto-injected legacy relaycast
  • preserve explicit persona agent-relay / relaycast overrides as an intentional opt-out from broker injection
  • forward Relay multi-workspace context and resolve the broker from env, the Daytona SDK compatibility path, or PATH
  • retain a logged legacy @relaycast/mcp fallback when the broker helper is unavailable or returns invalid output

Review

  • Coordinated the Relay contract with codex-1 and claude-1 in Relaycast.
  • Relay-side guidance was to use agent-relay-broker mcp-args --register, consume its JSON rather than hand-constructing MCP env, pass --cwd, and treat the Daytona /opt/relay-smoke binary path as cloud-image compatibility only.
  • Final Relay review signed off on the Claude strict-config merge, Codex arg ordering, override behavior, and tests.

Notes

  • resolveRelayMcpFromEnv(args.env) assumes the broker/Daytona launcher puts RELAY_API_KEY and RELAY_AGENT_NAME in the runtime process env, not only in persona/run env. This matches the existing relayMcp contract in persona-kit.
  • Codex passes existing launch args to the broker so the helper can avoid double-injection when persona MCP config already declares Relay servers.
  • Claude calls the broker helper with empty --existing-args because Claude always has a base --mcp-config; the returned broker payload is then merged into that strict config.
  • Personas that explicitly declare agent-relay or legacy relaycast preserve that override and skip the pre-registered broker fast path unless their config already carries equivalent token settings.

Tests

  • pnpm --filter @agentworkforce/runtime test
  • pnpm --filter @agentworkforce/persona-kit test -- interactive-spec.test.js
  • git diff --check

@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
Copy link
Copy Markdown

codeant-ai Bot commented Jun 5, 2026

CodeAnt AI is reviewing your PR.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 5, 2026

Need the big picture first? Review this PR in Change Stack to see what changed before going file by file.

Review Change Stack

Warning

Review limit reached

@agent-relay-code[bot], we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 25 minutes and 3 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: efef8722-ddd6-4ba6-a67d-f07f85e0bd9e

📥 Commits

Reviewing files that changed from the base of the PR and between 4b4b887 and f717b15.

📒 Files selected for processing (3)
  • .gitignore
  • packages/runtime/src/cloud-defaults.ts
  • packages/runtime/src/runner.test.ts
📝 Walkthrough

Walkthrough

This PR extends the cloud harness runner to read Relay MCP config from environment and refactors spec construction so non-Codex harnesses get relayMcp injected directly, while Codex harnesses spawn an agent-relay-broker to obtain MCP args that are injected into the harness spawn command; includes helpers and an integration test.

Changes

Relay MCP Configuration for Cloud Harness Runner

Layer / File(s) Summary
Type imports and Relay MCP environment resolution
packages/runtime/src/cloud-defaults.ts
RelayMcpConfig type import added and resolveRelayMcpFromEnv computes relayMcp from environment for the harness runner.
Harness spec and spawn argument refactor
packages/runtime/src/cloud-defaults.ts
Spec construction refactored to use a shared specInput; non-Codex harnesses receive relayMcp injected into the non-interactive spec, Codex harnesses resolve broker args asynchronously and inject returned subcommand args into spawnArgs; spawn now uses computed spawnArgs.
Internal Relay and Codex broker integration helpers
packages/runtime/src/cloud-defaults.ts
New helpers: BrokerMcpArgsOutput type guard, broker binary selection (including sandbox detection), resolveCodexAgentRelayMcpArgs that spawns the broker and parses/validates JSON output, existing-args normalization, and Codex subcommand arg injection.
Integration test with fake harness and broker
packages/runtime/src/runner.test.ts
Adds writeArgCaptureHarness and writeFakeBroker helpers plus an integration-style test that verifies Codex broker-injected agent-relay MCP args appear in harness argv and that broker argv includes expected MCP CLI params; uses temp dirs with cleanup.
Persisted Relay workspace state file
memory/workspace/.relay/state.json
Adds a Relay workspace state.json containing polling/config/reconcile timestamps, counters, circuit-breaker settings, and state flags.

Sequence Diagram

sequenceDiagram
  participant HarnessRunner as Harness Runner
  participant RelayResolver as Relay Resolver
  participant BrokerResolution as Broker Resolution
  participant AgentRelayBroker as Agent Relay Broker
  participant SpawnHandler as Spawn Handler
  HarnessRunner->>RelayResolver: resolveRelayMcpFromEnv(env)
  RelayResolver-->>HarnessRunner: RelayMcpConfig
  alt Codex Harness
    HarnessRunner->>BrokerResolution: resolveCodexAgentRelayMcpArgs(specInput, env)
    BrokerResolution->>AgentRelayBroker: spawn broker binary with broker args
    AgentRelayBroker-->>BrokerResolution: JSON output { args, sideEffectFiles, agentToken }
    BrokerResolution->>HarnessRunner: injectCodexSubcommandArgs(spawnArgs, returnedArgs)
    HarnessRunner->>SpawnHandler: spawn harness process with injected spawnArgs
  else Non-Codex Harness
    HarnessRunner->>SpawnHandler: inject relayMcp into spec.args
    HarnessRunner->>SpawnHandler: spawn harness process with spec.args
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

  • AgentWorkforce/workforce#135: Touches createProcessHarnessRunner and related persona/harness handling that this PR extends with Relay MCP broker behavior.
  • AgentWorkforce/workforce#170: Implements Relay MCP env-to-config flow in CLI/persona-kit that complements the runtime broker/spec wiring added here.

Poem

🐰 I hopped through env vars, sniffing MCP,
I nudged a broker, fetched args for thee,
Codex danced as spawnArgs fell in line,
A tiny relay hums — all tests say fine.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% 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
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 pull request title clearly and concisely describes the main change: wiring Relay MCP configuration into cloud personas, which directly matches the primary objective and changeset.
Description check ✅ Passed The pull request description is comprehensive and directly related to the changeset, detailing the implementation approach, Relay integration specifics, and testing performed.

✏️ 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 fix/codex-relay-mcp-cloud-personas

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
});
const task = run.prompt;
const spec = buildNonInteractiveSpec({
const relayMcp = resolveRelayMcpFromEnv(args.env);
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: Relay MCP detection is using only the static launcher environment, so per-run env overrides on ctx.harness.run() are ignored. If a caller supplies RELAY_API_KEY / RELAY_AGENT_NAME (or overrides them) in run.env, relay wiring will not be activated for that run. Build Relay config from the effective run environment (including run-level overrides) before deciding whether to call the broker. [api mismatch]

Severity Level: Major ⚠️
- ❌ Relay MCP never enabled from run.env overrides.
- ⚠️ Handlers cannot pass per-run Relay config safely.
- ⚠️ Personas relying on dynamic Relay fail silently.
Steps of Reproduction ✅
1. Build the cloud runtime defaults by calling `createCloudRuntimeDefaults` from
`packages/runtime/src/cloud-defaults.ts:67-96`, which computes `env = options.env ??
process.env` and passes it into `createProcessHarnessRunner` as `args.env`.

2. Wire this runtime into a handler context using `buildCtx` so that `ctx.harness.run` is
backed by `options.harnessRunner`, as shown in `packages/runtime/src/ctx.ts:20-22` where
`harness: { run: options.harnessRunner }` is set.

3. From a handler, invoke `ctx.harness.run` with per-run environment overrides containing
Relay credentials, e.g. `ctx.harness.run({ prompt: '...', env: { RELAY_API_KEY: 'k',
RELAY_AGENT_NAME: 'agent' } })`, which is supported by `HarnessRunArgs.env` ("Environment
overrides merged on top of the persona's env") in `packages/runtime/src/types.ts:62-71`.

4. Follow the execution into `createProcessHarnessRunner` in
`packages/runtime/src/cloud-defaults.ts:14-146`: `relayMcp` is computed from the static
launcher env via `const relayMcp = resolveRelayMcpFromEnv(args.env);` at line 64, while
the child process environment merges `...(run.env ?? {})` at lines 108-114. If
`options.env` (and thus `args.env`) does not contain `RELAY_API_KEY` / `RELAY_AGENT_NAME`
but `run.env` does, `resolveRelayMcpFromEnv` (lines 154-165) returns `undefined`, no Relay
wiring/broker call occurs, yet the spawned harness still receives the RELAY_* variables in
`childEnv`. Relay MCP integration silently remains disabled for runs configured only via
`run.env`.

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/runtime/src/cloud-defaults.ts
**Line:** 463:463
**Comment:**
	*Api Mismatch: Relay MCP detection is using only the static launcher environment, so per-run `env` overrides on `ctx.harness.run()` are ignored. If a caller supplies `RELAY_API_KEY` / `RELAY_AGENT_NAME` (or overrides them) in `run.env`, relay wiring will not be activated for that run. Build Relay config from the effective run environment (including run-level overrides) before deciding whether to call the broker.

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
👍 | 👎

Comment thread packages/runtime/src/cloud-defaults.ts Outdated
Comment on lines +583 to +584
args.relayMcp.apiKey,
'--base-url',
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: The Relay API key is passed as a command-line argument to the broker, which exposes it via process argv (and potentially shell/process inspection tooling). This leaks credentials outside intended secret channels; pass the key through environment variables or another non-argv secret transport. [security]

Severity Level: Critical 🚨
- ❌ Relay API key exposed via broker argv.
- ❌ Host process introspection can capture secret arguments.
- ⚠️ Violates secret-handling guidance for subprocess credentials.
Steps of Reproduction ✅
1. Configure a Codex-based persona with Relay enabled and build cloud defaults by calling
`createCloudRuntimeDefaults` in `packages/runtime/src/cloud-defaults.ts:67-96`, with `env`
containing `RELAY_API_KEY` and `RELAY_AGENT_NAME` so `resolveRelayMcpFromEnv` can succeed.

2. Invoke the handler's `ctx.harness.run({ prompt: '...' })`; `buildCtx` wires
`ctx.harness.run` to `options.harnessRunner` in `packages/runtime/src/ctx.ts:20-22`, which
is the function returned by `createProcessHarnessRunner` in
`packages/runtime/src/cloud-defaults.ts:14-146`.

3. Inside `createProcessHarnessRunner`, when `harness === 'codex'` and Relay config is
present, execution enters the Codex Relay branch at lines 82-99 and calls
`resolveCodexAgentRelayMcpArgs` with `{ env: args.env, relayMcp, cwd, existingArgs:
codexExistingArgs(spawnArgs), log }` (lines 83-88).

4. In `resolveCodexAgentRelayMcpArgs` (`packages/runtime/src/cloud-defaults.ts:168-235`),
the broker argument list `brokerArgs` is constructed at lines 177-192, explicitly adding
`'--api-key', args.relayMcp.apiKey` at lines 183-184 before spawning the broker via
`spawnAndCapture` (lines 199-205); this causes the Relay API key to appear in the child
process command line (e.g. `agent-relay-broker ... --api-key sk-relay-test`), which can be
read from process listings (`ps`, `/proc/<pid>/cmdline`, or equivalent tooling), exposing
a secret via argv rather than a safer channel like environment variables.

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/runtime/src/cloud-defaults.ts
**Line:** 583:584
**Comment:**
	*Security: The Relay API key is passed as a command-line argument to the broker, which exposes it via process argv (and potentially shell/process inspection tooling). This leaks credentials outside intended secret channels; pass the key through environment variables or another non-argv secret transport.

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
👍 | 👎

if (process.platform === 'linux') return `linux-${arch}`;
if (process.platform === 'darwin') return `darwin-${arch}`;
if (process.platform === 'win32') return 'win32-x64.exe';
return undefined;
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: The Windows broker suffix is hardcoded to x64 even when running on arm64, so bundled broker resolution will pick the wrong binary name on Windows arm64 hosts and fall back unexpectedly. Include architecture in the Windows suffix logic the same way Linux/macOS do. [incorrect condition logic]

Severity Level: Major ⚠️
- ❌ Windows arm64 cannot use bundled broker binary.
- ⚠️ Relay Codex sessions rely on external broker installation.
- ⚠️ Fallback path may break Relay-enabled personas.
Steps of Reproduction ✅
1. On a Windows arm64 host, install the Relay SDK broker into the Daytona path expected by
`resolveSandboxAgentRelayBrokerBinary`, e.g.
`/opt/relay-smoke/node_modules/@agent-relay/sdk/bin/agent-relay-broker-win32-arm64.exe`,
matching the platform-specific naming scheme used for Linux/macOS in
`agentRelayBrokerPlatformSuffix` (`packages/runtime/src/cloud-defaults.ts:254-259`).

2. Configure a Codex persona with Relay enabled and build cloud defaults with
`createCloudRuntimeDefaults` (`packages/runtime/src/cloud-defaults.ts:67-96`), then run a
handler that calls `ctx.harness.run`, flowing into `createProcessHarnessRunner`
(`packages/runtime/src/cloud-defaults.ts:14-146`) and its call to
`resolveCodexAgentRelayMcpArgs` (lines 82-88) for Codex Relay wiring.

3. Inside `resolveCodexAgentRelayMcpArgs`
(`packages/runtime/src/cloud-defaults.ts:168-235`), the broker path is resolved by
`resolveAgentRelayBrokerBinary` at line 175, which delegates to
`resolveSandboxAgentRelayBrokerBinary` (lines 237-245); that function uses
`agentRelayBrokerPlatformSuffix` (lines 254-260) to compute a suffix based on
`process.platform` and `process.arch`.

4. On Windows arm64, `agentRelayBrokerPlatformSuffix` sets `arch` to `'arm64'` but returns
`'win32-x64.exe'` for `process.platform === 'win32'` at line 259, yielding a candidate
path ending in `agent-relay-broker-win32-x64.exe` that does not exist;
`canExecuteFileSync` (lines 263-270) fails, `resolveSandboxAgentRelayBrokerBinary` returns
`undefined`, and `resolveAgentRelayBrokerBinary` falls back to `'agent-relay-broker'`
(lines 237-241). If no matching `agent-relay-broker` is on PATH, the subsequent spawn in
`resolveCodexAgentRelayMcpArgs` fails and logs `harness.relay_mcp.broker_args_failed`,
breaking Codex Relay integration specifically on Windows arm64.

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/runtime/src/cloud-defaults.ts
**Line:** 659:659
**Comment:**
	*Incorrect Condition Logic: The Windows broker suffix is hardcoded to x64 even when running on arm64, so bundled broker resolution will pick the wrong binary name on Windows arm64 hosts and fall back unexpectedly. Include architecture in the Windows suffix logic the same way Linux/macOS do.

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
Copy link
Copy Markdown

codeant-ai Bot commented Jun 5, 2026

CodeAnt AI finished reviewing your PR.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 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/runtime/src/cloud-defaults.ts`:
- Around line 575-590: The current brokerArgs builder always appends a
--base-url flag using baseUrl which defaults to 'https://api.relaycast.dev',
causing Codex launches to force a Relay URL even when none was configured;
update the logic that builds brokerArgs (the const baseUrl and brokerArgs array
around the 'mcp-args' construction) so that you only push/append the
'--base-url' and its value when args.relayMcp.baseUrl is defined (truthy),
otherwise omit the flag entirely to match the non-Codex path behavior.
🪄 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: 16766e76-851b-42b3-bee1-2f88edbf7c11

📥 Commits

Reviewing files that changed from the base of the PR and between e48664a and 2c3ccc6.

📒 Files selected for processing (2)
  • packages/runtime/src/cloud-defaults.ts
  • packages/runtime/src/runner.test.ts

Comment thread packages/runtime/src/cloud-defaults.ts Outdated
Comment thread packages/runtime/src/cloud-defaults.ts
@agent-relay-code
Copy link
Copy Markdown
Contributor

Implemented fixes for PR #205:

  • cloud-defaults.ts: treats broker responses with empty args as invalid so Codex falls back to legacy Relay MCP wiring instead of silently running without Relay MCP.
  • cloud-defaults.ts: redacts RELAY_API_KEY from broker failure stderr before logging.
  • runner.test.ts: added regression coverage for empty broker args fallback and API-key redaction on broker failure.

Verification run locally:

  • pnpm --filter @agentworkforce/runtime test
  • pnpm build
  • pnpm check

All passed.

@agent-relay-code
Copy link
Copy Markdown
Contributor

⚠️ pr-reviewer push failed (exit 1) — fixes were not applied to the PR. The notes below are advisory and were not pushed.

Implemented fixes for PR #205:

  • cloud-defaults.ts: treats broker responses with empty args as invalid so Codex falls back to legacy Relay MCP wiring instead of silently running without Relay MCP.
  • cloud-defaults.ts: redacts RELAY_API_KEY from broker failure stderr before logging.
  • runner.test.ts: added regression coverage for empty broker args fallback and API-key redaction on broker failure.

Verification run locally:

  • pnpm --filter @agentworkforce/runtime test
  • pnpm build
  • pnpm check

All passed.

@khaliqgant khaliqgant changed the title fix(runtime): wire Relay MCP into cloud Codex personas fix(runtime): wire Relay MCP into cloud personas Jun 5, 2026
@agent-relay-code
Copy link
Copy Markdown
Contributor

⚠️ pr-reviewer push failed (exit 1) — fixes were not applied to the PR. The notes below are advisory and were not pushed.

Reviewed the PR changes and removed the stray memory/workspace/.relay/state.json relay mount state file from the PR.

Validation run:
corepack pnpm --dir packages/runtime test passed: 71 tests.

No reviewer/bot comments were present in the provided .workforce context files to validate.

@agent-relay-code
Copy link
Copy Markdown
Contributor

Reviewed PR #205 against the checked-out diff and traced the runtime/persona-kit surfaces.

I removed the accidental generated file memory/workspace/.relay/state.json; .gitignore already excludes **/.relay/, so it should not be part of the PR.

Local verification passed:

  • pnpm --filter @agentworkforce/persona-kit test
  • pnpm --filter @agentworkforce/runtime test
  • pnpm run check

@agent-relay-code
Copy link
Copy Markdown
Contributor

⚠️ pr-reviewer did not push — the PR branch advanced during the review, so fixes were withheld to avoid overwriting newer commits. Re-trigger the review once the branch settles. The notes below are advisory and were not pushed.

Reviewed PR #205 against the checked-out diff and traced the runtime/persona-kit surfaces.

I removed the accidental generated file memory/workspace/.relay/state.json; .gitignore already excludes **/.relay/, so it should not be part of the PR.

Local verification passed:

  • pnpm --filter @agentworkforce/persona-kit test
  • pnpm --filter @agentworkforce/runtime test
  • pnpm run check

@agent-relay-code
Copy link
Copy Markdown
Contributor

⚠️ pr-reviewer push failed (exit 128) — fixes were not applied to the PR. The notes below are advisory and were not pushed.

Implemented the validated PR fixes:

  • Removed generated memory/workspace/.relay/state.json.
  • Broker args no longer force --base-url when RELAY_BASE_URL is unset.
  • Codex broker --existing-args excludes the rendered prompt.
  • Empty broker args responses are rejected so fallback Relay MCP wiring is used.
  • Broker failure logging now redacts RELAY_API_KEY.
  • Added regression coverage for each behavior.

Local validation passed:

  • corepack pnpm --filter @agentworkforce/runtime typecheck
  • corepack pnpm --filter @agentworkforce/runtime test
  • corepack pnpm --filter @agentworkforce/persona-kit test
  • corepack pnpm -r test
  • corepack pnpm -r lint
  • corepack pnpm -r typecheck

@agent-relay-code
Copy link
Copy Markdown
Contributor

Reviewed PR #205 against .workforce/pr.diff, changed files, and current checkout. I did not find a reproducible defect or stale bot-review item requiring a code edit.

Validation run:

  • pnpm install
  • pnpm --filter @agentworkforce/persona-kit build
  • pnpm --filter @agentworkforce/runtime test
  • pnpm -r build
  • pnpm run check

pnpm run check passed locally after building workspace outputs.

@agent-relay-code
Copy link
Copy Markdown
Contributor

ℹ️ pr-reviewer: review only — no file changes were applied to the PR (nothing to commit after review). The notes below are advisory and were not pushed.

Reviewed PR #205 against .workforce/pr.diff, changed files, and current checkout. I did not find a reproducible defect or stale bot-review item requiring a code edit.

Validation run:

  • pnpm install
  • pnpm --filter @agentworkforce/persona-kit build
  • pnpm --filter @agentworkforce/runtime test
  • pnpm -r build
  • pnpm run check

pnpm run check passed locally after building workspace outputs.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 3 files

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

Re-trigger cubic

Comment thread packages/runtime/src/cloud-defaults.ts Outdated
@agent-relay-code
Copy link
Copy Markdown
Contributor

Reviewed PR #205 against the checked-out diff and traced the Relay MCP harness changes through runtime spec construction and related tests. I did not find a current breakage that required code edits.

Verification completed:

  • corepack pnpm install
  • corepack pnpm --filter @agentworkforce/persona-kit build
  • corepack pnpm --filter @agentworkforce/deploy build
  • corepack pnpm --filter @agentworkforce/workload-router build
  • corepack pnpm --filter @agentworkforce/runtime test
  • corepack pnpm --filter @agentworkforce/runtime typecheck
  • Equivalent full check via Corepack: corepack pnpm -r lint && corepack pnpm -r typecheck && corepack pnpm run typecheck:examples && corepack pnpm -r test

Note: corepack pnpm run check itself failed in this sandbox because the package script shells out to bare pnpm, which is not on PATH here. The equivalent Corepack-expanded lint/typecheck/test sequence passed.

@agent-relay-code
Copy link
Copy Markdown
Contributor

ℹ️ pr-reviewer: review only — no file changes were applied to the PR (nothing to commit after review). The notes below are advisory and were not pushed.

Reviewed PR #205 against the checked-out diff and traced the Relay MCP harness changes through runtime spec construction and related tests. I did not find a current breakage that required code edits.

Verification completed:

  • corepack pnpm install
  • corepack pnpm --filter @agentworkforce/persona-kit build
  • corepack pnpm --filter @agentworkforce/deploy build
  • corepack pnpm --filter @agentworkforce/workload-router build
  • corepack pnpm --filter @agentworkforce/runtime test
  • corepack pnpm --filter @agentworkforce/runtime typecheck
  • Equivalent full check via Corepack: corepack pnpm -r lint && corepack pnpm -r typecheck && corepack pnpm run typecheck:examples && corepack pnpm -r test

Note: corepack pnpm run check itself failed in this sandbox because the package script shells out to bare pnpm, which is not on PATH here. The equivalent Corepack-expanded lint/typecheck/test sequence passed.

@agent-relay-code
Copy link
Copy Markdown
Contributor

Fixed validated issues in PR #205:

  • Redacted Relay API key from broker failure stderr logs, addressing the issue identified by cubic.
  • Stopped forcing default --base-url into broker args when RELAY_BASE_URL is unset.
  • Excluded the rendered Codex prompt from broker --existing-args.
  • Treated empty broker args responses as invalid so fallback Relay MCP wiring runs.
  • Removed regenerated memory/workspace/.relay/state.json.
  • Added regression coverage for all of the above in packages/runtime/src/runner.test.ts.

Validation run locally:

  • corepack pnpm --filter @agentworkforce/persona-kit build
  • corepack pnpm --filter @agentworkforce/runtime test
  • corepack pnpm --filter @agentworkforce/persona-kit test
  • corepack pnpm --filter @agentworkforce/runtime typecheck
  • corepack pnpm -r build
  • corepack pnpm -r lint && corepack pnpm -r typecheck && corepack pnpm run typecheck:examples && corepack pnpm -r test

@agent-relay-code
Copy link
Copy Markdown
Contributor

pr-reviewer applied fixes — committed and pushed f717b15 to this PR. The notes below describe what changed.

Fixed validated issues in PR #205:

  • Redacted Relay API key from broker failure stderr logs, addressing the issue identified by cubic.
  • Stopped forcing default --base-url into broker args when RELAY_BASE_URL is unset.
  • Excluded the rendered Codex prompt from broker --existing-args.
  • Treated empty broker args responses as invalid so fallback Relay MCP wiring runs.
  • Removed regenerated memory/workspace/.relay/state.json.
  • Added regression coverage for all of the above in packages/runtime/src/runner.test.ts.

Validation run locally:

  • corepack pnpm --filter @agentworkforce/persona-kit build
  • corepack pnpm --filter @agentworkforce/runtime test
  • corepack pnpm --filter @agentworkforce/persona-kit test
  • corepack pnpm --filter @agentworkforce/runtime typecheck
  • corepack pnpm -r build
  • corepack pnpm -r lint && corepack pnpm -r typecheck && corepack pnpm run typecheck:examples && corepack pnpm -r test

@agent-relay-code
Copy link
Copy Markdown
Contributor

Reviewed PR #205 against .workforce/pr.diff, changed files, and the current checkout. I did not find a reproducible defect or stale bot-review issue requiring code edits.

Local verification run:

  • Built required workspace deps: @agentworkforce/persona-kit, @agentworkforce/deploy, @agentworkforce/workload-router
  • corepack pnpm --filter @agentworkforce/runtime test passed
  • corepack pnpm -r lint passed
  • corepack pnpm -r typecheck passed
  • corepack pnpm -r test passed

Note: the root pnpm run check wrapper could not run directly because this sandbox exposes pnpm only through corepack pnpm, and the script shells out to pnpm. I ran the equivalent lint, typecheck, and test phases directly.

@agent-relay-code
Copy link
Copy Markdown
Contributor

ℹ️ pr-reviewer: review only — no file changes were applied to the PR (nothing to commit after review). The notes below are advisory and were not pushed.

Reviewed PR #205 against .workforce/pr.diff, changed files, and the current checkout. I did not find a reproducible defect or stale bot-review issue requiring code edits.

Local verification run:

  • Built required workspace deps: @agentworkforce/persona-kit, @agentworkforce/deploy, @agentworkforce/workload-router
  • corepack pnpm --filter @agentworkforce/runtime test passed
  • corepack pnpm -r lint passed
  • corepack pnpm -r typecheck passed
  • corepack pnpm -r test passed

Note: the root pnpm run check wrapper could not run directly because this sandbox exposes pnpm only through corepack pnpm, and the script shells out to pnpm. I ran the equivalent lint, typecheck, and test phases directly.

@agent-relay-code
Copy link
Copy Markdown
Contributor

Reviewed PR #205 against .workforce/pr.diff, changed files, and surrounding runtime/persona-kit call paths. I did not find a current breakage or stale bot finding that required a code edit.

Local verification completed:

  • corepack pnpm --filter @agentworkforce/runtime test
  • corepack pnpm --filter @agentworkforce/persona-kit test
  • CI-equivalent phases run directly due missing pnpm shim: corepack pnpm -r lint, corepack pnpm -r typecheck, corepack pnpm run typecheck:examples, corepack pnpm -r test

Note: corepack pnpm check itself could not run because the nested npm scripts invoke pnpm directly and this sandbox cannot install the global Corepack shim, so I ran the same phases directly via corepack pnpm.

@agent-relay-code
Copy link
Copy Markdown
Contributor

ℹ️ pr-reviewer: review only — no file changes were applied to the PR (nothing to commit after review). The notes below are advisory and were not pushed.

Reviewed PR #205 against .workforce/pr.diff, changed files, and surrounding runtime/persona-kit call paths. I did not find a current breakage or stale bot finding that required a code edit.

Local verification completed:

  • corepack pnpm --filter @agentworkforce/runtime test
  • corepack pnpm --filter @agentworkforce/persona-kit test
  • CI-equivalent phases run directly due missing pnpm shim: corepack pnpm -r lint, corepack pnpm -r typecheck, corepack pnpm run typecheck:examples, corepack pnpm -r test

Note: corepack pnpm check itself could not run because the nested npm scripts invoke pnpm directly and this sandbox cannot install the global Corepack shim, so I ran the same phases directly via corepack pnpm.

@agent-relay-code
Copy link
Copy Markdown
Contributor

pr-reviewer could not complete review for #205 in AgentWorkforce/workforce.
The review harness exited with code 1.
No review was posted; this needs operator attention.

@agent-relay-code
Copy link
Copy Markdown
Contributor

ℹ️ pr-reviewer: review only — no file changes were applied to the PR (nothing to commit after review). The notes below are advisory and were not pushed.

pr-reviewer could not complete review for #205 in AgentWorkforce/workforce.
The review harness exited with code 1.
No review was posted; this needs operator attention.

@khaliqgant khaliqgant merged commit 9a9b104 into main Jun 6, 2026
3 checks passed
@khaliqgant khaliqgant deleted the fix/codex-relay-mcp-cloud-personas branch June 6, 2026 08:40
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