fix(agent): reset SandboxManager before initializing to ensure fresh config for every session

This commit is contained in:
yiling
2026-06-15 10:36:01 +08:00
parent c55abbf724
commit 8e012f9353
2 changed files with 102 additions and 1 deletions
+3
View File
@@ -154,6 +154,9 @@ export async function createAgentSession(params: CreateAgentSessionParams) {
}
// SandboxManager.initialize is a global operation that applies to the entire process.
// We reset it first to ensure any previous process-global SOCKS/HTTP proxy servers
// and callbacks are cleaned up, allowing the new callback and allowedDomains to take effect.
await SandboxManager.reset()
await SandboxManager.initialize(
{
network: {