Skip to content

feat(openshell): support control-plane workspace selection - #114952

Merged
sallyom merged 1 commit into
openclaw:mainfrom
sallyom:codex/openshell-workspaces
Jul 28, 2026
Merged

sallyom merged 1 commit into
openclaw:mainfrom
sallyom:codex/openshell-workspaces

Conversation

@sallyom

@sallyom sallyom commented Jul 28, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

OpenShell now supports control-plane Workspaces, but the OpenClaw sandbox plugin could only use the OpenShell CLI's ambient or default Workspace. Users could not explicitly place OpenClaw-managed sandboxes, providers, policies, and inference routes in an existing non-default OpenShell Workspace.

Why This Change Was Made

This adds a validated plugins.entries.openshell.config.workspace setting. When configured, the plugin passes --workspace <name> to every OpenShell CLI operation. OpenShell v0.0.88 and newer serialize that selection into the generated SSH host alias and ssh-proxy --workspace <name> route, so lifecycle calls, command execution, and transfers resolve the same Workspace.

When the setting is omitted, OpenClaw passes no new flag or environment override. Existing installations therefore retain their ambient OPENSHELL_WORKSPACE behavior, including OpenShell's default fallback when no ambient selection exists.

The change keeps OpenShell's control-plane Workspace separate from OpenClaw's existing mirror/remote filesystem workspace modes. It does not create Workspaces, manage membership, migrate existing sandboxes, or add per-agent/per-session selection.

AI-assisted implementation; I reviewed the resulting code and behavior.

User Impact

Users can explicitly run OpenClaw sandboxes in an existing non-default OpenShell Workspace. Existing configurations are unchanged. Configuring workspace, including explicitly selecting default, requires OpenShell v0.0.88 or newer.

Evidence

  • Rebased onto current main.
  • Homebrew OpenShell 0.0.92 with a local Podman-backed gateway at https://127.0.0.1:17670 using mTLS.
  • Confirmed default and openclaw-test were active, then configured the plugin with workspace: "openclaw-test".
  • Built the exact PR source into a local Podman OpenClaw runtime and ran a live Codex OAuth turn with openai/gpt-5.5. Structured output reported agentHarnessId: "codex", authMode: "auth-profile", and no model fallback.
  • The live turn executed in the OpenShell sandbox and read back its marker:
sandbox-oc-dd4c3a6956c1e9d6
/sandbox
WORKSPACE_ROUTE_OK
  • OpenShell listed the sandbox only in the configured Workspace:
{
  "name": "oc-dd4c3a6956c1e9d6",
  "phase": "Ready",
  "workspace": "openclaw-test"
}

The same sandbox list command returned [] for --workspace default.

  • The generated SSH route retained the configured Workspace:
Host openshell-oc-dd4c3a6956c1e9d6.openclaw-test
ProxyCommand /opt/homebrew/bin/openshell ssh-proxy --gateway-name openshell --name oc-dd4c3a6956c1e9d6 --workspace openclaw-test
  • A subsequent OpenShell download through --workspace openclaw-test returned /sandbox/workspace-route-proof.txt with exact contents WORKSPACE_ROUTE_OK.

UI screenshot:
Screenshot 2026-07-28 at 2 26 34 PM

  • Focused Testbox proof:
Test Files  2 passed (2)
Tests       57 passed (57)
  • node scripts/check-changed.mjs passed on Blacksmith Testbox (run), including formatting, config/env ratchets, plugin boundaries, extension production/test typechecks, extension lint, database-first guards, and runtime import-cycle checks.
  • git diff --check passed.
  • Autoreview: clean, no accepted/actionable findings; overall correctness patch is correct with confidence 0.94.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime extensions: openshell size: S maintainer Maintainer-authored PR labels Jul 28, 2026
@sallyom
sallyom marked this pull request as ready for review July 28, 2026 05:31
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. labels Jul 28, 2026
@clawsweeper

clawsweeper Bot commented Jul 28, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 28, 2026, 10:26 AM ET / 14:26 UTC.

ClawSweeper review

What this changes

Adds an optional plugins.entries.openshell.config.workspace setting that sends a selected OpenShell control-plane workspace to sandbox CLI operations, documents the distinction from filesystem workspace modes, and adds regression coverage for ambient and SSH-proxy routing behavior.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

