fix(run-engine): don't mislabel DB errors as UnclassifiableWaitpointId in completeWaitpoint#4259
Draft
claude[bot] wants to merge 3 commits into
Draft
fix(run-engine): don't mislabel DB errors as UnclassifiableWaitpointId in completeWaitpoint#4259claude[bot] wants to merge 3 commits into
claude[bot] wants to merge 3 commits into
Conversation
…d in completeWaitpoint forWaitpointCompletion resolves the owning store by probing the database, so a transient DB/infra error surfaced from that call was being caught and rethrown as UnclassifiableWaitpointId with a misleading "length matches neither cuid nor run-ops id" message, losing the original error's type, retryability, and error grouping. Narrow the catch so only a genuine id-classification failure (UnclassifiableRunId) becomes UnclassifiableWaitpointId; every other error (including DB connectivity failures) is rethrown unchanged.
|
…fication wrapping Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PVbKhNnh8A5tWDGKq9GggV
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.
Changelog
WaitpointSystem.completeWaitpointwrapped therunStore.forWaitpointCompletion(id)call in a broadtry/catchthat rethrew any error asUnclassifiableWaitpointId. ButforWaitpointCompletionresolves the owning store by probing the database (not by classifying the id string), so a transient database/infra error surfaced from that call was being caught and mislabelled.Before: a transient database problem (e.g. can't reach the database server under load) surfaced as a misleading
UnclassifiableWaitpointId — length N matches neither cuid nor run-ops iderror. This hid the real cause and lost the underlying error's type, retryability, and error-grouping.After: the underlying database error surfaces unchanged (keeping its type, retryability, and grouping). Only a genuine id-classification failure produces
UnclassifiableWaitpointId.How: In
internal-packages/run-engine/src/engine/systems/waitpointSystem.ts, thecatcharoundforWaitpointCompletionis narrowed to convert onlyUnclassifiableRunId(the documented classification-failure signal — seeRunStore.forWaitpointCompletionininternal-packages/run-store/src/types.ts) intoUnclassifiableWaitpointId. Every other error, including DB connectivity failures, is rethrown as-is. A comment explains why DB/infra errors must not be wrapped.Testing
No behavior change for the existing test paths:
The change is confined to error classification in the store-resolution catch; the id-classification path that produces
UnclassifiableWaitpointIdis unchanged.Checklist
Generated by Claude Code