Conversation
…eded Replace the raw 'Failed to execute task: context canceled' message with clear, actionable error messages when the backend returns context.Canceled or context.DeadlineExceeded errors. Add userFacingTaskError() that translates well-known infrastructure errors into human-readable messages: - context.Canceled: 'The task was interrupted due to an infrastructure issue (context canceled). This is typically transient — please try again.' - context.DeadlineExceeded: 'The task exceeded its maximum allowed execution time and was terminated. Consider breaking the task into smaller steps or increasing the timeout.' - Other errors: preserve existing 'Failed to execute task: <err>' format Co-Authored-By: Oz <oz-agent@warp.dev>
liliwilson
approved these changes
May 6, 2026
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.
Problem
When a cloud agent task fails due to a
context.Cancelederror (e.g., infrastructure-level context cancellation after 34 minutes of execution), the user sees the opaque message:This is the raw Go error string formatted with
fmt.Sprintf("Failed to execute task: %v", err), providing no actionable information.Solution
Add
userFacingTaskError()to translate well-known infrastructure errors into clear, user-facing messages before sending them asTaskFailedmessages to the server.New error messages
context.Canceled:
context.DeadlineExceeded:
Other errors: Preserve existing
"Failed to execute task: <err>"format.Changes
errors.go: AddeduserFacingTaskError()functionworker.go: UpdatedexecuteTask()to useuserFacingTaskError(err)instead offmt.Sprintf("Failed to execute task: %v", err)worker_test.go: Added tests for context canceled/deadline exceeded scenarios and unit tests foruserFacingTaskError()Companion PR
Server-side defense-in-depth for these errors is in the warp-server companion PR, which adds
context.Canceled/context.DeadlineExceededcases toFromError()in theplatformerrorspackage.Conversation: https://staging.warp.dev/conversation/827c8486-edd0-4431-bb34-bda17e042c18
Run: https://oz.staging.warp.dev/runs/019dfe67-8ddc-7a9a-a8f4-cf95f003a682
This PR was generated with Oz.