fix: expand tilde in workspace path for claude-cli provider

cfg.Agents.Defaults.Workspace returns the raw config value (e.g.
~/.picoclaw/workspace) without tilde expansion. Use cfg.WorkspacePath()
which correctly expands ~ to the user's home directory, fixing a
"chdir: no such file or directory" error when using the claude-cli
provider.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
bug 2026-02-16 18:51:58 +08:00
parent d24620f32d
commit 20b32da480

View file

@ -299,7 +299,7 @@ func CreateProvider(cfg *config.Config) (LLMProvider, error) {
} }
} }
case "claude-cli", "claudecode", "claude-code": case "claude-cli", "claudecode", "claude-code":
workspace := cfg.Agents.Defaults.Workspace workspace := cfg.WorkspacePath()
if workspace == "" { if workspace == "" {
workspace = "." workspace = "."
} }