mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-25 08:02:04 +00:00
fix(agents): scope process/exec tools to sessionKey for isolation
This commit is contained in:
committed by
Tak Hoffman
parent
36e27ad561
commit
6d5b9b19a7
@@ -212,7 +212,12 @@ export function createOpenClawCodingTools(options?: {
|
||||
providerProfilePolicy,
|
||||
providerProfileAlsoAllow,
|
||||
);
|
||||
const scopeKey = options?.exec?.scopeKey ?? (agentId ? `agent:${agentId}` : undefined);
|
||||
// Prefer sessionKey for process isolation scope to prevent cross-session process visibility/killing.
|
||||
// Fallback to agentId if no sessionKey is available (e.g. legacy or global contexts).
|
||||
const scopeKey =
|
||||
options?.exec?.scopeKey ??
|
||||
options?.sessionKey ??
|
||||
(agentId ? `agent:${agentId}` : undefined);
|
||||
const subagentPolicy =
|
||||
isSubagentSessionKey(options?.sessionKey) && options?.sessionKey
|
||||
? resolveSubagentToolPolicy(options.config)
|
||||
|
||||
Reference in New Issue
Block a user