fix(run-engine): don't mislabel DB errors as UnclassifiableWaitpointId in completeWaitpoint - #4259
Open
claude[bot] wants to merge 7 commits into
Open
fix(run-engine): don't mislabel DB errors as UnclassifiableWaitpointId in completeWaitpoint#4259claude[bot] wants to merge 7 commits into
claude[bot] wants to merge 7 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
@trigger.dev/build
trigger.dev
@trigger.dev/core
@trigger.dev/python
@trigger.dev/react-hooks
@trigger.dev/redis-worker
@trigger.dev/rsc
@trigger.dev/schema-to-json
@trigger.dev/sdk
commit: |
…ion-db-error-mislabel # Conflicts: # internal-packages/run-engine/src/engine/systems/waitpointSystem.ts
matt-aitken
marked this pull request as ready for review
August 31, 2026 19:33
…as instanceof The intended thrower of UnclassifiableRunId is an injected classifier, which can arrive from a separately built bundle carrying its own copy of the class, where instanceof misses. The class sets its name explicitly, so the name check keeps the wrap reliable across module instances. A missed match was already harmless (the error bubbled unchanged); this preserves the clearer label in the one scenario the branch exists for.
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
The waitpoint completion path wrapped every error from the store-resolution step (
runStore.forWaitpointCompletion) asUnclassifiableWaitpointId. That step probes the database to find the owning store, so a transient connection failure surfaced as a misleading "unclassifiable waitpointId" error, hiding the real cause and losing the underlying error's type, retryability and grouping. During a brief database failover this mislabel sent an incident investigation down a false trail before the real connection error was found underneath.Fix
The catch is narrowed: only a genuine
UnclassifiableRunId(the documented classification-failure signal fromRunStore.forWaitpointCompletion) becomesUnclassifiableWaitpointId. Every other error, including database connectivity failures, is rethrown unchanged.With the default classifier this also turns
UnclassifiableWaitpointIdinto a clean signal: it no longer fires on infra noise, so any occurrence indicates a real id-routing defect worth alerting on. Recovery does not depend on this change, since lost completion side effects are re-delivered by the finalization guard from #4849; this PR is about diagnosing failures correctly.A hermetic unit test locks both behaviors: a database error bubbles up unchanged, and a classification failure is wrapped with the original error as
cause.