Agent long tasks and big files
How the Ingot agent finishes long tasks on big files, and why it always tells you what happened instead of stopping without a word.
Never silent
- Cut-off replies continue. When a reply hits the model's output limit partway through, the agent picks up where it stopped. The chat shows one joined reply.
- Cut-off tool calls are sent back, not run. A tool call whose arguments were cut off never runs with missing values. The agent is told what happened and sends the call again with shorter arguments.
- Empty replies are asked again with a shorter history, up to Ask again after an empty or stalled reply times. See Reply recovery.
- Every later request is smaller after an empty reply. Cheap models often answer a long conversation with an empty or cut-off reply. The agent then halves what it sends (older turns compacted, long tool results cut with a note on how to read the rest) and keeps it that small for the rest of the run, so it never sends the same oversized request again. A second empty reply halves it again. The chat says so once.
- Before giving up, a fresh context. If empty replies keep coming, the agent continues once in a fresh context from a summary of the task before it stops and tells you what failed.
- Every run ends with a word. When a run stops on an error, on the tool round limit or with no reply at all, it ends with a run summary: the files it changed, what the checks said and what is not finished.
Big files
- When the agent reads a long file without asking for lines, it gets an outline first: functions, classes, types, tests and headings, each with its line number, plus the first lines of the file. Then it reads only the part it needs.
ingot/edit_filechanges part of a file, by its exact current lines or by a line range. It never rewrites the whole file.- After each edit the agent reads the changed lines back as they now read.
- If the lines it gave do not match the file, it gets the closest lines in the file, with line numbers, and tries again. REPLACE blocks that do not match get the same hint.
Long tasks
- Older turns are compacted before the conversation fills the working context, at 60% by default. The task, the latest turns, the files read and changed, the plan and the check results are kept in "mission notes". The chat says when this happens. When even the latest turns are too big, their tool results are cut too, each with "showing N of M lines" and how to read the rest.
- The working context is the smaller of the model's advertised window and Working context (200k tokens by default). A model that advertises a million tokens does not give good answers at a million tokens, so compaction and fresh context measure against what the agent can really use.
- Near the limit, a fresh context. At 80% of the working context the run continues in the same chat from a summary (goal, plan, done steps, files touched, open failures, next step). See Fresh-Context Auto-Handoff.
- Attached files are never cut silently. A big file you attach with
@says which lines were attached and how to read the rest. - Long tool output is capped to its first and last lines. A note says "showing N of M lines" and tells the agent how to ask for more.
For a goal that takes several steps, a mission plans the work, runs your checks after every step and ends with a pull request.
Background processes
Dev servers and watchers run in the background.
ingot/process_outputreturns only the output that is new since the agent last read it (at most the last 80 lines of it).- It can wait up to 60 seconds for new output, or for a line that matches a pattern such as
ready|compiled. - The agent stops a server with
ingot/process_stop, so it never waits on a server that does not exit.
Open files
When the agent changes a file that is open in an editor, you no longer get "changed on disk, but the editor has unsaved edits". As long as you have not typed in that editor, the buffer counts as the agent's: the agent's save finishes first, then the editor reloads quietly.
Settings
Under Settings › Agent tools:
| Setting | Default |
|---|---|
| Replies › Continue replies cut off by the output limit | On |
| Replies › Shrink the conversation after an empty reply | On |
| Long tasks and big files › Read long files as an outline first above (lines) | 300 |
| Long tasks and big files › Compact older turns before the context fills up | On |
| Long tasks and big files › Compact at this share of the context window (%) | 60 |
| Long tasks and big files › Working context: most tokens the agent plans for | 200000 |
Settings › Features and the first-run setup list three entries: Agent never goes silent, Long tasks keep their context and Smaller requests after an empty reply.
Rex
Rex runs on the server get the same protections: an empty turn, or one the output limit cut off, is asked again and never ends the run as "done"; the second time older tool results are compacted; long runs are compacted and continue in a fresh context; and a run that still gets only empty replies ends with a plain message saying what changed and what the checks said. It is on by default; the agent.emptyReplyRecovery switch of Rex's settings turns it off.
The desktop app and the browser work the same way.