paperclipai/paperclip · error · Error
request.agentCoreProfile.eventExpiryDays must be 90
Error message
request.agentCoreProfile.eventExpiryDays must be 90
What it means
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.
Source
Thrown at packages/paperclip-runner/src/cli/eval-session-contract.ts:173
"request.managedProfile.anthropicAgentId",
),
agentVersion,
environmentId: text(
profile.environmentId,
"request.managedProfile.environmentId",
),
betaVersion: "managed-agents-2026-04-01",
maxSessionListCostUsd: positiveNumber(
profile.maxSessionListCostUsd,
"request.managedProfile.maxSessionListCostUsd",
),
};
}
function parseAgentCoreProfile(value: unknown): EvalSessionAgentCoreProfile {
const profile = object(value, "request.agentCoreProfile");
if (profile.eventExpiryDays !== 90) {
throw new Error("request.agentCoreProfile.eventExpiryDays must be 90");
}
const requiredText = (name: string): string =>
text(profile[name], `request.agentCoreProfile.${name}`);
return {
profileId: requiredText("profileId"),
region: requiredText("region"),
accountId: requiredText("accountId"),
harnessArn: requiredText("harnessArn"),
harnessVersion: requiredText("harnessVersion"),
endpointArn: requiredText("endpointArn"),
endpointQualifier: requiredText("endpointQualifier"),
agentRuntimeArn: requiredText("agentRuntimeArn"),
memoryArn: requiredText("memoryArn"),
memoryId: requiredText("memoryId"),
invocationRoleArn: requiredText("invocationRoleArn"),
contextBucket: requiredText("contextBucket"),
contextPrefix: requiredText("contextPrefix"),
contextKmsKeyArn: requiredText("contextKmsKeyArn"),View on GitHub (pinned to 01ad858492)
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
Example fix
// before
{ eventExpiryDays: '90' }
// after
{ eventExpiryDays: 90 } Defensive patterns
Strategy: validation
Validate before calling
const REQUIRED_EVENT_EXPIRY_DAYS = 90;
if (req.agentCoreProfile?.eventExpiryDays !== REQUIRED_EVENT_EXPIRY_DAYS) {
throw new Error('eventExpiryDays must be 90 (number)');
} Type guard
function hasValidEventExpiry(p) {
return p?.eventExpiryDays === 90;
} Try / catch
try {
const request = parseEvalSessionRequest(raw);
} catch (err) {
if (err.message.includes('eventExpiryDays must be 90')) {
throw new RequestValidationError('AgentCore eventExpiryDays is pinned to the number 90 in this build', { cause: err });
}
throw err;
} Prevention
- 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
When it happens
Trigger: 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).
Common situations: 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.
Understand the failure class
Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.
Related errors
- ${path} must be an object
- ${path} must be a non-empty string
- ${path} must be a positive safe integer
- ${path} must be a positive finite number
- request.managedProfile.betaVersion is not qualified
AI-assisted analysis of paperclipai/paperclip@01ad858492 (2026-09-02).
Data as JSON: /api/errors/a3bfefcb8631922e.
Report an issue: GitHub.