Skip to content

fix: increment retry_count when prepare_workspace fails#196

Open
danchild wants to merge 2 commits into
forge-sdlc:mainfrom
danchild:fix/unbounded-retry-loop
Open

fix: increment retry_count when prepare_workspace fails#196
danchild wants to merge 2 commits into
forge-sdlc:mainfrom
danchild:fix/unbounded-retry-loop

Conversation

@danchild

@danchild danchild commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Fixes #178

Summary

  • The prepare_workspace() exception handler in implement_task set last_error but never incremented retry_count
  • The routing function checks retry_count >= max_retries (3) to escalate, but since retry_count stayed at 0, the loop never broke
  • Observed 404 retry iterations in ~20 seconds in production (AISOS-2273)
  • Fix: add retry_count increment to match the pattern used by other exception handlers in the same file

Test plan

  • Existing unit tests pass (tests/unit/workflow/nodes/test_implementation.py — 12/12)
  • Verify in a live workflow that workspace setup failures escalate after 3 retries instead of looping

🤖 Generated with Claude Code

The prepare_workspace exception handler set last_error but never
incremented retry_count, so the routing function's retry_count >=
max_retries check never triggered — causing an unbounded retry loop.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds a test that starts with retry_count=1 and asserts it becomes 2
after a prepare_workspace failure, ensuring the routing function can
break the loop after max_retries.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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: implement_task workspace prep failure loops infinitely (no retry_count increment)

1 participant