Skip to content

Refactor TaskError to hold Control and NonControl#85

Merged
Aaron1011 merged 2 commits intomainfrom
aaron/control-non-control
Apr 2, 2026
Merged

Refactor TaskError to hold Control and NonControl#85
Aaron1011 merged 2 commits intomainfrom
aaron/control-non-control

Conversation

@Aaron1011
Copy link
Copy Markdown
Member

@Aaron1011 Aaron1011 commented Apr 1, 2026

This will allow us to reduce error type duplication in tensorzero/tensorzero by removing the NonControlToolError type


Note

Medium Risk
Medium risk because it changes the core error type used across task execution and worker failure handling, including retryability and failure serialization semantics, which may be a breaking API change for downstream users.

Overview
Refactors task execution errors so TaskError becomes a wrapper enum with Control(ControlFlow) vs NonControl(NonControlTaskError), moving all failure variants (timeout, validation, step failure, child failure/cancel, DB/serialization, etc.) into NonControlTaskError with centralized retryable() logic.

Updates task/worker/heartbeat code to construct and propagate TaskError::NonControl(...) for real failures while preserving ControlFlow behavior for suspend/cancel/lease-expired, and adjusts error serialization by delegating failure JSON encoding to serialize_non_control_task_error. Also re-exports NonControlTaskError from lib.rs.

Written by Cursor Bugbot for commit 5e773a6. This will update automatically on new commits. Configure here.

This will allow us to reduce error type duplication in
tensorzero/tensorzero by removing the NonControlToolError type
@virajmehta virajmehta added this pull request to the merge queue Apr 1, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 1, 2026
@Aaron1011 Aaron1011 added this pull request to the merge queue Apr 2, 2026
Merged via the queue into main with commit b5f2664 Apr 2, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants