Forward validated agent identity to environment probes

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
DottaandPaperclip committed 2026-10-10 08:41:04 -05:00
1 parent 252d68f28a
commit 5b72e2f050
1 file changed
+2 -1
+2 -1
View File
@@ -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,
});