Skip to content

[Bug] Workspace browser shows default workspace files instead of agent-specific workspace #1209

Description

@ditingdapeng

Summary

When chatting with a non-default agent (e.g., "laoA" with workspace ~/.openclaw/workspace-laoa), the ArtifactPanel workspace browser displays files from the default workspace (~/.openclaw/workspace) instead of the agent's own workspace.

This means agent-specific configurations (custom TOOLS.md entries, AGENTS.md personality configs) are not visible in the file browser, showing generic template content instead.

Steps to Reproduce

  1. Create a non-default agent with a dedicated workspace (e.g., agent "laoA" → ~/.openclaw/workspace-laoa)
  2. Add custom content to the agent's TOOLS.md (e.g., custom tool configs)
  3. Start a conversation with that agent
  4. Open the ArtifactPanel workspace browser (right panel → Workspace tab)
  5. Select TOOLS.md in the file tree

Expected Behavior

  • The workspace browser shows files from ~/.openclaw/workspace-laoa
  • TOOLS.md displays the agent's custom content (e.g., Stock API configuration)
  • File size reflects the agent's file (2.4 KB)

Actual Behavior

  • The workspace browser shows files from ~/.openclaw/workspace (default)
  • TOOLS.md displays only generic template content + ClawX injected section
  • File size shows 1.8 KB (the default workspace version)
  • The header still shows the agent name ("laoA") but the wrong workspace path

Root Cause

resolveEffectiveWorkspace() in Chat/index.tsx has priority: session → global → default. When no session workspace is bound and no global workspace is explicitly selected, it falls back to ~/.openclaw/workspace. This value is passed as workspacePath to ArtifactPanel → WorkspaceBrowserBody, overriding the agent?.workspace fallback (which only triggers when workspacePath is empty/null, but it's never empty — it's the default value).

Environment

  • ClawX version: v0.5.2
  • OS: macOS 15.3 (Apple Silicon)
  • Agents: Multiple agents with dedicated workspaces configured in openclaw.json

Additional Information

Fix PR: #1210

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions