Skip to content

[Bug]: Skill loader ignores configured workspace path and hardcodes fallback to ~/.openclaw/workspace #89743

Closed as not planned

Description

@BeiyuanZhang

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

When a custom workspace directory is configured (e.g., on drive E:), OpenClaw still attempts to load skills from the hardcoded default path C:\Users<User>.openclaw\workspace\skills before falling back to the user-configured workspace. This causes an unnecessary failed filesystem I/O operation on every skill load, even though the correct path is explicitly set in configuration.

Steps to reproduce

Set a custom workspace path in OpenClaw config (e.g., E:\OpenClawData.openclaw\workspace)
Install or enable any skill (e.g., arxiv-watcher)
Observe logs during skill loading
Note that OpenClaw first tries:
C:\Users\James.openclaw\workspace\skills\arxiv-watcher\SKILL.md (which does not exist)
Only after this failure does it correctly fall back to:
E:\OpenClawData.openclaw\workspace\skills\arxiv-watcher\SKILL.md

Expected behavior

OpenClaw should only use the workspace path specified in the user’s configuration for skill discovery and loading. It should not attempt to read from ~/.openclaw/workspace unless that path is explicitly set as the workspace.

Actual behavior

OpenClaw unconditionally tries the hardcoded default path (~/.openclaw/workspace) first, regardless of the configured workspace. This results in:
A spurious “file not found” error in logs
Unnecessary I/O overhead
Confusion for users who have migrated their workspace
Note: Manually updating the location field in _meta.json helps some tooling but does not fix the core runtime loading logic, which still probes the wrong path first.

OpenClaw version

2026.5.28

Operating system

Windows 11

Install method

npm

Model

minimax M2.7

Provider / routing chain

OpenClaw version:2026.5.28 OS: Windows 11 Workspace config: Custom path on non-system drive (E:...) Skill: arxiv-watcher

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

Activity

  1. clawsweeper commented on Jun 3, 2026

    @clawsweeper
    Contributor

    Thanks for the report. I gave this a fresh shell check against current main, and I could not reproduce it anymore.

    Current main does not show the reported default-workspace probe on reachable sandbox flows: production callers pass an already resolved workspace into sandbox setup. The remaining default in the low-level layout helper is only a defensive fallback; no current production caller found omits the workspace.

    Review details

    Best possible solution:

    Keep workspace resolution at the run/context boundary; a future caller that genuinely lacks a workspace should resolve it with the agent resolver before entering sandbox layout.

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

    No. Current production callers found resolve and pass a concrete agent workspace to sandbox setup, so the optional low-level fallback is not reached by the reported flow.

    Is this the best way to solve the issue?

    Not applicable. The current caller-boundary resolution is the narrowest design; changing an unused helper fallback alone would not repair a demonstrated current product path.

    Security review:

    Security review: No proposed patch is under security review.

    AGENTS.md: found and applied where relevant.

    What I checked:

    • Configured workspace contract: The agent resolver gives a per-agent workspace precedence, then the configured default workspace, before environment/state defaults. (src/agents/agent-scope-config.ts:365, 982e0181b748)
    • Reachable sandbox caller: The cron runtime resolves the configured agent workspace and passes that concrete path to sandbox setup. (src/cron/trigger-script.ts:129, 982e0181b748)
    • Current fallback is not a discovered production path: The layout helper retains a default only when its optional workspace argument is absent, while current production callers found pass workspaceDir explicitly. (src/agents/sandbox/shared.ts:103, 982e0181b748)
    • Current-path provenance: Blame attributes the current sandbox layout handoff lines to the recent core refactor commit; this supports routing to the present code owner without attributing the historical report to that change. (src/agents/sandbox/context.ts:101, 6bbc57e52672)
    • Shipped-version context: The report names 2026.5.28, while the checkout's latest release tag is v2026.7.1-2 and current main is newer; no current path found reproduces the reported behavior. (982e0181b748)
    • Maturity scope: The maturity shortlist classifies Agent Runtime as M3 Beta, so this issue is not eligible for maturity:stable. (qa/maturity-scores.yaml, 982e0181b748)

    Likely related people:

    • Peter Steinberger: Current sandbox context and layout lines blame to the recent core refactor commit; broader history is shallow, so this is routing evidence rather than ownership attribution. (role: recent area contributor; confidence: medium; commits: 6bbc57e52672; files: src/agents/sandbox/context.ts, src/agents/sandbox/shared.ts)

    Codex review notes: model internal, reasoning high; reviewed against 982e0181b748.

  2. AliAbuelkheir commented on Jun 3, 2026

    @AliAbuelkheir

    Hi, I’d like to work on this. I’ll keep the change scoped to the gateway skill install/update workspace routing path and add focused regression coverage for custom/explicit agent workspaces.

  3. wangmiao0668000666 commented on Jun 4, 2026

    @wangmiao0668000666
    Contributor

    While working on PR #90089 for the sandbox fallback path, I also checked src/agents/workspace.ts:818: ensureAgentWorkspace still falls back to DEFAULT_AGENT_WORKSPACE_DIR when called without an explicit dir. All current callers pass dir, so this does not appear to be an active contributor to the reported behavior, but it is the last remaining hardcoded workspace fallback in the agent workspace layer. Related PRs addressing this issue surface:\n- #89767 fixes Gateway skill install/update routing\n- #90089 fixes sandbox skill-sync fallback

  4. added
    P2Normal backlog priority with limited blast radius.
    on Jun 15, 2026
  5. 31 remaining items

  6. added
    issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.
    clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.
    clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.
    clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.
    on Aug 3, 2026
  7. clawsweeper commented on Aug 3, 2026

    @clawsweeper
    Contributor

    🦞🔧
    ClawSweeper is automatically building this issue.

    The issue review finished and no active implementation pull request was found.

    Automatic implementation progress:

    Result: implementation skipped.

  8. ruel225 commented on Aug 4, 2026

    @ruel225
    Contributor

    I'd like to work on this issue. I will keep the change focused and include validation evidence.

  9. added
    clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.
    clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.
    and removed
    no-staleExclude from stale automation
    clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.
    clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.
    on Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.bugSomething isn't workingbug:behaviorIncorrect behavior without a crashclawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions