← All notesA red semi truck driving under a highway bridge

Notes / RLM-Labs.ai

The prompt outgrew the model

Every tier declares its real window; an absent limit never means skip the check.

On 31 July 2026 at 20:27 UTC, a run writing specification documents for a large Java codebase sent the model a prompt of 264,934 tokens. The model's window holds 262,144. The provider refused the request:

"Invalid request: Your request exceeded model token limit: 262144 (requested: 265529)"

The run ended there with an error and no answer. The run was session 81e51c61, the same session whose final answer the guard rejected the next morning at 24 of 25.

Nothing about this failure was the model's fault. The model never saw the request. I built a prompt too big for the model, and I sent the prompt anyway. Like carrying a package to a door you already know is locked.

Two things let the prompt grow. After each finished task, Merlin compacts the conversation, keeping the working state and folding the history away. The rule skipped compaction whenever there had been recent errors. After the last compaction at 20:12, the next five finished tasks all had recent errors, so all five compactions were skipped. The prompt went from 24,030 tokens to 255,706 in fourteen minutes.

The second thing let the prompt leave the building. Prompts over 49 percent of the local model's window are escalated to a larger cloud model, and 114 of the session's 117 model calls went there. Merlin checks every prompt against the window of the model about to receive the prompt, and compacts or refuses before sending. For the escalation tier, I had left the window unset on purpose. My specification recorded the reasoning: the provider owns its limits. An unset window read as zero, and a zero window switched the check off. So a request certain to fail went out, the refusal came back, and the run ended in a state no resume was able to recover.

The run had paused itself at its token budget at 19:45 local time, and five resume attempts each stopped again immediately before the sixth ran. The crash came at 23:27 local. The first hour was spent debugging why we kept exhausting the budget, and then we realized the problem: we are an RLM orchestration engine, of course the prompts are going to grow with each turn. The first thing was we doubled the budget and kicked off another run. Then we implemented context compiling and summarization to remove repeated context from the prompt.

The fixes went in overnight. The escalation tier now declares its real window, 262,144 tokens, so the check runs on every call. A failed run is now re-armed from its last checkpoint on request instead of being lost.

At 06:36 UTC the run resumed from its checkpoint. Two minutes later, before any model call, the check fired: the prompt stood at 261,331 tokens against the 262,144-token window, with 24,576 reserved for the answer. Merlin compacted the prompt to 25,648 tokens and carried on. Half an hour later the run produced the 24-of-25 answer the guard rejected.

A limit left unset is not an unlimited limit. In my code, absent meant skip the check, so one missing line in a configuration file switched off a safety rule, and nothing reported the switch. I had written "the provider owns its limits" in the spec as if the provider would also own the consequences.

The test: for every limit your system reads from configuration, find what an absent value does in the code. If absent means "skip", delete the value in a test environment and send a request one token over the real limit. See whether anything stops the request before the provider does.

Source: session 81e51c61 from my logs, and Spec 009 data model and plan, amended 1 August 2026 (commit 7d0accf92).