fix: restore qualitative_retry_count propagation in bug implementation loop#74
Open
danchild wants to merge 1 commit into
Open
fix: restore qualitative_retry_count propagation in bug implementation loop#74danchild wants to merge 1 commit into
danchild wants to merge 1 commit into
Conversation
…n loop LangGraph filters state channels based on the type annotation of each node function. implement_task and local_review_changes are both typed as FeatureState, which does not define qualitative_retry_count (a BugState-only field). As a result, LangGraph silently stripped that key from state inputs and outputs for both nodes — writes to qualitative_retry_count from local_review_changes were never checkpointed, and the counter always read as absent (defaulting to 0) on every cycle. This caused an infinite implement → qualitative-review → implement loop after plan approval. The fix is two BugState-typed wrapper functions in build_bug_graph that delegate to the shared implementations. By annotating the wrappers with BugState, LangGraph includes qualitative_retry_count in the I/O schema for those nodes, so the counter now accumulates correctly across the loop. Also fix implement_task returning current_node = "implement_task" (the Python function name rather than the graph node name "implement_bug_fix") in all three return paths. This mismatch caused route_entry to log an unrecognized node warning and restart from triage whenever forge:retry was applied while the workflow was in the implementation stage. Signed-off-by: Dan Childers <dchilder@redhat.com> Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Fixes #73
Changes
src/forge/workflow/bug/graph.pyAdded two
BugState-typed wrapper functions (implement_bug_fixandbug_local_review_changes) that delegate to the sharedimplement_taskandlocal_review_changesimplementations. By annotating these wrappers withBugStaterather thanFeatureState, LangGraph includesqualitative_retry_countin the I/O schema for those nodes so the counter accumulates correctly across the loop.src/forge/workflow/nodes/implementation.pyFixed
implement_taskto returncurrent_node = "implement_bug_fix"(the graph node name) instead of"implement_task"(the Python function name) in all three return paths. This ensuresroute_entrycorrectly resumes from the implementation stage whenforge:retryis applied.