Repository navigation
fix: keep isolated gateway workspaces and skills inside state dir - #114487
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 28, 2026, 8:09 AM ET / 12:09 UTC. ClawSweeper reviewWhat this changesThe PR makes non-default OpenClaw state directories use a state-owned implicit workspace and prevents core and Codex-native skill discovery from inheriting the operator-home personal skill directories. Merge readiness⛔ Blocked until real behavior proof from a real setup is added - 7 items remain Keep this PR open for protected maintainer review: the proposed isolation boundary is coherent and focused, but the current branch still lacks directly inspectable after-fix gateway evidence and needs a fresh compatibility review after rebasing onto current Priority: P2 Review scores
Verification
How this fits togetherNon-interactive onboarding writes an initial agent workspace into configuration, then the core and Codex app-server skill loaders assemble skills for that agent. This change uses the selected state directory to decide whether home-scoped personal skills remain eligible, affecting isolated gateway sessions and their persisted thread bindings. flowchart LR
A[Gateway onboarding] --> B[State directory choice]
B --> C[Initial agent workspace]
B --> D[Skill root policy]
D --> E[Core skill loader]
D --> F[Codex app-server]
C --> G[Agent session]
E --> G
F --> G
Decision needed
Why: The change deliberately alters discovery for existing non-default state-directory deployments and crosses the Codex app-server boundary; tests support the direction, but the persistent compatibility contract needs a maintainer-confirmed final review. Before merge
Agent review detailsSecurityNone. PR surfaceSource +408, Tests +497, Docs +6. Total +911 across 22 files. View PR surface stats
Review metricsNone. Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Rebase onto current Do we have a high-confidence way to reproduce the issue? No high-confidence independently reproduced path is available in this review: the source and added tests describe the state-directory leak, but there is no inspectable current-head live gateway transcript showing the before/after result. Is this the best way to solve the issue? Unclear: state-root isolation is the right owner boundary if the current Codex app-server contract supports it, but a rebased live proof and direct dependency-contract check are needed before calling this the best durable fix. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against bb634261cb9f. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
f334ab8 to
1065e34
Compare
1065e34 to
cbdcafd
Compare
|
Maintainer landing disposition for exact head
The fresh exact-head ClawSweeper run 30380776255 remained in its |
|
Merged via squash.
|
…224005-host * origin/main: (72 commits) fix: macOS-only Parallels smoke harness regression (#75293) fix(ios): use configured speech language for system voice (#113372) refactor: centralize isolated agent test ownership (#115340) test(ui): stabilize browser route readiness (#115320) fix(cron): clear automation after failed scheduler shutdown (#115316) fix: keep isolated gateway workspaces and skills inside state dir (#114487) docs: document local TTS on macOS, Linux, and Windows (#110230) fix(tasks): clone only the requested task page (#114277) fix(agents): prevent Code Mode resume loss and unbounded preparation (#115314) fix(process): preserve the first process cancellation reason (#115317) fix(nostr): report unavailable ingress when queue open fails (#115313) fix: prevent Slack and Feishu ingress startup leaks (#115295) fix(slack): avoid unsafe emphasis boundaries (#111575) fix: prevent changed checks from expanding into full lint (#115322) fix(codex): stabilize prompts and expose real cache regressions (#115238) refactor(ui): derive page route specs from the route table (#115214) fix(compaction): plan cut points in trigger units (#111886) (#115309) fix: prevent cron and gateway stress-run timeouts (#115241) fix(ci): validate frozen Matrix QA targets (#115298) test(macos): block real process fallthrough (#113337) ... # Conflicts: # CHANGELOG.md
…enclaw#114487) * fix: isolate non-default state workspaces and skills * fix(codex): isolate native personal skills * chore: refresh plugin SDK API manifest * fix: keep SDK manifest generation scoped * refactor(codex): keep isolation plugin-local * test: satisfy optional skill snapshot typing * refactor(codex): extract thread lifecycle preflight
…afea23-host * origin/main: (72 commits) fix: macOS-only Parallels smoke harness regression (openclaw#75293) fix(ios): use configured speech language for system voice (openclaw#113372) refactor: centralize isolated agent test ownership (openclaw#115340) test(ui): stabilize browser route readiness (openclaw#115320) fix(cron): clear automation after failed scheduler shutdown (openclaw#115316) fix: keep isolated gateway workspaces and skills inside state dir (openclaw#114487) docs: document local TTS on macOS, Linux, and Windows (openclaw#110230) fix(tasks): clone only the requested task page (openclaw#114277) fix(agents): prevent Code Mode resume loss and unbounded preparation (openclaw#115314) fix(process): preserve the first process cancellation reason (openclaw#115317) fix(nostr): report unavailable ingress when queue open fails (openclaw#115313) fix: prevent Slack and Feishu ingress startup leaks (openclaw#115295) fix(slack): avoid unsafe emphasis boundaries (openclaw#111575) fix: prevent changed checks from expanding into full lint (openclaw#115322) fix(codex): stabilize prompts and expose real cache regressions (openclaw#115238) refactor(ui): derive page route specs from the route table (openclaw#115214) fix(compaction): plan cut points in trigger units (openclaw#111886) (openclaw#115309) fix: prevent cron and gateway stress-run timeouts (openclaw#115241) fix(ci): validate frozen Matrix QA targets (openclaw#115298) test(macos): block real process fallthrough (openclaw#113337) ... # Conflicts: # CHANGELOG.md
What Problem This Solves
Fixes two isolation leaks for gateways using a non-default
OPENCLAW_STATE_DIR.The first live repro used
openclaw onboard --non-interactivewith a scratch state directory. Onboarding still persisted the operator-home workspace in bothagents.defaults.workspaceand the initialagents.entries.main.workspace; the per-agent value then won during agent resolution, so writes such as Skill Workshop apply targets escaped into the real home workspace.The second live repro started a scratch gateway and observed 91 home-scoped personal Claude-compatible skills in the isolated agent. A non-default state directory should not inherit personal skill roots from the operator's home.
Why This Change Was Made
Non-interactive onboarding now derives its implicit workspace as
<state-dir>/workspaceonly when the effective state directory is non-default. Explicit--workspace, existing config, and nonblankOPENCLAW_WORKSPACE_DIRkeep their existing precedence, and the default-state output remains unchanged.The normal skill loader, embedded session resource manager, and skill watcher now include the home-scoped personal-agent root only for the default state directory. Workspace, project, bundled, configured extra, plugin, and state-owned managed skill roots remain available. No config keys, channel/agent routing behavior, or Skill Workshop service/store code changed.
User Impact
Scratch, test, profile, and multi-instance gateways can onboard and load skills without reading from or writing into the operator's default OpenClaw workspace and personal skill roots. Standard installs using the default state directory retain their existing workspace and personal-skill behavior.
Evidence
node scripts/run-vitest.mjs src/config/paths.test.ts src/commands/onboard-non-interactive/local/workspace.test.ts src/commands/onboard-non-interactive.gateway.test.ts src/skills/loading/agents-directory.test.ts src/skills/runtime/refresh.test.ts src/agents/sessions/package-manager.test.tsnode scripts/check-changed.mjs -- <14 changed files>tbx_01kyhdzp23q5wd4fsfzgw0b3kpexitCode: 0