Classify runtime errors across workflow boundaries#2709
Conversation
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4117a02525
ℹ️ 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".
There was a problem hiding this comment.
4 issues found across 40 files
Confidence score: 3/5
- There is a concrete regression risk in
tracecat/dsl/workflow.py: runtime-onlyApplicationErrordetails no longer match the error-handler parser’s expectedActionErrorInfomap shape, which can break handler dispatch and obscure the original workflow failure. tracecat/runtime/errors.pymay miss implicitly chained infra exceptions unless__context__is traversed, creating medium risk of misclassification and harder diagnosis during failures.packages/tracecat-ee/tracecat_ee/agent/workflows/durable.pyandtracecat/dsl/action.pyintroduce behavior changes that can amplify failure impact (retrying deterministic validation viaactivity:fail_slow, and bypassingActivityRuntimeErrorwrapping when storage init fails), so this is mergeable but with notable runtime-risk areas.- Pay close attention to
tracecat/dsl/workflow.py,tracecat/runtime/errors.py,packages/tracecat-ee/tracecat_ee/agent/workflows/durable.py,tracecat/dsl/action.py- error-path compatibility and classification need validation to avoid masked failures and incorrect retries.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="tracecat/dsl/workflow.py">
<violation number="1" location="tracecat/dsl/workflow.py:579">
P1: New runtime-only ApplicationError details are incompatible with the existing error-handler parsing logic, which expects ActionErrorInfo maps. This can break error-handler workflow dispatch and mask the original workflow failure.</violation>
</file>
<file name="tracecat/runtime/errors.py">
<violation number="1" location="tracecat/runtime/errors.py:175">
P2: Include `__context__` in exception-chain traversal; otherwise implicitly chained infra exceptions can be missed and misclassified.</violation>
</file>
<file name="packages/tracecat-ee/tracecat_ee/agent/workflows/durable.py">
<violation number="1" location="packages/tracecat-ee/tracecat_ee/agent/workflows/durable.py:484">
P2: Using `activity:fail_slow` here causes deterministic subagent validation failures to retry multiple times instead of failing immediately.</violation>
</file>
<file name="tracecat/dsl/action.py">
<violation number="1" location="tracecat/dsl/action.py:744">
P2: `get_object_storage()` is outside the error-classification try block, so backend initialization failures bypass `ActivityRuntimeError` wrapping and lose runtime error classification.</violation>
</file>
Tip: cubic can generate docs of your entire codebase and keep them up to date. Try it here.
Re-trigger cubic
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e41beddf65
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cf698c9cb2
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7d26370ccd
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2bea4ff8e8
ℹ️ 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".
|
✅ No security or compliance issues detected. Reviewed everything up to 0b33755. Security Overview
Detected Code ChangesThe diff is too large to display a summary of code changes. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b5eb46529b
ℹ️ 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".
|
You're iterating quickly on this pull request. To help protect your rate limits, cubic has paused automatic reviews on new pushes for now—when you're ready for another review, comment |
Checklist
uv run pytest tests)?pre-commit run --all-files)?Description
This PR adds first-class runtime error classification for workflow execution and carries that classification across Temporal boundaries.
It introduces runtime error envelopes for
user,platform, andinfrafailures, adds Temporal adapters for activity and workflow-originated failures, and wires those envelopes into DSL action execution, scheduler failures, trigger-input normalization, registry lock resolution, agent setup, tier/workspace activities, and related activity boundaries.The PR also adds
DSLWorkflowV2behindTRACECAT__FEATURE_FLAGS=DSL_WORKFLOW_V2so new executions can target the v2 workflow type while existing histories stay on the current workflow. Worker registration, workflow start paths, schedule update/start handling, generated frontend types, and event/history parsing are updated for both workflow types.The mental model implemented here is:
ActivityRuntimeError.WorkflowRuntimeError.Related Issues
N/A
Screenshots / Recordings
N/A
Steps to QA
Focused verification run locally:
Commit-time hooks also passed for the committed changes.
Summary by cubic
Classifies runtime errors end-to-end and preserves their kind across activities, the scheduler, and workflows to improve error clarity and retries. Adds feature-flagged
DSLWorkflowV2, consolidates error details into a single wrapper, and standardizes activity/workflow error boundaries.New Features
kind/origin/phase) intracecat.runtime.errorsand Temporal helpers intracecat.temporal.errors(ActivityRuntimeError,WorkflowRuntimeError,TemporalErrorDetails, extract helpers).TemporalErrorDetails.v1withpayloadsand a per-refruntime_errorsmap; malformed details are ignored.tracecat.temporal.activity_errorsandtracecat.dsl.activity_errorsto classify user/platform/infra errors and attach envelopes across storage, tiers/workspaces, workflow management/schedules, agents/sessions/presets, interactions.tracecat.executor.errors.ActionRuntimeErrorand retries infra errors by default.DSLWorkflowV2behinddsl-workflow-v2; workers register both; new starts/schedules route viadsl_workflow_run_method_for_new_execution; history/event parsing accepts both viais_dsl_workflow_type_name; frontend flag enums updated.Bug Fixes
temporal.exceptions.UserErrorwith typed runtime errors; webhooks now use a generic workflow handle and returnStoredObject.Written for commit 0b33755. Summary will update on new commits. Review in cubic