Don't report a bridged agent turn as failed on gRPC transport cancellation - #216
Merged
Merged
Conversation
…ation /invoke's status poll treated any handle.Get error other than ctx's own deadline as a genuine turn failure. But the Temporal SDK's WorkflowUpdateServiceTimeoutOrCanceledError (e.g. "stream terminated by RST_STREAM with error code: CANCEL") is explicitly documented as being about the client call, not the update -- the workflow keeps running either way. Misclassifying it made agent-orchestrator report a bridged coding agent's routine multi-minute turn (e.g. launching claude-code-swe- agent to open a PR) as an outright failure while the AgentRun kept working in the background. Now any WorkflowUpdateServiceTimeoutOrCanceledError is treated as pending, matching how the streaming chat facade's awaitTurnResult already handles the same SDK error. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01D3zV2JdVTYGuS1KGwyXCJz
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
claude-code-swe-agentruns launched through Temporal.handleInvokeStatus(the/invokepoll endpoint) treated anyhandle.Geterror other than its own poll deadline expiring as a genuine turn failure. The Temporal SDK'sWorkflowUpdateServiceTimeoutOrCanceledErroris explicitly documented as being about the client call, not the update — the workflow is still running either way. This made a bridged coding agent's routine multi-minute turn (e.g. creating a repo + opening a PR) get reported as an outright failure while the AgentRun kept working in the background.WorkflowUpdateServiceTimeoutOrCanceledErroris classified aspending, mirroring how the streaming chat facade'sawaitTurnResult(server.go) already handles the exact same SDK error.Test plan
go build ./...go vet ./...go test ./...— new tests added ininvoke_status_test.go:TestHandleInvokeStatusTreatsTransportCancelAsPending(the regression),TestHandleInvokeStatusReportsARealFailure,TestHandleInvokeStatusUnknownUpdateIs404,TestHandleInvokeStatusSucceededReportsTheReply🤖 Generated with Claude Code
https://claude.ai/code/session_01D3zV2JdVTYGuS1KGwyXCJz