Keep this PR open for maintainer review. The re-review patch resolves the two prior blockers: the optional setting preserves ambient OpenShell workspace selection when absent, and the SSH configuration test now proves that a workspace-qualified proxy route survives endpoint augmentation; the contributor also supplied detailed after-fix live proof. Because this adds a compatibility-sensitive plugin configuration surface and the PR carries the protected maintainer label, a maintainer should make the final product and minimum-version decision rather than this workflow closing or merging it.

Priority: P2
Reviewed head: 08637816ab520220ef0ef42ac2dcceb6213b043b
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The corrected patch is focused, covers both prior regressions, and is backed by concrete live behavior output, with the remaining minimum-version decision and failed CI job requiring maintainer attention.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The PR body now provides detailed after-fix live OpenShell evidence for a non-default workspace, including sandbox placement, the generated SSH proxy route, execution, and download readback; redact private endpoints and credentials if adding any further artifacts.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The PR body now provides detailed after-fix live OpenShell evidence for a non-default workspace, including sandbox placement, the generated SSH proxy route, execution, and download readback; redact private endpoints and credentials if adding any further artifacts.
Evidence reviewed 7 items Optional configuration preserves existing behavior: The branch makes workspace optional and only appends --workspace when a configured value exists, so omitted configuration leaves the inherited OpenShell CLI environment untouched.
Ambient-workspace regression coverage: The added test sets OPENSHELL_WORKSPACE=ambient with no plugin workspace and expects the invoked command to receive only sandbox get demo, proving the plugin does not replace the ambient selection with a flag or override.
SSH-route regression coverage: The updated SSH configuration test uses an OpenShell-generated ssh-proxy --workspace research command and asserts endpoint augmentation retains that workspace-qualified proxy route.
Findings None None.
Security None None.

How this fits together

The bundled OpenShell plugin turns OpenClaw sandbox requests into OpenShell CLI lifecycle, execution, transfer, and SSH-connection operations. This setting is parsed from plugin configuration, added to the shared CLI argument prefix only when configured, and then carried by OpenShell into the generated SSH proxy route.

flowchart LR
  A[Plugin configuration] --> B[Workspace validation]
  B --> C[Shared OpenShell CLI arguments]
  C --> D[Sandbox lifecycle and transfers]
  D --> E[Generated SSH configuration]
  E --> F[Sandbox command execution]
  G[Ambient OpenShell workspace] --> C
Loading

Decision needed

Question Recommendation
Should OpenClaw rely on the documented OpenShell v0.0.88 minimum for this opt-in setting, or require a runtime version check before allowing plugins.entries.openshell.config.workspace? Documented minimum version: Merge the current opt-in setting with its documented v0.0.88 prerequisite and retain the existing behavior for users who do not configure it.

Why: Both choices are viable, but they define the permanent operator experience for a plugin configuration that otherwise causes all OpenShell operations to fail on older installed CLIs.

Before merge

  • Resolve merge risk (P1) - Configuring workspace with an OpenShell version older than v0.0.88 will make lifecycle calls fail because that CLI does not support the forwarded flag; the PR documents the prerequisite but does not provide a runtime version preflight.
  • Resolve merge risk (P1) - The PR’s current required CI summary is failing in checks-node-compact-large-4; resolve or re-run that job against the reviewed head before merge, even though the supplied focused Testbox proof and changed-gate evidence are positive.
Agent review details

Security

None.

PR surface

Source +28, Tests +41, Docs +36. Total +105 across 7 files.

View PR surface stats
Area Files Added Removed Net
Source 3 28 0 +28
Tests 2 45 4 +41
Docs 2 38 2 +36
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 7 111 6 +105

Review metrics

Metric Value Why it matters
Plugin configuration surface 1 optional setting added The new setting changes the bundled plugin’s public configuration contract and has a documented external CLI-version dependency.

Stored data model

Persistent data-model change detected: serialized state: extensions/openshell/src/openshell-core.test.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Confirm the minimum-version contract (recommended)
    Keep the current opt-in configuration only if the OpenShell owner accepts documentation as the upgrade boundary for v0.0.88-or-newer CLI support.
  2. Fail early on unsupported OpenShell
    Add a focused version preflight and regression test so an old CLI yields an actionable diagnostic rather than failing later sandbox operations.

