feat(runtime): define versioned error envelope - #3267
Conversation
|
✅ No security or compliance issues detected. Reviewed everything up to d610c36. Security Overview
Detected Code Changes
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6d501eddbe
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| try: | ||
| val = list(details.values())[0] | ||
| details = ActionErrorInfo(**val) | ||
| details = ActionErrorInfoAdapter.validate_python(val) |
There was a problem hiding this comment.
Preserve standalone envelopes in scheduler errors
When wrap_application_error() or application_error_from_envelope() transports an error without an ActionErrorInfo, its sole detail is the new TemporalErrorDetails mapping. This branch treats that mapping as a child-workflow map and validates its first value (the schema string) as an action error, then falls back to an unclassified ActionErrorInfo; consequently the envelope is absent from task_exceptions and the final workflow/error-handler payload. Recognize TemporalErrorDetails here and synthesize a ClassifiedActionErrorInfo so the non-action transport path retains its classification.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d610c3608b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| envelope: ErrorEnvelope | ||
|
|
||
|
|
||
| type ActionErrorInfoVariant = ClassifiedActionErrorInfo | ActionErrorInfo |
There was a problem hiding this comment.
Preserve classifications inside aggregate action errors
When a classified action fails inside a scatter/gather, this variant is only used by the top-level adapter: FinalizeGatherActivityResult.errors and ActionErrorInfo.children remain typed as ActionErrorInfo. Pydantic therefore serializes those values as the base dataclass and drops the subclass's envelope at the activity or aggregate boundary, so gather RAISE/partition paths lose the new owner, kind, and retry metadata. Use the variant (or an equivalent classification-preserving serializer) for aggregate error fields as well.
Useful? React with 👍 / 👎.
Summary
tracecat.error.v1envelope with independentowner, namespacedkind, safemessage,retry_disposition, and diagnostic-onlycause_typekindthe single stable taxonomy identity and mirror it into TemporalApplicationError.typeWhy
ENG-1407 needs a narrow runtime-error contract before execution paths begin producing or consuming classifications. A fine-grained namespaced
kindis sufficient for product grouping and operator diagnosis, so this contract does not add a secondoperationdimension or retain a separate compatibility error type.Keeping this layer contract-only makes the compatibility, retry, and history-safety properties reviewable independently from runtime integration.
Impact
This PR does not classify live failures, change workflow routing, add Sentry capture, or alter completion behavior. Existing unclassified action and Temporal error details keep their established shape and semantics.
cause_typeremains diagnostic metadata and must not control attribution or retry behavior.Validation
uv run ruff checkanduv run ruff format --checkuv run basedpyrightLOC breakdown
Summary by cubic
Defines a versioned runtime error envelope and Temporal adapters; adopts namespaced error kinds and adds executor backend initialization classification. This standardizes error attribution and retry behavior without changing workflow routing or delivery (ENG-1407).
tracecat.error.v1envelope with owner, kind (namespaced), message, retry_disposition, and cause_type; strict parsing requires the explicit schema discriminator and forbids extra fields.ApplicationErrorfrom an envelope (type = kind, retryability derived), rejectnext_retry_delayfor non-retryable envelopes, and reliably wrap/extract envelopes throughtemporaliofailure serialization and exception chains.ClassifiedActionErrorInfoand a strictActionErrorInfoAdapterunion; updates the scheduler to parse via the adapter and preserve classification while keeping legacy payload shape.executor.backend.initialization_failed.Written for commit d610c36. Summary will update on new commits.