Hmbown/CodeWhale · error · Error

Pet checkpoint exceeds its size limit.

Error message

Pet checkpoint exceeds its size limit.

What it means

The `browser` tool's `navigate` action requires a non-empty string `url` — unlike `start`, navigation has no default destination. Missing, null, non-string, or whitespace-only url values throw this error.

Solutions

  1. Provide a non-empty string url, e.g. {action:"navigate", url:"https://example.com"}.
  2. Trim-check the value at the call site: if (!url || !url.trim()) skip the call or fix the source.
  3. If the intent was 'open the default page', use action "start" instead of "navigate".

Example fix

// before
resolveTool("browser", { action: "navigate" });
// after
resolveTool("browser", { action: "navigate", url: "https://example.com" });
Defensive patterns

Strategy: validation

Validate before calling

if (typeof url !== "string" || !url.trim()) {
  throw new Error("navigate requires a non-empty url string");
}

Type guard

const isNavigableUrl = (u) => typeof u === "string" && u.trim().length > 0;

Prevention

When it happens

Trigger: resolveTool("browser", {action:"navigate"}) with no url, url: undefined/null, url: 123, or url: " " (blank after trim).

Common situations: A model forgetting the url field when it intends 'go back to the site'; url interpolated from an undefined variable producing undefined; copying the start-action shape (where url is optional) for navigate; trailing-whitespace url from a template.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of Hmbown/CodeWhale@73e0f67d83 (2026-09-22). Data as JSON: /api/errors/537a854f989f23f7. Report an issue: GitHub.

Appendix: source

Thrown at crates/tui/src/tui/pet_watch/pet-native.js:71

    accept(packet) { this.world.acceptTelemetry(JSON.parse(packet)); }
    acceptLiveTail(text) {
        const packet = this.liveTape.readTail(text);
        if (!packet)
            return false;
        this.world.acceptTelemetry(packet);
        return true;
    }
    resetLiveInput() { this.liveTape.reset(); return this.resumeEngine(); }
    recording(withCheckpoint = false) { return JSON.stringify(this.world.recording(withCheckpoint)); }
    needsSegment() { return this.world.needsSegment; }
    prepareSegment() { this.segment = this.world.prepareSegment(); return JSON.stringify(this.segment.recording); }
    commitSegment() { if (!this.segment)
        throw new Error('No pet segment was prepared.'); this.segment.commit(); this.segment = undefined; }
    checkpoint() { return JSON.stringify(this.world.checkpoint()); }
    recordingChunk(index, completed = false) { return this.world.recordingChunk(index, completed); }
    restoreCheckpoint(text) {
        if (text.length > 512 * 1024)
            throw new Error('Pet checkpoint exceeds its size limit.');
        this.restoreRecording(JSON.stringify({ ...this.world.recording(false), checkpoint: JSON.parse(text) }));
    }
    restoreRecording(text) {
        if (text.length > 8 * 1024 * 1024)
            throw new Error('Native habitat exceeds 8 MiB.');
        const points = this.world.sim.p.map(p => [p.hx, p.hy]);
        this.world = pet_world_js_1.PetWorld.fromRecording(points, JSON.parse(text));
        this.liveTape.reset();
        this.segment = undefined;
        this.engineTick = Math.round(this.world.frame.timeMs * 30 / 1000);
        this.engine = new pet_engine_js_1.PetEngineTelemetry();
    }
    /** Resume a live host at the first unrecorded bucket. Keep every accepted
     * interval, but never present its last observed frame as current evidence. */
    resumeEngine() {
        this.world.resumeObservation();
        this.engineTick = Math.round(this.world.frame.timeMs * 30 / 1000);
        this.engine = new pet_engine_js_1.PetEngineTelemetry();

View on GitHub (pinned to 73e0f67d83)