Technical review

Best possible solution:

Accept the opt-in workspace setting only after an OpenShell/OpenClaw owner confirms that documented minimum-version support is sufficient or asks for a narrow actionable preflight, then merge with the exact-head CI failure understood and resolved.

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

Not applicable: this PR adds an opt-in capability rather than repairing an established failing behavior. The contributor nevertheless supplied a detailed exact-head live validation path for the new behavior.

Is this the best way to solve the issue?

Unclear pending owner intent: the shared CLI argument path is the narrowest implementation and the re-review tests cover the earlier regressions, but maintainers must choose whether documentation alone is an adequate unsupported-version boundary.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 9feb6ad16187.

Labels

Label justifications:

  • P2: This is a bounded, opt-in OpenShell plugin capability with a concrete operator impact but no demonstrated urgent regression.
  • merge-risk: 🚨 compatibility: The PR adds a public plugin configuration key whose behavior depends on the installed OpenShell CLI version.
  • merge-risk: 🚨 availability: Using the new key with an OpenShell CLI older than v0.0.88 can prevent the plugin’s workspace-qualified operations from starting.
  • 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 (live_output): The PR body now provides detailed after-fix live OpenShell evidence for a non-default workspace, including sandbox placement, the generated SSH proxy route, execution, and download readback; redact private endpoints and credentials if adding any further artifacts.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body now provides detailed after-fix live OpenShell evidence for a non-default workspace, including sandbox placement, the generated SSH proxy route, execution, and download readback; redact private endpoints and credentials if adding any further artifacts.

Evidence

What I checked:

  • Optional configuration preserves existing behavior: The branch makes workspace optional and only appends --workspace when a configured value exists, so omitted configuration leaves the inherited OpenShell CLI environment untouched. (extensions/openshell/src/cli.ts:26, 08637816ab52)
  • Ambient-workspace regression coverage: The added test sets OPENSHELL_WORKSPACE=ambient with no plugin workspace and expects the invoked command to receive only sandbox get demo, proving the plugin does not replace the ambient selection with a flag or override. (extensions/openshell/src/openshell-core.test.ts:181, 08637816ab52)
  • SSH-route regression coverage: The updated SSH configuration test uses an OpenShell-generated ssh-proxy --workspace research command and asserts endpoint augmentation retains that workspace-qualified proxy route. (extensions/openshell/src/openshell-core.test.ts:205, 08637816ab52)
  • Validated and documented public setting: The plugin manifest, runtime schema, extension README, and gateway documentation consistently describe the new optional control-plane workspace and state the OpenShell v0.0.88 minimum when it is configured. (extensions/openshell/openclaw.plugin.json:25, 08637816ab52)
  • Upstream CLI contract: OpenShell’s CLI declares --workspace as a global option, defaults it from OPENSHELL_WORKSPACE or default, and makes the selected workspace available to subcommands; this supports forwarding the option through the plugin’s shared argument builder.
  • After-fix real behavior proof: The PR body reports an exact-head live Podman/OpenShell run with a non-default workspace, a sandbox visible only in that workspace, a generated workspace-qualified SSH proxy command, successful sandbox execution, and a workspace-qualified download that read back the expected marker. (08637816ab52)

