feat(openclaw): normalize host paths for split-root workspace routing#7
Closed
kalinon wants to merge 6 commits intoByMosDev:mainfrom
Closed
feat(openclaw): normalize host paths for split-root workspace routing#7kalinon wants to merge 6 commits intoByMosDev:mainfrom
kalinon wants to merge 6 commits intoByMosDev:mainfrom
Conversation
Remove the hardcoded archived fallback agent for fresh installs and extend workspace path allowlisting to permit /_archived_workspace_main when it is intentionally present.
Add OPENCLAW_PATH_REMAP_PREFIXES support to normalize host-absolute workspace paths into virtual paths before allowlist/forwarding, keep archived fallback agent, and add integration coverage for remap + fallback behavior.
Implement API-side OpenClaw path normalization for both /home/node/.openclaw and ~/.openclaw prefixes, preserving allowlist enforcement. Add main/default agent workspace mapping to '/' when workspace is omitted to avoid /workspace-main lookups. Update integration tests and env/docs defaults so remap behavior and deployment config are consistent.
This was referenced Mar 3, 2026
Closed
Always include built-in OpenClaw host-path remap prefixes, treat OPENCLAW_PATH_REMAP_PREFIXES as additive extras, and resolve remaps by longest prefix first to avoid nested /workspace path compounding. Also normalize explicit agent workspace values in /openclaw/agents output and align fallback archived workspace to virtual path semantics. Updated integration tests and API docs/env examples to reflect additive behavior and precedence.
Contributor
Author
|
Follow-up API alignment for Path Law v2. New commit: Highlights:
Validation run:
|
- remap host workspace prefixes (~/.openclaw/workspace, /home/node/.openclaw/workspace) into /workspace/*\n- treat missing main/default agent workspaces as /workspace and align fallback COO path\n- allow /workspace and /workspace/* in strict path policy while rejecting bare /<file> paths\n- keep sub-agent/shared/config path rules unchanged\n- update integration tests for remap, allowlist, and agents mapping behavior
Contributor
Author
|
Superseded by # (), which rolls up all commits currently on moltar-forge:main relative to bymosbot:main. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR updates MosBot API to align with OpenClaw Path Law v2 behavior while keeping dashboard integration unchanged.
Changes
src/routes/openclaw.js:/workspace+/workspace/**allowance/workspace-<id>,/projects,/skills,/docs, config files, and archived path handlingGET /api/v1/openclaw/agentsfallback updates:/(canonical main workspace path)OPENCLAW_PATH_REMAP_PREFIXESbehavior remains/workspace/...to/workspace-main/.../workspaceis rejected withPATH_NOT_ALLOWED/Why
Under Path Law v2, canonical main workspace path is
/, and/workspacemust not be treated as a valid alias. API must enforce this consistently so dashboard/file flows do not regress or route to ambiguous paths.Issues Solved
/workspacealias creating inconsistent behavior with v2 routingValidation
npm test -- --runInBand src/routes/__tests__/openclaw.integration.test.js(pass)npm run lint -- src/routes/openclaw.js src/routes/__tests__/openclaw.integration.test.js(pass)Related PRs
Tracking issue: