deferred_tool_results may arrive with a non-empty prompt, so the absence of a prompt cannot be the only test for a resumption. Reproduced: resuming a live question that way replaced its search result with the earlier-question notice while the deferred result arrived alongside it. _is_resumption accepts either signal — no prompt, or a history ending with a request the model has not answered or a response whose tool calls have no returns. A settled history ends with the previous answer, so a genuinely new question is unaffected. A new prompt on top of an unanswered tail is ambiguous and now counts as a continuation: compacting costs the answer if it is one, while not compacting only costs a larger request. |
||
|---|---|---|
| .. | ||
| rag | ||