mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-28 00:10:41 +00:00
fix(agents): land #39247 from @jasonQin6 (subagent workspace inheritance)
Propagate parent workspace directories into spawned subagent runs, keep workspace override internal-only, and add regression tests for forwarding boundaries. Co-authored-by: jasonQin6 <991262382@qq.com>
This commit is contained in:
@@ -79,6 +79,25 @@ describe("sessions_spawn tool", () => {
|
||||
expect(hoisted.spawnAcpDirectMock).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("passes inherited workspaceDir from tool context, not from tool args", async () => {
|
||||
const tool = createSessionsSpawnTool({
|
||||
agentSessionKey: "agent:main:main",
|
||||
workspaceDir: "/parent/workspace",
|
||||
});
|
||||
|
||||
await tool.execute("call-ws", {
|
||||
task: "inspect AGENTS",
|
||||
workspaceDir: "/tmp/attempted-override",
|
||||
});
|
||||
|
||||
expect(hoisted.spawnSubagentDirectMock).toHaveBeenCalledWith(
|
||||
expect.any(Object),
|
||||
expect.objectContaining({
|
||||
workspaceDir: "/parent/workspace",
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it("routes to ACP runtime when runtime=acp", async () => {
|
||||
const tool = createSessionsSpawnTool({
|
||||
agentSessionKey: "agent:main:main",
|
||||
|
||||
Reference in New Issue
Block a user