mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-11 03:14:36 +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:
@@ -539,7 +539,9 @@ async function agentCommandInternal(
|
||||
agentId: sessionAgentId,
|
||||
sessionKey,
|
||||
});
|
||||
const workspaceDirRaw = resolveAgentWorkspaceDir(cfg, sessionAgentId);
|
||||
// Internal callers (for example subagent spawns) may pin workspace inheritance.
|
||||
const workspaceDirRaw =
|
||||
opts.workspaceDir?.trim() ?? resolveAgentWorkspaceDir(cfg, sessionAgentId);
|
||||
const agentDir = resolveAgentDir(cfg, sessionAgentId);
|
||||
const workspace = await ensureAgentWorkspace({
|
||||
dir: workspaceDirRaw,
|
||||
|
||||
@@ -80,6 +80,8 @@ export type AgentCommandOpts = {
|
||||
inputProvenance?: InputProvenance;
|
||||
/** Per-call stream param overrides (best-effort). */
|
||||
streamParams?: AgentStreamParams;
|
||||
/** Explicit workspace directory override (for subagents to inherit parent workspace). */
|
||||
workspaceDir?: string;
|
||||
};
|
||||
|
||||
export type AgentCommandIngressOpts = Omit<AgentCommandOpts, "senderIsOwner"> & {
|
||||
|
||||
Reference in New Issue
Block a user