feat: retry Iron Loop executor on API overload (529) with configurable backoff#7
Open
davidbijl wants to merge 1 commit into
Open
feat: retry Iron Loop executor on API overload (529) with configurable backoff#7davidbijl wants to merge 1 commit into
davidbijl wants to merge 1 commit into
Conversation
…e backoff Implements three-layer recovery for HTTP 529 (API overloaded) errors during Iron Loop executor runs, resolving issue robotijn#6. Layer 1 — iron-loop-executor.md: adds explicit instructions for the executor agent to distinguish pre-write (safe to retry) from mid-write (human review required) overload events and write the appropriate status to the plan's .status file. Layer 2 — state layer: - background.js: adds overload-retry and overload-partial to the status enum, preserves retry_at timestamp in writeStatus, adds markOverloadRetry() and markOverloadPartial() helpers. - actions.js: cleanupStaleInProgress now skips overload plans; startAgent resumes an overload-retry plan in-progress instead of picking a new todo plan, and blocks with a human-gate error when an overload-partial plan exists. - state.js: getAgentStatus surfaces overload-retry / overload-partial from in-progress plan status files when no lock is held. Layer 3 — menu-screens.js: dashboard AGENT section shows ⏳ retry in Xm for scheduled retries and ⚠ partial write — review for mid-write overloads. Config — settings.js: adds retry.overloadIntervalSeconds (default 600s / 10 min). Tests — tests/overload-retry.test.js: 9 unit tests covering all three layers. 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 #6.
Summary
agents/iron-loop/iron-loop-executor.md): new API Overload (529) Handling section instructs the executor to distinguish pre-write overloads (safe to retry) from mid-write overloads (human gate required) and write the appropriate.statusfile.background.js,actions.js,state.js):overload-retryandoverload-partialadded to the status enum;cleanupStaleInProgressskips overload plans;startAgentresumes anoverload-retryplan in-progress instead of picking a new todo plan and blocks with a human-gate error foroverload-partial;getAgentStatussurfaces overload states when no lock is held.menu-screens.js): AGENT section shows⏳ retry in Xm — <plan>for scheduled retries and⚠ partial write — review: <plan>for mid-write overloads.settings.js): newretrycategory withoverloadIntervalSeconds(default 600 s / 10 min).tests/overload-retry.test.js): 9 unit tests covering all three layers (icon enum,writeStatusfields, cleanup skip logic,startAgentresume/block paths, dashboard labels, config schema).Answers to the open questions in #6
startAgentcall (Layer 2). NoScheduleWakeupdependency — the operator restarts via the menu when ready, or the executor can callScheduleWakeupif it's available in its context (the agent instructions mention it as optional).[x]checkboxes are on disk, so the executor can fast-forward past already-done steps. No separate step-marker mechanism is needed for a first pass.ScheduleWakeupavailability: treated as optional in the agent instructions — if available, use it; if not, exit cleanly. The dashboard indicator and the menu's Start Agent button serve as the manual resume path.cleanupStaleInProgress(now skips overload plans) andstartAgent(now checks in-progress before picking todo).Test plan
node --test tests/overload-retry.test.js— 9 tests, 0 failuresnode --test tests/*.test.js— existing suite passes (the 1 pre-existing failure inupdate.test.jsis unrelated to this PR and was failing onmainbefore these changes)overload-retrystatus file in a plan underplans/in-progress/, open/ctoc:menu, confirm the dashboard AGENT section shows⏳ retry in Xmoverload-partialstatus file, confirm⚠ partial write — reviewoverload-retryplan present, confirm the executor resumes that plan rather than picking a new todo plan🤖 Generated with Claude Code