From 5b72e2f050c4712a66f1e6e7b4104cf8a57e463b Mon Sep 17 00:00:00 2001 From: Dotta Date: Sat, 10 Oct 2026 08:30:45 -0500 Subject: [PATCH] Forward validated agent identity to environment probes Co-Authored-By: Paperclip --- server/src/routes/agents.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/src/routes/agents.ts b/server/src/routes/agents.ts index e481c661e27..c8213fe5a5c 100644 --- a/server/src/routes/agents.ts +++ b/server/src/routes/agents.ts @@ -3060,7 +3060,7 @@ export function agentRoutes( if (test) { const testEnvironmentId = await resolveAdapterTestEnvironmentId(companyId, environmentId); if (testEnvironmentId) await assertAdapterTestEnvironmentForCompany(companyId, testEnvironmentId); - const target = await resolveAdapterTestExecutionContext({ companyId, adapterType, environmentId: testEnvironmentId }); + const target = await resolveAdapterTestExecutionContext({ companyId, agentId, adapterType, environmentId: testEnvironmentId }); try { if (!target.executionTarget && target.fallbackChecks.length > 0) throw unprocessable("The agent environment is not available for adoption"); await withManagedAiProbe(db, { companyId, agentId, responsibleUserId: userId, adapterType, binding, config, allowUninstalledPersonal: newAgent, allowUninstalledShared, allowLegacyValidation: true }, async managed => { @@ -3193,6 +3193,7 @@ export function agentRoutes( const { executionTarget, environmentName, fallbackChecks, sandboxIdentityCheck, release } = await resolveAdapterTestExecutionContext({ companyId, + agentId: savedAgentId ?? undefined, adapterType: type, environmentId: requestedEnvironmentId, });