Repository navigation
fix(paper2code): keep model wait out of the stall check - #321
Open
chuenchen309 wants to merge 1 commit into
Open
chuenchen309 wants to merge 1 commit into
chuenchen309 wants to merge 1 commit into
Conversation
The kernel refactor (df4127d) dropped the note_llm_wait() calls that 3040e80 added around each model request, so the implementation loop counts a slow model round-trip as five minutes without progress and aborts the run. The detector is also built with the workflow, so the file-tree phase that runs before the loop counts against it too. Call note_llm_wait() from the implementation hook around every model request, and reset the stall clock when the loop starts.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The Paper2Code implementation loop aborts with "Progress stall: No progress for 300s" whenever a single model call takes longer than five minutes. 3040e80 added
LoopDetector.note_llm_wait()and called it after every model request in the old hand-rolled loop so slow round-trips would not count as a stall. The move toAgentRunnerin df4127d removed those calls and nothing callsnote_llm_wait()now, so the time spent waiting on the model counts against the stall budget again.The same clock also starts when the workflow is constructed, so the LLM-driven file-tree step that
run_workflowruns before the implementation loop counts too. If that step takes over five minutes, the run stops at the first pre-LLM check with zero files written.Related Issues
None found.
Changes Made
_ImplementationHooktimes each model request (before_model_requesttoon_model_response) and passes the elapsed time tonote_llm_wait()._run_kernel_implementationresets the stall clock right before the runner starts.Additional Notes
Two tests in
tests/test_unified_impl_workflow.py: one uses a provider that sleeps longer than a loweredstall_thresholdon each call, the other backdates the detector's clock past the threshold before the loop starts. Both fail on main with the stall abort and pass with this change;test_unified_impl_workflow.pyandtest_loop_detector.pypass (30 tests).pre-commit run --all-filespasses. Fullpython -m pytest -qon Linux, Python 3.12: 3371 passed, 6 failed. The 6 failures (test_ci_scope.pyx4,test_loop_cli.py::test_loop_cli_completes_through_the_model_goal_tool,test_shell_search_tools.py::test_bash_large_output_spilled) fail the same way on a clean checkout of bfe34b6.