altimate-code
altimate-code copied to clipboard
Agent at its step cap ends with no answer on the Altimate gateway; capped subagent returns an empty result
Problem
An agent with a steps cap is meant to end with a text answer when it reaches the cap. On the Altimate gateway it can end with no answer instead, and a capped subagent then hands its parent an empty result.
- The request at the cap fails. At the last step the loop appends the
MAX_STEPSinstruction as a trailing assistant message and still sends every tool with notoolChoice. On the gateway this request fails withUnknownError "Could not get a response from the agent"and 0 tokens, so the session ends without an answer. - The cap counts loop iterations, not model requests. Iterations that run a compaction or a subtask also advance the counter, so an agent that compacts reaches its cap several requests early.
- An errored or silent subagent returns an empty result. The parent receives only the child's last text part, so a child that failed at its cap produces an empty
<task_result>with statuscompleted, which reads as "done, nothing found".
Expected
- At the step cap the final-answer instruction is sent as a user turn with no tools and
toolChoice: "none", and the agent answers in text. Ajson_schemarequest keeps its tools, since its answer is the structured-output tool call. - The cap counts model requests only.
- When a subagent produced no final text, the task result says so (and why, if it errored) and carries the child's last written text if there is any.