Likely related people:

  • sallyom: Authored the current branch commit and supplied the detailed OpenShell v0.0.92 validation evidence for this exact configuration and routing path; current-main ownership history could not be established from the read-only shell in this review. (role: proposed implementation author and live-proof provider; confidence: low; commits: 08637816ab52; files: extensions/openshell/src/cli.ts, extensions/openshell/src/config.ts, extensions/openshell/src/openshell-core.test.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Confirm the unsupported-OpenShell-version policy for the new opt-in setting.
  • Resolve or re-run checks-node-compact-large-4 on the current head before merge.

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 (1 earlier review cycle)
  • reviewed 2026-07-28T05:35:58.788Z sha e81319331c0af1213966226e0e527964d1942fd6 :: needs real behavior proof before merge. :: [P1] Carry the workspace into SSH proxy execution | [P1] Preserve existing ambient workspace upgrades

@sallyom sallyom self-assigned this Jul 28, 2026
@sallyom
sallyom force-pushed the codex/openshell-workspaces branch from e813193 to 0863781 Compare July 28, 2026 13:43
@sallyom

sallyom commented Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

Addressed both findings in 08637816ab:

  • Omitted workspace now preserves the existing ambient OPENSHELL_WORKSPACE behavior; only an explicitly configured value adds --workspace.
  • OpenShell v0.0.88+ already serializes the selected Workspace into the generated SSH host alias and ssh-proxy --workspace command. Added regression coverage that OpenClaw's endpoint augmentation preserves that route.
  • Updated the PR body with exact-source live proof showing the sandbox only in openclaw-test, the workspace-qualified ProxyCommand, successful Codex exec, and successful file download through the same Workspace.
  • Focused tests: 57 passed. Changed gate and autoreview are clean.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Command router queued. I will update this comment with the next step.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jul 28, 2026
@sallyom

sallyom commented Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

wrt last P1, no fix necessary:

  • workspace is new and opt-in. Existing configurations do not pass --workspace, so backward compatibility is preserved.

  • The v0.0.88 prerequisite is documented at docs/gateway/openshell.md:25.

  • OpenShell v0.0.87 has no workspace flag; v0.0.88 adds it globally. An older CLI therefore rejects the argument before performing a
    lifecycle mutation.

  • The plugin preserves stderr, so users receive OpenShell’s unsupported-argument error through extensions/openshell/src/backend.ts:762.

  • A preflight adds another process invocation and fragile version parsing, particularly with custom command wrappers or development builds. It would improve wording, not compatibility.

  • Silently omitting the flag would be worse because it could operate in the wrong workspace.

No code changes made; the worktree remains clean.

@sallyom

sallyom commented Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

Ready for merge at 08637816ab52. Clean review and green CI. This is the best narrow fix for updating the OpenShell plugin to support OpenShell Workspaces while preserving existing behavior when no workspace is configured.

@sallyom
sallyom merged commit 8799a97 into openclaw:main Jul 28, 2026
193 of 203 checks passed
@sallyom

sallyom commented Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

@sallyom
sallyom deleted the codex/openshell-workspaces branch July 28, 2026 18:53
vincentkoc added a commit to christian-lallo/openclaw that referenced this pull request Jul 28, 2026
* origin/main: (61 commits)
  perf(ui): debounce event-driven session list refreshes and right-size child paging (openclaw#115374)
  feat(talk): support GPT-Live realtime voice over ChatGPT OAuth (openclaw#115226)
  feat(system-agent): guide gateway configuration in Ask OpenClaw (openclaw#115363)
  fix(agents): make overflow recovery append-only via branch-and-reappend (openclaw#115271) (openclaw#115310)
  fix(macos): bound websocket ping so a dropped pong cannot orphan its continuation (openclaw#115362)
  fix(codex): isolate native hook relay startup (openclaw#115078)
  fix(ci): stop reviving superseded pull request workflows (openclaw#115378)
  feat(openshell): add workspace selection (openclaw#114952)
  fix(skills): persist workshop apply reason; correct Skill Workshop docs (openclaw#114471)
  fix: agent stops replying when a session transcript has no header row (openclaw#115080)
  perf(usage): stale-while-revalidate caches for usage.status and sessions.usage (openclaw#115369)
  fix(discord): reject invalid UTF-8 probe responses (openclaw#111734)
  feat(gateway): add memory.search operator method (openclaw#115346)
  fix(android): keep welcome action reachable with large text (openclaw#111747)
  fix(gateway): validate doctor memory agent ids (openclaw#115365)
  refactor: harden shell completion and shard Control UI E2E (openclaw#115332)
  fix(ui): anchor the thread branches menu to its trigger button (openclaw#115352)
  perf(sessions): incremental snapshot revalidation and shallow list projections (openclaw#115359)
  refactor(sessions): consolidate entry state (openclaw#115299)
  feat(ui): swap three plain Lobsterdex palettes for balloon, ascii, and portal (openclaw#115308)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation extensions: openshell gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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