From 9b667fc5345b0cb2bacf270c32421abe8a0a0d53 Mon Sep 17 00:00:00 2001 From: Nimrod Gutman Date: Fri, 3 Apr 2026 23:56:37 +0300 Subject: [PATCH] fix(agents): cover default workspace fallback (#59858) (thanks @joelnishanth) --- CHANGELOG.md | 1 + src/agents/agent-scope.test.ts | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7cbf554bb62..7fb46cf077b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -88,6 +88,7 @@ Docs: https://docs.openclaw.ai - Matrix/Telegram exec approvals: recover stored same-channel account bindings even when session reply state drifted to another channel, so foreign-channel approvals route to the bound account instead of fanning out or being rejected as ambiguous. (#60417) thanks @gumadeiras. - Slack/app manifest: set `bot_user.always_online` to `true` in the onboarding and example Slack app manifest so the Slack app appears ready to respond. - Gateway/websocket auth: refresh auth on new websocket connects after secrets reload so rotated gateway tokens take effect immediately without requiring a restart. (#60323) Thanks @mappel-nv. +- Agents/workspace: respect `agents.defaults.workspace` for non-default agents by resolving them under the configured base path instead of falling back to `workspace-`. (#59858) Thanks @joelnishanth. ## 2026.4.2 diff --git a/src/agents/agent-scope.test.ts b/src/agents/agent-scope.test.ts index 81fb4f717bd..27ab2b65b25 100644 --- a/src/agents/agent-scope.test.ts +++ b/src/agents/agent-scope.test.ts @@ -444,15 +444,15 @@ describe("resolveAgentConfig", () => { expect(workspace).toBe(path.resolve("/shared-ws/main")); }); - it("default agent uses agents.defaults.workspace directly", () => { + it("default agent without per-agent workspace uses agents.defaults.workspace directly", () => { const cfg: OpenClawConfig = { agents: { defaults: { workspace: "/shared-ws" }, - list: [{ id: "main" }, { id: "work", default: true, workspace: "/work-ws" }], + list: [{ id: "main" }, { id: "work", default: true }], }, }; const workspace = resolveAgentWorkspaceDir(cfg, "work"); - expect(workspace).toBe(path.resolve("/work-ws")); + expect(workspace).toBe(path.resolve("/shared-ws")); }); it("non-default agent without defaults.workspace falls back to stateDir", () => {