Again today a history became too long and deleted itself while it was in a process. The process though canceled continued to loop until it had consumed all tokens even though it had been canceled and claimed it had errored out.
How do we get tokens back when the system erroneously uses all of them and the agent encounters a runaway tool-calling loop (specifically view_file on api.py) that causes it to rapidly consume context tokens before crashing, even though it displays as canceled.