Hmbown/CodeWhale · error · Error
Pet recording exceeds its input limit.
Error message
Pet recording exceeds its input limit.
What it means
Constructor guard in PetWorld: the recording being loaded exceeds the accepted input limit (total tape/interaction log size). The world state machine loads an entire recording into memory (tapeLog, interactionLog, members map), so oversized recordings are rejected at construction rather than loaded partially.
Solutions
- Split the recording into segments (segmented recordings) and load via fromRecording with checkpoints.
- Truncate tape/interactions to the limits before constructing.
- Drop or compress older buckets beyond 216000 and interactions beyond 100000.
Example fix
// before new PetWorld(points, hugeTape, hugeInteractions); // after const tape = hugeTape.slice(-216000); const interactions = hugeInteractions.slice(-100000); new PetWorld(points, tape, interactions);
Defensive patterns
Strategy: validation
Validate before calling
if (tape.length > 216000 || interactions.length > 100000) throw new Error('Recording too large to load as one world'); Try / catch
try { world = new PetWorld(points, tape, interactions); } catch (e) { if (e.message.includes('input limit')) world = PetWorld.fromRecording(points, segmentRecording(tape, interactions)); } Prevention
- Use segmented recordings with checkpoints for long sessions.
- Periodically trim logs during recording.
When it happens
Trigger: new PetWorld(points, tape, interactions, ...) where tape.length > 216000 or interactions.length > 100000.
Common situations: Loading a recording accumulated over many days without segmentation; concatenating multiple recordings into one array; a long-running session producing more than 4096 interactions without checkpointing.
Understand the failure class
Background: payload too large / request exceeds maximum size: why libraries cap bytes and how to fix oversize payloads — this error's family across 50 libraries.
Related errors
- artifact tree exceeds export depth limit
- artifact tree exceeds export entry limit
- bounded provider catalog cache exceeds its write limit
- Codewhale terminal receipt contained an invalid count
- Codewhale terminal receipt exceeded its string bound
AI-assisted analysis of Hmbown/CodeWhale@433685b202 (2026-09-15).
Data as JSON: /api/errors/79fce861e150481d.
Report an issue: GitHub.
Appendix: source
Thrown at pet/src/core/pet-world.ts:91
private lit = 1;
private lastActivity = 0;
private addressedAt = -Infinity;
private waitSince = -1;
private food: { time: number; x: number; y: number } | null = null;
private members = new Map<string, PodMember>();
private lastStill = '';
private origin?: PetWorldCheckpoint;
private segmented = false;
private hasTelemetry = false;
get startTimeMs(): number { return this.origin?.frame.timeMs ?? 0; }
get endTimeMs(): number { return Math.max(this.frame.timeMs, (this.tapeLog.at(-1)?.simTimeMs ?? 0) + 400); }
get needsSegment(): boolean {
return !this.segmented && this.tapeLog.length < 1024 && this.interactionLog.length < 4096
|| this.bucketIndex >= 1024 || this.interactionIndex >= 4096;
}
constructor(points: [number, number][], tape: readonly PetBucket[] = [], interactions: readonly PetInteraction[] = [], expressionVersion: 1 | 2 = 2, segmented = false) {
if (tape.length > 216_000 || interactions.length > 100_000) throw new Error('Pet recording exceeds its input limit.');
this.sim = new PetSim(points, 0xC0FFEE, expressionVersion);
this.segmented = segmented; this.hasTelemetry = tape.length > 0;
this.tapeLog = structuredClone([...tape]);
this.interactionLog = structuredClone([...interactions]);
for (let i = 0; i < this.tape.length; i++) {
const b = this.tape[i];
validatePetBucket(b);
if (segmented ? i > 0 && b.sequence <= this.tape[i - 1].sequence : b.sequence !== i)
throw new Error('World requires contiguous version 1 pet buckets.');
}
for (let i = 0; i < this.interactionLog.length; i++) {
const e = this.interactionLog[i];
if (!Number.isFinite(e.timeMs) || e.timeMs < 0 || i > 0 && e.timeMs < this.interactionLog[i - 1].timeMs
|| !['attention', 'food'].includes(e.kind) || !Number.isFinite(e.x) || !Number.isFinite(e.y)
|| Math.abs(e.x) > 1 || Math.abs(e.y) > 1) throw new Error('Invalid pet interaction.');
}
this.hashTape(0);
this.frame = this.makeFrame(0);View on GitHub (pinned to 433685b202)