Context:
User is attempting to use sessions_spawn (runtime="subagent", mode="run") to delegate tasks. These attempts consistently fail with a gateway closed (1008): pairing required error.
Technical Environment:
-
OS: Windows 10
-
Gateway: Local loopback (127.0.0.1:18789)
-
Config: gateway.auth.mode = "token", gateway.controlUi.allowInsecureAuth = true
-
Logs Analysis:** The gateway logs explicitly show a security audit: device access upgrade requested. The reason is scope-upgrade. The sub-agent attempts to transition from operator.read to operator.admin (or operator.pairing), which the gateway rejects because the ephemeral sub-agent session lacks a paired identity/token.
Observed Failure Pattern:sessions_spawn is called.
Sub-agent attempts to initialize/use tools.
Gateway intercepts the request for elevated scopes.
Connection is terminated with Error 1008 (Pairing Required).
Problem Statement:
The current sub-agent orchestration model creates a "Catch-22": the sub-agents require slightly elevated permissions to perform standard automated tasks (like complex tool usage), but because they are ephemeral, they cannot be "paired" in a way that satisfies the gateway's security requirements for scope upgrades.
Objective:
Determine if there is a way to spawn sub-agents with pre-authorized scopes without manual pairing.
Identify if the operator.admin request is an unnecessary side-effect of the sub-agent's initialization or a requirement of the requested task.
Provide a configuration or workflow fix to allow seamless, secure, and automated sub-agent orchestration.