Tool result pruning and image offload
A long chat has to stay inside what the model can read. Two steps help when it no longer fits: DataMind Oda trims oversized tool results, and it sets aside images the request has no room for. Both are part of how Oda works by default, and both change only what the model receives; the chat keeps everything. For when Oda condenses a chat in the first place, see Chat compaction.
Trimming oversized tool results
A tool result is what a tool handed back to Oda: the text of a file it read, the matches of a search, or a command's output.
- When Oda condenses a long chat, it first trims oversized tool results out of the request, before the older history is summarised. The trimming runs only at that point, when the chat crosses the compaction threshold or a request fails because the context no longer fits.
- A result whose text is longer than the trimming limit is replaced, for the model, by its kept start, the marker
[... tool result middle pruned ...], and its kept end.
- Only the text is measured, and only the text changes: images and structured content inside the result keep their places, and the tool call, its step, its errors and its other details stay as they were.
- The full original stays in the chat log on this computer, so nothing is lost. Later requests show the shortened form, and the model never receives a second copy of the removed text. Chat logs on disk shows where those logs live.
- Nothing is trimmed in a chat that has not reached the condensing point, and the trimming itself makes no model call.
- After trimming, Oda measures the request again. When the shortened results have brought the request back within the chat's room, that round needs no summary; otherwise the summary runs as usual.
The trimming limits
All three limits are optional, and their defaults are:
| Limit | Default | What it decides |
|---|
thresholdChars | 8192 | How long a result's text may be before it is trimmed, counted in characters. |
headChars | 4096 | How much of the start of a result is kept, counted in characters. |
tailChars | 1024 | How much of the end of a result is kept, counted in characters. |
- The counts are characters. Characters and tokens are different measures, so after a trim Oda measures the request again to decide what happens next.
- The kept start, the marker and the kept end together must fit inside the trimming limit; a combination where they do not is refused.
- The trimming limit must be a whole positive number, and the kept start and end must be whole numbers that are not negative. A setting Oda does not recognise is refused too, and the message names the three it allows.
- The limits are part of Oda's settings for this computer. The profile settings file shows where those settings live and when to edit them.
- The cut counts characters, so it never lands inside one; a symbol built from several characters, such as some emoji, can still come apart.
- If a trimmed result cannot be recorded, that pass fails, and every result already trimmed in it stays trimmed.
When a request runs out of room for images
A model takes only so many images, or so many bytes of images, in one request. When a request goes past that, Oda sets the oldest of the images it holds aside and sends the request again. The limits themselves, and the notes a request carries, are in Image and file limits in requests.
- For each image set aside, the model receives a short note in place of the picture. The note names the image and gives the path of a read-only copy on this computer when one is available, so you can attach it again if you need it.
- Nothing is set aside in advance: the model's refusal is the signal, so each set-aside round starts with one failed attempt, and then the request goes again.
- That retry repairs what the request carries instead of repeating the call, so it spends none of the model call's retries. How calls fail and retry is in Model calls and failures.
- Setting an image aside is permanent. A larger limit, a different model or a later condensing round does not bring it back; even a one-off tight limit sets images aside for good.
- Each further round can set aside more of the oldest images until the request fits. When no image is left to set aside, the request still fails and the turn reports an error.
- The chat keeps every image you attached, and the set-aside choice stays with the chat, so resuming it later does not return those images to the model.
Questions, answered
What does [... tool result middle pruned ...] mean?
It is the marker Oda puts where it removed the middle of a long tool result to make room in the chat. The kept start and the kept end of the result appear around it in what the model receives.
When does Oda trim tool results?
Only when the chat reaches the point where Oda condenses it: the trimming happens as part of that round, before the older history is summarised. A shorter chat keeps its tool results untouched, and the trimming makes no model call of its own. Chat compaction covers when the condensing starts.
Is the full tool result lost when it is trimmed?
No. The full original stays in the chat log on this computer; only what the model receives is shortened, and the model never gets a second copy of the removed text. Chat logs on disk shows where the logs live.
What happens to images and other content inside a trimmed result?
They stay. Trimming measures and changes only the text of a result; images, structured content, the tool call, its errors, its step and its other details keep their places.
Can I change the trimming limits?
Yes. The three limits are part of Oda's settings for this computer, with defaults of 8,192 characters for the trimming limit, 4,096 for the kept start and 1,024 for the kept end. The profile settings file shows where those settings live and when to edit them.
Why does a cut land in the middle of a word or symbol?
The limits count characters, not words, so a cut can fall anywhere between them. It never lands inside a single character, but a symbol built from several characters, such as some emoji, can still come apart.
After trimming, does Oda still summarise the chat?
Oda measures the request again. When the shorter results have brought the request back within the chat's room, that round needs no summary; otherwise the summary runs as usual.
Why did a call fail over images and then go through?
The model refused the request because it carried more images, or more image bytes, than the model accepts. Oda set the oldest images aside and sent the request again. Oda cannot set images aside in advance: the refusal is the signal, so each set-aside round starts with one failed attempt.
Do images that were set aside come back to the model?
No. A set-aside image stays out of the model's requests for good: a larger limit, a different model or a later condensing round does not return it. The chat keeps the image, and the note gives the path of a read-only copy, so you can attach it again if you need it.
Does the set-aside retry use up the call's retries?
No. The retry repairs what the request carries instead of repeating the call, so it spends none of the model call's retries. How calls fail and retry is in Model calls and failures.
What happens when there are no images left to set aside?
The request still fails, and the turn reports an error. Each set-aside round can remove only the images that remain, so a request that stays too large ends this way.