Repository navigation
fix: stop agents crashing on transport errors and message panics - #195
Merged
Merged
Conversation
The Siglet, IdentityHub and control plane clients deferred draining the response body before checking the error returned by http.Client.Do. On a transport error the response is nil, so the agent panicked instead of returning the error. Check the error first and only then defer draining the body. This also fixes the control plane client closing the body before reading it, which left error details empty. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…e helper Five agent HTTP clients each carried their own copy of the drain-and-close logic. Replace them with httpx.DrainAndClose, which also tolerates a nil response or body so a misplaced call can no longer panic. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A panic in a message dispatcher or activity processor ran in a goroutine without recover, so it took down the whole process. The message was never acked, so it was redelivered after the restart and the agent crash-looped. Recover per message in both RetriableMessageProcessor.ProcessMessage and the activity executor, log the panic with its stack trace, and terminate the message so it is not redelivered. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
paullatzelsperger
requested review from
jimmarino and
wolf4ood
and removed request for
wolf4ood
October 30, 2026 12:26
wolf4ood
approved these changes
Oct 30, 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.
What this PR changes
When Siglet, IdentityHub or the control plane were unreachable, agents dereferenced a nil
*http.Responseand the process exited. The message was never acked, so it was redelivered after the restart and the agent crash-looped while the downstream was down. This PR fixes that, one commit per change:httpx.DrainAndClosereplaces the five per-client copies of the drain-and-close logic.RetriableMessageProcessor.ProcessMessageand the PM activity executor recover from a panic, log it with the stack trace and terminate the message, so a single message can't take down an agent or PM.Notes for reviewers
🤖 Generated with Claude Code