{"record":{"id":"a3bfefcb8631922e","repo":"paperclipai/paperclip","slug":"request-agentcoreprofile-eventexpirydays-must-be-9","errorCode":null,"errorMessage":"request.agentCoreProfile.eventExpiryDays must be 90","messagePattern":"request\\.agentCoreProfile\\.eventExpiryDays must be 90","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/paperclip-runner/src/cli/eval-session-contract.ts","lineNumber":173,"sourceCode":"      \"request.managedProfile.anthropicAgentId\",\n    ),\n    agentVersion,\n    environmentId: text(\n      profile.environmentId,\n      \"request.managedProfile.environmentId\",\n    ),\n    betaVersion: \"managed-agents-2026-04-01\",\n    maxSessionListCostUsd: positiveNumber(\n      profile.maxSessionListCostUsd,\n      \"request.managedProfile.maxSessionListCostUsd\",\n    ),\n  };\n}\n\nfunction parseAgentCoreProfile(value: unknown): EvalSessionAgentCoreProfile {\n  const profile = object(value, \"request.agentCoreProfile\");\n  if (profile.eventExpiryDays !== 90) {\n    throw new Error(\"request.agentCoreProfile.eventExpiryDays must be 90\");\n  }\n  const requiredText = (name: string): string =>\n    text(profile[name], `request.agentCoreProfile.${name}`);\n  return {\n    profileId: requiredText(\"profileId\"),\n    region: requiredText(\"region\"),\n    accountId: requiredText(\"accountId\"),\n    harnessArn: requiredText(\"harnessArn\"),\n    harnessVersion: requiredText(\"harnessVersion\"),\n    endpointArn: requiredText(\"endpointArn\"),\n    endpointQualifier: requiredText(\"endpointQualifier\"),\n    agentRuntimeArn: requiredText(\"agentRuntimeArn\"),\n    memoryArn: requiredText(\"memoryArn\"),\n    memoryId: requiredText(\"memoryId\"),\n    invocationRoleArn: requiredText(\"invocationRoleArn\"),\n    contextBucket: requiredText(\"contextBucket\"),\n    contextPrefix: requiredText(\"contextPrefix\"),\n    contextKmsKeyArn: requiredText(\"contextKmsKeyArn\"),","sourceCodeStart":155,"sourceCodeEnd":191,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/packages/paperclip-runner/src/cli/eval-session-contract.ts#L155-L191","documentation":"parseAgentCoreProfile pins request.agentCoreProfile.eventExpiryDays to exactly the number 90, matching the AWS AgentCore event-expiry requirement. Any other value — 30, '90' as a string, or null — throws this error, keeping the harness configuration compliant with the supported retention window.","triggerScenarios":"Calling parseEvalSessionRequest with request.agentCoreProfile.eventExpiryDays set to any value other than the numeric literal 90, including the string '90', 30, 365, or a missing field (undefined !== 90).","commonSituations":"A template or copy-pasted AgentCore config used a different retention value; the field was serialized as a string; a newer AgentCore default (e.g. 30 days) leaked into the request; the field was simply omitted.","solutions":["Set eventExpiryDays to the number 90 exactly (not the string '90')","Remove custom retention overrides so the pinned value applies","If another retention window is genuinely needed, update the contract deliberately — do not bypass validation","Verify the producer emits a JSON number for this field"],"exampleFix":"// before\n{ eventExpiryDays: '90' }\n// after\n{ eventExpiryDays: 90 }","handlingStrategy":"validation","validationCode":"const REQUIRED_EVENT_EXPIRY_DAYS = 90;\nif (req.agentCoreProfile?.eventExpiryDays !== REQUIRED_EVENT_EXPIRY_DAYS) {\n  throw new Error('eventExpiryDays must be 90 (number)');\n}","typeGuard":"function hasValidEventExpiry(p) {\n  return p?.eventExpiryDays === 90;\n}","tryCatchPattern":"try {\n  const request = parseEvalSessionRequest(raw);\n} catch (err) {\n  if (err.message.includes('eventExpiryDays must be 90')) {\n    throw new RequestValidationError('AgentCore eventExpiryDays is pinned to the number 90 in this build', { cause: err });\n  }\n  throw err;\n}","preventionTips":["Emit eventExpiryDays as a JSON number, never a string","Use the exported constant instead of literals in producer code","Do not override retention defaults when templating AgentCore profiles","Add a contract test asserting 90 to catch accidental retuning"],"tags":["validation","contract","aws-agentcore"],"backgroundTag":"schema-validation-failed","analyzedSha":"01ad8584922b5d85292b1723cae71fa0d9b07a19","analyzedAt":"2026-09-02T18:44:00.616Z","contentChangedAt":"2026-09-02T18:44:00.616Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}