agent: pass workspace override via OPENCLAW_WORKSPACE env through gateway RPC
This commit is contained in:
parent
049cedc5fd
commit
d65a7ab944
@ -132,6 +132,8 @@ export async function agentViaGatewayCommand(opts: AgentCliOpts, runtime: Runtim
|
||||
const channel = normalizeMessageChannel(opts.channel) ?? DEFAULT_CHAT_CHANNEL;
|
||||
const idempotencyKey = opts.runId?.trim() || randomIdempotencyKey();
|
||||
|
||||
const workspaceOverride = process.env.OPENCLAW_WORKSPACE?.trim() || undefined;
|
||||
|
||||
const response = await withProgress(
|
||||
{
|
||||
label: "Waiting for agent reply…",
|
||||
@ -157,6 +159,7 @@ export async function agentViaGatewayCommand(opts: AgentCliOpts, runtime: Runtim
|
||||
lane: opts.lane,
|
||||
extraSystemPrompt: opts.extraSystemPrompt,
|
||||
idempotencyKey,
|
||||
workspace: workspaceOverride,
|
||||
},
|
||||
expectFinal: true,
|
||||
timeoutMs: gatewayTimeoutMs,
|
||||
@ -240,6 +243,8 @@ async function agentViaGatewayStreamJson(opts: AgentCliOpts, _runtime: RuntimeEn
|
||||
process.on("SIGTERM", onSignal);
|
||||
process.on("SIGINT", onSignal);
|
||||
|
||||
const streamWorkspaceOverride = process.env.OPENCLAW_WORKSPACE?.trim() || undefined;
|
||||
|
||||
try {
|
||||
const response = await callGateway<GatewayAgentResponse>({
|
||||
method: "agent",
|
||||
@ -259,6 +264,7 @@ async function agentViaGatewayStreamJson(opts: AgentCliOpts, _runtime: RuntimeEn
|
||||
lane: opts.lane,
|
||||
extraSystemPrompt: opts.extraSystemPrompt,
|
||||
idempotencyKey,
|
||||
workspace: streamWorkspaceOverride,
|
||||
},
|
||||
expectFinal: true,
|
||||
timeoutMs: gatewayTimeoutMs,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user