Download src/agents/subagents/spawn/subagent-launch-authorization.ts from SaylorTwift/openclaw: direct link, hf CLI and curl.
- Browser
- Download file 683 Bytes
-
https://huggingface.co/SaylorTwift/openclaw/resolve/main/src/agents/subagents/spawn/subagent-launch-authorization.ts
- Command line
-
hf download hf://SaylorTwift/openclaw/src/agents/subagents/spawn/subagent-launch-authorization.ts
-
curl -L -o subagent-launch-authorization.ts https://huggingface.co/SaylorTwift/openclaw/resolve/main/src/agents/subagents/spawn/subagent-launch-authorization.ts
683 Bytes
| /** Authorization captured when a trusted sessions_spawn request selects a model. */ | |
| export type SubagentLaunchAuthorization = { | |
| modelOverride: { | |
| provider?: string; | |
| model: string; | |
| }; | |
| }; | |
| /** Applies only the exact model choice authorized during spawn planning. */ | |
| export function applySubagentLaunchAuthorization( | |
| request: Record<string, unknown>, | |
| authorization?: SubagentLaunchAuthorization, | |
| ): Record<string, unknown> { | |
| const modelOverride = authorization?.modelOverride; | |
| if (!modelOverride) { | |
| return request; | |
| } | |
| return { | |
| ...request, | |
| ...(modelOverride.provider ? { provider: modelOverride.provider } : {}), | |
| model: modelOverride.model, | |
| }; | |
| } | |