Summary
A run can complete its substantive work and verification but still end as stalled because every step in maxSteps is available for another tool call. If the model uses the final step for a tool rather than reply/finish, Atomic immediately emits a synthetic max-steps message and never gives the model a chance to produce the requested evidence summary.
In a 50-step coding trial on Atomic Agent v0.1.72, the agent ran the full test suite successfully at steps 48 and 49, repeated it, and ended with:
max_steps_reached: 50 steps without reply
The implementation was close to complete, but the session status was stalled and the requested final report was lost. Current v0.1.73/main still uses this terminal behavior.
Current behavior
When the loop reaches the budget, agent-loop.ts inserts:
(stopped: max_steps reached without a reply)
and records the session as stalled. That is honest failure reporting, but it does not provide a final-response opportunity after the last tool result.
Expected behavior
Atomic should reserve or force a final-response opportunity before tool execution consumes the entire step budget. A successful long run should be able to summarize completed work, tests, remaining risks, and blockers even when only one step remains.
Suggested implementation
One bounded approach:
- Treat the last allowed inference as a finalization step.
- Inject a clear instruction that no further non-terminal tools may be called.
- Expose only
reply/finish, or run a completion path that cannot execute more tools.
- If finalization itself fails or returns no usable text, preserve the existing synthetic stalled outcome.
This keeps the budget bounded while separating "work steps" from the final user-visible report.
Acceptance criteria
- A deterministic test model that emits non-terminal tools until one step remains receives a finalization opportunity.
- The finalization step cannot execute another filesystem, shell, browser, network, or memory tool.
- A valid final reply is recorded as the natural turn outcome rather than
max_steps/stalled.
- The final prompt includes the most recent tool result so the summary can report verification evidence.
- If the provider fails or still produces no final text, Atomic retains an explicit stalled/max-steps outcome rather than claiming success.
- Cancellation semantics and ordinary early
reply/finish behavior remain unchanged.
Summary
A run can complete its substantive work and verification but still end as
stalledbecause every step inmaxStepsis available for another tool call. If the model uses the final step for a tool rather thanreply/finish, Atomic immediately emits a synthetic max-steps message and never gives the model a chance to produce the requested evidence summary.In a 50-step coding trial on Atomic Agent v0.1.72, the agent ran the full test suite successfully at steps 48 and 49, repeated it, and ended with:
The implementation was close to complete, but the session status was
stalledand the requested final report was lost. Current v0.1.73/main still uses this terminal behavior.Current behavior
When the loop reaches the budget,
agent-loop.tsinserts:and records the session as
stalled. That is honest failure reporting, but it does not provide a final-response opportunity after the last tool result.Expected behavior
Atomic should reserve or force a final-response opportunity before tool execution consumes the entire step budget. A successful long run should be able to summarize completed work, tests, remaining risks, and blockers even when only one step remains.
Suggested implementation
One bounded approach:
reply/finish, or run a completion path that cannot execute more tools.This keeps the budget bounded while separating "work steps" from the final user-visible report.
Acceptance criteria
max_steps/stalled.reply/finishbehavior remain unchanged.