Ability to resume after an error instead of restarting
This is a crucial feature, especially for large codebases. Currently, if a script encounters an error during execution, a significant amount of work (and potentially many requests) is lost because the entire process has to be restarted from scratch.
It would be extremely helpful to have the option to resume execution from the point where the error occurred. This would prevent losing all the progress made and wasting the resources already consumed.
Hey @JustBugReporting Currently there are 2 mechanisms that prevent restart from scratch:
-
Each node has retry and wait. E.g., for https://github.com/The-Pocket/Tutorial-Codebase-Knowledge/blob/32928a1e2ec1382d170a5bdec527496df8c56053/flow.py#L17
On fail, each node will wait for 10s and retry up to 3 times.
-
The LLM call (the most expensive part) is cached so, if crash occurs, the call won't rerun but will use the previous results. Kind of like resuming. https://github.com/The-Pocket/Tutorial-Codebase-Knowledge/blob/32928a1e2ec1382d170a5bdec527496df8c56053/utils/call_llm.py#L29
In my case, it seems like it starts over from the beginning every time, instead of continuing from where it left off. Because of this, I haven't managed to generate the documentation even once.
Here's what I've done so far:
- Added the Gemini API key from AI Studio.
- Increased the retry settings everywhere (set
max_retries=6, wait=20).
Every time I run the script, it works for some time and then hits a 429 RESOURCE_EXHAUSTED error, causing the process to stop. When I restart it, the exact same thing happens: it runs for some time , then fails with that error.
Could you add more detailed logging? It would help to see what's happening with the cache (e.g., when it's being written to and read from) and when reconnection attempts are made after an error, etc.
Currently, the log only shows 6 lines of Identifying abstractions using LLM... followed by the 429 error every time I try, so I can't even verify if the cache was used.
I’ve been getting this error too after working originally. I was trying to run it on my own repo too, I assumed it was a Gemini rate limiting thing. I have a paid GCP so I’ve tried that and it doesn’t work there either.
The 429 RESOURCE_EXHAUSTED is an error from the Gemini side.
Could you double check if python utils/call_llm.py works?
Maybe try to further increase the retry settings? Set them to max_retries=10, wait=60.
For where the cache is, can you see a file llm_cache.json in the base directory?
The 429 RESOURCE_EXHAUSTED is an error from the Gemini side.
Yeah, I know. And since this error happens on their end quite often, even when the limit isn't actually exhausted, I'd hope the script to be able to handle it correctly when it occurs.
Could you double check if python utils/call_llm.py works?
Yep, I checked that before starting the document generation. Got a successful response from the LLM, nothing unusual.
Maybe try to further increase the retry settings? Set them to max_retries=10, wait=60.
I'll try that.
For where the cache is, can you see a file llm_cache.json in the base directory?
No, I don't have a file like that. Caching is enabled, though, as far as I understand (I didn't change anything in the code regarding that). And the LLM request log file is 47 MB.
I have the same The 429 RESOURCE_EXHAUSTED problem.
Maybe try to further increase the retry settings? Set them to max_retries=10, wait=60.
Done. Issue persists.
For where the cache is, can you see a file llm_cache.json in the base directory?
No, I don't have a file like that. Caching is enabled, though, as far as I understand (I didn't change anything in the code regarding that). And the LLM request log file is 47 MB.
For cache, did you see this warning?
https://github.com/The-Pocket/Tutorial-Codebase-Knowledge/blob/32928a1e2ec1382d170a5bdec527496df8c56053/utils/call_llm.py#L37
I have the same The 429 RESOURCE_EXHAUSTED problem.
Maybe try to further increase the retry settings? Set them to max_retries=10, wait=60.
Done. Issue persists.
I don't really know what's going on... Just curious, how large is your repo? Maybe the TPM limit is being hit? https://ai.google.dev/gemini-api/docs/rate-limits
Try Gemini 2.5 Pro Preview instead of Gemini 2.5 Pro Experimental?
replace:
https://github.com/The-Pocket/Tutorial-Codebase-Knowledge/blob/32928a1e2ec1382d170a5bdec527496df8c56053/utils/call_llm.py#L55
gemini-2.5-pro-preview-03-25?
@zachary62 yes, this is about the model side. After careful inspection, I excluded all the directories that files that project doesn't need and bring it down to 50 files and it worked. Thank you. Great work btw. Thank you for providing this.
hi all
At first time I facedthe same issue 429
But after running it with option "--max-size 10000" (or whatever number you can specify), it helped me to resolve the issue