[Bug] Workspace browser shows default workspace files instead of agent-specific workspace
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
- Create a non-default agent with a dedicated workspace (e.g., agent "laoA" →
~/.openclaw/workspace-laoa) - Add custom content to the agent's TOOLS.md (e.g., custom tool configs)
- Start a conversation with that agent
- Open the ArtifactPanel workspace browser (right panel → Workspace tab)
- 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
Source: ValueCell-ai/ClawX