Skip to content

fix: restore qualitative_retry_count propagation in bug implementation loop#74

Open
danchild wants to merge 1 commit into
forge-sdlc:mainfrom
danchild:fix/bug-workflow
Open

fix: restore qualitative_retry_count propagation in bug implementation loop#74
danchild wants to merge 1 commit into
forge-sdlc:mainfrom
danchild:fix/bug-workflow

Conversation

@danchild
Copy link
Copy Markdown
Contributor

@danchild danchild commented Jun 3, 2026

Fixes #73

Changes

src/forge/workflow/bug/graph.py

Added two BugState-typed wrapper functions (implement_bug_fix and bug_local_review_changes) that delegate to the shared implement_task and local_review_changes implementations. By annotating these wrappers with BugState rather than FeatureState, LangGraph includes qualitative_retry_count in the I/O schema for those nodes so the counter accumulates correctly across the loop.

src/forge/workflow/nodes/implementation.py

Fixed implement_task to return current_node = "implement_bug_fix" (the graph node name) instead of "implement_task" (the Python function name) in all three return paths. This ensures route_entry correctly resumes from the implementation stage when forge:retry is applied.

…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>
@danchild danchild marked this pull request as ready for review June 3, 2026 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: infinite implement→review loop and forge:retry triage restart in bug workflow

1 participant