mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-19 11:38:38 +00:00
fix(agents): scope process/exec tools to sessionKey for isolation (#4887)
Merged via /review-pr -> /prepare-pr -> /merge-pr.
Prepared head SHA: 5d30672e75
Co-authored-by: mcinteerj <3613653+mcinteerj@users.noreply.github.com>
Co-authored-by: Takhoffman <781889+Takhoffman@users.noreply.github.com>
Reviewed-by: @Takhoffman
This commit is contained in:
@@ -212,7 +212,10 @@ export function createOpenClawCodingTools(options?: {
|
|||||||
providerProfilePolicy,
|
providerProfilePolicy,
|
||||||
providerProfileAlsoAllow,
|
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 =
|
const subagentPolicy =
|
||||||
isSubagentSessionKey(options?.sessionKey) && options?.sessionKey
|
isSubagentSessionKey(options?.sessionKey) && options?.sessionKey
|
||||||
? resolveSubagentToolPolicy(options.config)
|
? resolveSubagentToolPolicy(options.config)
|
||||||
|
|||||||
Reference in New Issue
Block a user