Skip to content

feat(ocm): support cross-user command and config transport - #125

Merged
vincentkoc merged 2 commits into
mainfrom
fix/performance-ocm-command-transport
Sep 11, 2026
Merged

vincentkoc merged 2 commits into
mainfrom
fix/performance-ocm-command-transport

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Sep 10, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Cross-user OCM execution must not fall back to evaluator credentials or import
candidate code under evaluator authority.

Why This Change Was Made

The base provides structured KOVA_OCM_TRANSPORT_JSON invocation with prefix,
binary, env and optional cwd, applied after the identity switch.
Credential discovery reads only bounded candidate-side configuration, with no
evaluator-side fallback. Transport mode rejects candidate imports before
execution while preserving native precedence.

Base-only cross-user scenarios still reject before planning or side effects
until collection integration is present.

User Impact

Unset transport preserves native behavior. Collection remains a separate unit:
#123, using bounded export from
openclaw/ocm#171.
The consumer is openclaw/openclaw#127240.

Evidence

  • Signed head: 22e692d7360fc301656be0d6c37cb750ebc1b92c.
  • Boundary proof: 16 intended red failures, then 31 green cases.
  • Selfcheck and assert-output passed; CPU accounting: 26 passed,
    9 Linux-only skips.
  • Scoped review: zero P0-P2 findings.
  • Exact-head CI
    passed Ubuntu/macOS checks and install smoke. Joint Linux cross-UID, sudo cleanup and
    cloud proof remain unrun; no previous-head CI result is claimed.

Punchcard-Session: coral-orchard-orchard-d4

Route direct and nested OCM calls through structured argv with explicit
candidate cwd and environment. Keep fixed state writers and bounded config
reads behind the same transport while preserving native operation.

Block configured scenario execution before provisioning until the dependent
diagnostic collection unit is present. This foundation does not yet provide
isolated benchmark execution.

Punchcard-Session: coral-orchard-orchard-d4
@clawsweeper

clawsweeper Bot commented Sep 10, 2026 •

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper

clawsweeper Bot commented Sep 10, 2026 •

Copy link
Copy Markdown

Codex review: needs maintainer review before merge. Reviewed September 10, 2026, 3:29 PM ET / 19:29 UTC (Revision 5).

ClawSweeper review

What this changes

Adds configurable cross-user OCM command execution and bounded configuration reads, isolates candidate credentials and runtime imports, and blocks scenarios pending diagnostic collection integration.

Merge readiness

✅ Ready for maintainer review

This remains useful work absent from main and v0.1.5. Both earlier security findings are addressed, and no remaining blocking defect was identified within the deliberately limited transport scope.

Priority: P2
Reviewed head: 22e692d7360fc301656be0d6c37cb750ebc1b92c

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused transport foundation with resolved prior findings, meaningful boundary coverage and clearly stated integration limits.
Proof confidence 🐚 platinum hermit (4/6) ✨ media proof bonus Sufficient (linked_artifact): The reported passing boundary run exercises production HTTP/WebSocket clients and import entrypoints, checking candidate-only credentials, rejection before connections, and absent import canaries. This supports the credential/import boundary; fixture OCM and identity switching do not prove complete cross-UID isolation, which this foundation explicitly leaves disabled.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (linked_artifact): The reported passing boundary run exercises production HTTP/WebSocket clients and import entrypoints, checking candidate-only credentials, rejection before connections, and absent import canaries. This supports the credential/import boundary; fixture OCM and identity switching do not prove complete cross-UID isolation, which this foundation explicitly leaves disabled.
Evidence reviewed 11 items Applicable repository policy: Read the complete root AGENTS.md. Its distinction between OpenClaw product behavior and OCM harness infrastructure informed the review; no applicable nested policy or maintainer-notes directory was found.
Introduced scope and merge identity: Reviewed all 21 introduced files using the pinned merge-base comparison. Raw test-merge parent records match the supplied main and PR head, and its comparison retains the main-only CPU accounting files.
Still necessary on main and latest release: The OCM directory on pinned main and v0.1.5 contains commands and missing-resource helpers but no transport implementation. Main's Gateway credential reader still reads local configuration and permits ambient credentials; the proposed transport behavior remains distinct.
Findings None None.
Security None None.

How this fits together

Kova validates OpenClaw runtimes using OCM to manage environments and execute commands. This transport carries operator-selected commands into a candidate user's environment and returns bounded configuration data to Kova's Gateway clients.

flowchart TD
  A[Operator transport configuration] --> B[Kova command dispatcher]
  B --> C[Identity switch and clean environment]
  C --> D[Candidate OCM]
  D --> E[Bounded configuration export]
  E --> F[Gateway client with candidate credentials]
  A --> G[Scenario admission gate]
  G --> H[Reject until collection integration]
Loading

Before merge

None.

Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Production and test growth Production +271/-27; tests +532/-0 Production growth implements the stated transport boundary, with substantial coverage for credential handling, import rejection and native compatibility.

