{"record":{"id":"fab80617d7fa6053","repo":"paperclipai/paperclip","slug":"environment-not-found-fab806","errorCode":null,"errorMessage":"Environment not found","messagePattern":"Environment not found","errorType":"http","errorClass":null,"httpStatus":404,"severity":"error","filePath":"server/src/routes/agents.ts","lineNumber":2677,"sourceCode":"      req,\n      collectAgentAdapterWorkspaceCommandPaths(adapterConfig, path),\n    );\n  }\n\n  function summarizeAgentUpdateDetails(patch: Record<string, unknown>) {\n    const changedTopLevelKeys = Object.keys(patch).sort();\n    const details: Record<string, unknown> = { changedTopLevelKeys };\n\n    const adapterConfigPatch = asRecord(patch.adapterConfig);\n    if (adapterConfigPatch) {\n      details.changedAdapterConfigKeys = Object.keys(adapterConfigPatch).sort();\n    }\n\n    const runtimeConfigPatch = asRecord(patch.runtimeConfig);\n    if (runtimeConfigPatch) {\n      details.changedRuntimeConfigKeys = Object.keys(runtimeConfigPatch).sort();\n    }\n\n    return details;\n  }\n\n  function buildUnsupportedSkillSnapshot(\n    adapterType: string,\n    desiredSkillEntries: AgentDesiredSkillEntry[] = [],\n  ): AgentSkillSnapshot {\n    const desiredSkills = desiredSkillEntries.map((entry) => entry.key);\n    return {\n      adapterType,\n      supported: false,\n      mode: \"unsupported\",\n      desiredSkills,\n      desiredSkillEntries,\n      entries: [],\n      warnings: [\"This adapter does not implement skill sync yet.\"],\n    };\n  }","sourceCodeStart":2659,"sourceCodeEnd":2695,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/server/src/routes/agents.ts#L2659-L2695","documentation":"Lookup guard in the adapter models route: the environmentId query parameter names an environment that does not exist (or is not visible) for this company, so model listing cannot proceed and the route returns 404 rather than listing models against a bogus environment.","triggerScenarios":"Thrown at server/src/routes/agents.ts:2303 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the environment id exists for this company; create the environment first if needed."],"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-14T00:17:10.932Z"}