{"record":{"id":"077a663359b58c08","repo":"paperclipai/paperclip","slug":"agent-not-found-077a66","errorCode":null,"errorMessage":"Agent not found","messagePattern":"Agent not found","errorType":"http","errorClass":null,"httpStatus":404,"severity":"error","filePath":"server/src/routes/agents.ts","lineNumber":3094,"sourceCode":"      }\n      const normalizedAdapterConfig = await secretsSvc.normalizeAdapterConfigForPersistence(\n        companyId,\n        inputAdapterConfig,\n        { strictMode: strictSecretsMode, adapterType: type },\n      );\n      // Prospective, non-persisted config: resolve the acting user's own user\n      // secrets in owner_scoped mode (no declaration rows exist for this config).\n      // Record an honest audit consumer — environment:<id> when the caller selected\n      // one, otherwise system:adapter_test — never a fake agent consumer.\n      const { config: runtimeAdapterConfig } = await secretsSvc.resolveAdapterConfigForRuntime(\n        companyId,\n        normalizedAdapterConfig,\n        buildActorSecretContext(\n          req,\n          requestedEnvironmentId\n            ? { consumerType: \"environment\", consumerId: requestedEnvironmentId }\n            : { consumerType: \"system\", consumerId: \"adapter_test\" },\n        ),\n        { adapterType: type, userSecretMediation: \"owner_scoped\" },\n      );\n\n      const { executionTarget, environmentName, fallbackChecks, sandboxIdentityCheck, release } =\n        await resolveAdapterTestExecutionContext({\n          companyId,\n          adapterType: type,\n          environmentId: requestedEnvironmentId,\n        });\n\n      let releaseStatus: \"released\" | \"failed\" = \"released\";\n      try {\n        // Mirror the run path (resolveExecutionRunAdapterConfig): the selected\n        // environment's envVars are the base env layer and the agent's\n        // adapterConfig.env wins on key conflicts. Without this merge the probe\n        // cannot see environment-level auth (e.g. CLAUDE_CODE_OAUTH_TOKEN) that\n        // real runs receive.\n        const environmentEnvChecks: AdapterEnvironmentCheck[] = [];","sourceCodeStart":3076,"sourceCodeEnd":3112,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/server/src/routes/agents.ts#L3076-L3112","documentation":"Generic not-found sentinel from getAccessibleResource: the referenced agent id does not exist or is outside the actor's accessible scope, so the route responds 404 without distinguishing existence from authorization to avoid leaking agent ids.","triggerScenarios":"Thrown at server/src/routes/agents.ts:2605 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the agent id is correct and the agent exists in this company."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ad8584922b5d85292b1723cae71fa0d9b07a19","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}