fix: cron sessions inherit allowAgents from parent agent config (#1771)

When a cron job runs in isolated mode, the sessions_spawn tool now correctly
inherits the allowAgents permissions from the parent agent's config.

The fix adds a requesterAgentIdOverride parameter that flows through the
tool creation chain:
- resolveEffectiveToolPolicy() extracts the correct agentId from the session key
- This agentId is passed to sessions_spawn and agents_list tools
- The tools use this override instead of re-parsing the session key

This fixes #1767
This commit is contained in:
/noctivoro-x authored and GitHub committed 2026-01-25 13:10:48 +00:00
1 parent f618859761
commit abedc8bf7f
4 files changed
+17 -4

No files matched your search

+1
View File
@@ -313,6 +313,7 @@ export function createClawdbotCodingTools(options?: {
replyToMode: options?.replyToMode,
hasRepliedRef: options?.hasRepliedRef,
modelHasVision: options?.modelHasVision,
requesterAgentIdOverride: agentId,
}),
];
const coreToolNames = new Set(