fix(workflow-executor): retry 404 in markSucceeded/markFailed (PRD-392)#1595
Merged
Scra3 merged 8 commits intoMay 27, 2026
Merged
Conversation
…le eventual consistency Server may return 404 on updateActivityLogStatus called too quickly after createActivityLog — the record is not yet visible on the read path. Add retry404 option to withRetry (default false, only active for mark methods). Also removes misleading "after retries" suffix from error log labels. fixes PRD-392 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…istency Simpler than a per-caller flag: 404 is now retried everywhere. Callers that hit a genuine 404 still get the error after exhausting retries. fixes PRD-392 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Coverage Impact This PR will not change total coverage. Modified Files with Diff Coverage (2)
🛟 Help
|
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…reatePending) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…, stronger assertions, createPending 404 test Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…re critical Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…failure Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
matthv
approved these changes
May 27, 2026
…raRetryStatuses Eventual consistency: updateActivityLogStatus can 404 when called immediately after createActivityLog (record not yet visible on read path). Pass extraRetryStatuses: [404] to withRetry only for mark calls — createPending 404 stays a hard failure. 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.

Summary
withRetrygains an optionalretry404flag (defaultfalse) — when true, 404 responses are treated as transient and retried with the existing 100/500/2000 ms backoffmarkSucceededandmarkFailedpassretry404: trueto absorb eventual-consistency 404s onupdateActivityLogStatusWhy
When a step completes very quickly (condition, guidance),
markSucceeded/markFailedcan fire a few ms aftercreateActivityLog. The server returns 404 if the record isn't yet visible on the read path.withRetrydidn't retry 404s, so the call failed silently with a misleading log.createPendingis intentionally left unchanged — a 404 there is a genuine error.Test plan
with-retry.test.ts: 404 without flag → immediate throw; 404 with flag → full backoff; 404 with flag → success on 2nd attemptforestadmin-client-activity-log-port.test.ts:markSucceededandmarkFailedretry on 404; log message is"Activity log mark* failed"(no "after retries")fixes PRD-392
🤖 Generated with Claude Code
Note
Retry 404 responses in
markSucceededandmarkFailedactivity log callsRETRYABLE_STATUSset inwith-retry.ts, so transient 404s from the Forest Admin API are retried alongside 408, 429, 5xx errors.forestadmin-client-activity-log-port.tsfor consistency acrosscreatePending,markSucceeded, andmarkFailed.withRetry-wrapped call are now retried up to the configured retry limit instead of failing immediately.Changes since #1595 opened
withRetryand added anextraRetryStatusesparameter to allow callers to opt-in to retrying additional HTTP status codes including 404 [a9faf2d]extraRetryStatusesinForestadminClientActivityLogPort.markSucceededandForestadminClientActivityLogPort.markFailedmethods to retry whenupdateActivityLogStatusreturns 404 [a9faf2d]logger.infotologger.warnin thewithRetryfunction [a9faf2d]Macroscope summarized 2d0c033.