# Atlas error: Assistant hit the output length limit (MessageOutputLengthError)

> Ask for the work in smaller pieces, or use the edit or apply_patch tools instead of having the model print an entire file.

Atlas cuts the assistant reply off and attaches a MessageOutputLengthError because the provider stopped generation on max output tokens, which Atlas maps to the OutputLengthError named error. Fix it by asking for the work in smaller pieces or asking the model to continue from where it stopped, by preferring the edit or apply_patch tools over having the model print an entire file, by picking a model with a larger max output if the task genuinely needs one long response, and by reducing verbosity in your prompt so the budget is spent on the answer.

## Symptom

The assistant reply is cut off mid-thought and the message carries a MessageOutputLengthError instead of finishing normally. Nothing is malformed, the response simply stops before it is complete.

## Cause

The provider stopped generation because it reached max output tokens. Atlas maps that stop reason to the OutputLengthError named error, which is part of the shared message error union rendered in the TUI, so the truncated message is shown with the error attached.

## Fix

1. Ask for the work in smaller pieces, or ask the model to continue from where it stopped.
2. For file changes, prefer the edit or apply_patch tools over having the model print an entire file.
3. Pick a model with a larger max output if the task genuinely needs one long response.
4. Reduce verbosity in your prompt so the budget is spent on the answer, not preamble.

## Why does the Atlas assistant reply get cut off

An Atlas assistant reply gets cut off when the provider stops generation on max output tokens. Atlas maps that stop reason to exactly 1 named error, OutputLengthError, so the message carries a MessageOutputLengthError instead of finishing normally. The model ran out of output budget mid-answer.

MessageOutputLengthError is about the response, not the request. The prompt was accepted, generation started, and the provider halted because the reply hit its maximum output tokens. Atlas turns that stop reason into the OutputLengthError named error, which is part of the shared message error union rendered in the TUI, so you see the partial reply with an error attached rather than a silent truncation. That distinction matters when you are debugging: an output length failure means the model was answering and simply ran out of room, so the correct response is to make the answer smaller or the output budget bigger.

## How do I fix MessageOutputLengthError in Atlas

Step 1 of the documented fix is to ask for the work in smaller pieces, or ask the model to continue from where it stopped. Both keep any single response inside the provider's max output tokens, the exact limit that triggered OutputLengthError and cut the Atlas reply short.

Splitting the request is the most reliable fix because it directly reduces the size of each response. Ask for one module, one function, or one file at a time rather than the whole change in a single reply. Asking the model to continue from where it stopped also works and preserves the partial output you already have, so nothing is wasted. Neither approach requires changing providers or models. If the task keeps producing truncated replies even after being split, the requests are still too large individually and should be broken down further before you try a model with a larger max output.

## Use edit or apply_patch instead of printing whole files

Step 2 of the documented fix is to prefer the edit or apply_patch tools over having the model print an entire file. Printing a full file spends the whole max output token budget on content Atlas already has, which is the fastest way to trigger MessageOutputLengthError on a large source file.

The edit and apply_patch tools change the economics of a file modification. Instead of regenerating the whole file into the response, the model emits only the change, so the output budget is spent on the delta. Atlas computes a unified diff for every file edit and surfaces it for approval before writing, so you still see exactly what changed before it lands on disk. Atlas also snapshots file changes as git patches so edits can be diffed and rolled back. That means using edit or apply_patch costs you nothing in review quality while removing the single largest source of output length failures.

## When to pick a model with a larger max output

Step 3 of the documented fix is to pick a model with a larger max output when the task genuinely needs 1 long response and cannot be split. Atlas lets you switch the active model and provider on the fly with favorites and recents, so the change is quick.

Some responses really do have to be one continuous artifact, and forcing them into pieces creates more work than it saves. A model with a larger max output is the right tool for those. The caveat is worth stating plainly: a larger output budget raises the ceiling, it does not remove it. Atlas will still map a stop on max output tokens to the OutputLengthError named error at the new limit. Treat the model change as headroom for a specific long-form task, and keep the edit and apply_patch tools as the default for file changes regardless of which model is active.

## How prompt verbosity wastes the output token budget

Step 4 of the documented fix is to reduce verbosity in your Atlas prompt, because the output budget is finite. Asking for preamble, restatements, and long explanations spends max output tokens on framing rather than on the answer, so the real content is what gets truncated when OutputLengthError fires.

The provider's max output tokens covers everything the model writes, including the parts you did not actually need. A prompt that invites the model to explain its reasoning at length, summarize the request back to you, and then produce the code will spend a meaningful share of the budget before the code starts. Say what you want and ask for it directly. Atlas drafts a plan in a read-only plan agent and asks before switching to a build agent, so you already have a dedicated place for planning discussion. Keep the build responses tight and the output budget goes to the work.

## How to verify the output length fix worked

Verify the MessageOutputLengthError fix by re-running the request and watching for a reply that completes normally with 0 errors attached. In Atlas, a completed message means the provider did not stop on max output tokens, so no OutputLengthError was mapped into the shared message error union.

Verification is visual and immediate in the Atlas TUI. OutputLengthError is part of the shared message error union rendered in the TUI, so a message that finishes without that error banner is a message that stayed within the provider's max output tokens. Re-send the smaller request, or the continue-from-here request, and check that the reply ends cleanly rather than mid-sentence. If a truncation returns, split the work further, move file changes to the edit or apply_patch tools, and only then consider a model with a larger max output.

## FAQ

### how to fix MessageOutputLengthError in atlas

Ask for the work in smaller pieces or ask the model to continue from where it stopped. For file changes, prefer the edit or apply_patch tools over having the model print an entire file, and reduce verbosity so the output budget goes to the answer.

### why did atlas stop writing code halfway through

The provider stopped generation on max output tokens, and Atlas mapped that to the OutputLengthError named error. The reply is truncated and carries a MessageOutputLengthError instead of finishing normally.

### atlas assistant reply cut off mid sentence

A reply cut off mid sentence with a MessageOutputLengthError means the provider hit its maximum output tokens. Ask the model to continue from where it stopped, or split the request into smaller pieces.

### should I use edit or apply_patch instead of printing a whole file in atlas

Yes. For file changes in Atlas, the edit and apply_patch tools emit only the change instead of regenerating an entire file, which keeps the response inside the provider's max output tokens and avoids OutputLengthError.

### does a model with a larger max output fix output length errors permanently

A larger max output raises the ceiling but does not remove it. Atlas still maps a stop on max output tokens to the OutputLengthError named error at the new limit, so splitting the work remains the durable fix.

### can I ask atlas to continue after an output length error

Yes. Asking the model to continue from where it stopped is one of the documented fixes for MessageOutputLengthError in Atlas, and it preserves the partial output you already received.

### does prompt length cause MessageOutputLengthError in atlas

MessageOutputLengthError is about the response, not the prompt. The provider stopped on max output tokens while generating. A verbose prompt still contributes, because it invites longer preamble that spends the output budget before the answer.

---

Canonical HTML: https://runatlas.sh/resources/troubleshooting/message-output-length-exceeded
Source of truth: aeo_pages row `/resources/troubleshooting/message-output-length-exceeded` (segment: Troubleshooting) (this file is generated from it, never hand-edited).
Licence: Atlas is proprietary with a free core. It is not open source and there is no public source repository.