Technical review

Best possible solution:

Retain the opt-in transport and early scenario guard, with full isolated execution enabled only by the separately validated collection and outer-runner layers.

Do we have a high-confidence way to reproduce the issue?

Not applicable as an existing-behavior bug: this adds an opt-in transport mode. The prior credential and import defects have focused production-entrypoint regression coverage.

Is this the best way to solve the issue?

Yes, for this foundation: centralized argv transport and bounded candidate-side reads avoid competing execution paths, while native credential precedence and the scenario admission guard preserve the stated scope.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 1ec7a50e2bbf.

Labels

Label justifications:

  • P2: This is a bounded, opt-in validation-harness improvement with no demonstrated urgent regression in existing usage.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (linked_artifact): The reported passing boundary run exercises production HTTP/WebSocket clients and import entrypoints, checking candidate-only credentials, rejection before connections, and absent import canaries. This supports the credential/import boundary; fixture OCM and identity switching do not prove complete cross-UID isolation, which this foundation explicitly leaves disabled.
  • proof: sufficient: Contributor real behavior proof is sufficient. The reported passing boundary run exercises production HTTP/WebSocket clients and import entrypoints, checking candidate-only credentials, rejection before connections, and absent import canaries. This supports the credential/import boundary; fixture OCM and identity switching do not prove complete cross-UID isolation, which this foundation explicitly leaves disabled.

Evidence

What I checked:

  • Applicable repository policy: Read the complete root AGENTS.md. Its distinction between OpenClaw product behavior and OCM harness infrastructure informed the review; no applicable nested policy or maintainer-notes directory was found. (AGENTS.md:1, 22e692d7360f)
  • Introduced scope and merge identity: Reviewed all 21 introduced files using the pinned merge-base comparison. Raw test-merge parent records match the supplied main and PR head, and its comparison retains the main-only CPU accounting files. (5f99442a5612)
  • Still necessary on main and latest release: The OCM directory on pinned main and v0.1.5 contains commands and missing-resource helpers but no transport implementation. Main's Gateway credential reader still reads local configuration and permits ambient credentials; the proposed transport behavior remains distinct. (support/openclaw-runtime.mjs:324, 1ec7a50e2bbf)
  • Earlier findings resolved: Transported RPC configuration returns candidate credentials before the native fallback path. HTTP and adversarial helpers also exclude evaluator credentials. Both channel import entrypoints reject transport mode before candidate imports, including continue-on-failure invocation. (support/openclaw-runtime.mjs:331, 22e692d7360f)
  • Boundary proof and its scope: The captured body reports 16 intended red failures followed by 31 passing boundary cases. The fully read harness invokes production RPC, HTTP and adversarial entrypoints with real socket clients; invalid exported configuration must cause zero connections, valid requests carry only candidate tokens, and import canaries remain absent in transport mode. OCM and identity switching are fixtures, so this establishes credential/import boundaries rather than Linux cross-UID isolation. (tests/ocm-runtime-boundaries.mjs:70, 22e692d7360f)
  • Exact-head validation identity: GitHub confirms the linked Ubuntu/macOS CI run succeeded for the pinned head. Raw log retrieval was blocked at the artifact-storage host, so those logs were not independently reread; this reviewer limitation does not invalidate the captured boundary results. No target code or tests were executed during this review. (22e692d7360f)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (4 earlier review cycles)
  • reviewed 2026-09-10T15:03:44.338Z sha c0b4006 :: needs real behavior proof before merge. :: [P1] Reject ambient Gateway credentials in cross-user RPC | [P1] Guard standalone consumers of candidate runtime paths
  • reviewed 2026-09-10T15:18:43.110Z sha c0b4006 :: needs real behavior proof before merge. :: [P1] Reject ambient Gateway credentials in cross-user RPC | [P1] Guard standalone consumers of candidate runtime paths
  • reviewed 2026-09-10T18:49:52.236Z sha 22e692d :: blocked before merge. :: none
  • reviewed 2026-09-10T19:02:51.812Z sha 22e692d :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added P2 Normal priority bug or improvement with limited blast radius. merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 10, 2026
Punchcard-Session: coral-orchard-orchard-d4
@vincentkoc
vincentkoc marked this pull request as ready for review September 10, 2026 19:00
@vincentkoc
vincentkoc requested a review from a team as a code owner September 10, 2026 19:00
@clawsweeper clawsweeper Bot added proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. labels Sep 10, 2026
@vincentkoc
vincentkoc merged commit f3bcd53 into main Sep 11, 2026
14 checks passed
@vincentkoc
vincentkoc deleted the fix/performance-ocm-command-transport branch September 11, 2026 09:22
@vincentkoc
vincentkoc restored the fix/performance-ocm-command-transport branch September 11, 2026 09:23
@vincentkoc
vincentkoc deleted the fix/performance-ocm-command-transport branch September 25, 2026 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal priority bug or improvement with limited blast radius. proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant