fix(shell): improve reliability — keepalive, error classification, agent-timeout detection#634
Merged
Conversation
…ent-timeout detection
- Replace unbounded read deadline with ping/pong keepalive (PingInterval=30s, ReadTimeout=75s)
- Classify WebSocket close codes: 1007/1008 permanent (cancel+no retry), 1011 transient (retry)
- Detect agent-side timeout messages within 1011 errors and show specific retry guidance:
"exceeded for receiving agent response" — gateway DEFAULT_AGENT_RESPONSE_TIMEOUT
"while connecting to pod" — shell-agent KUBE_OPERATION_TIMEOUT (K8s exec)
"while setting up port forward" — shell-agent KUBE_PORT_FORWARD_TIMEOUT
"Retry budget exhausted" — shell-agent retry budget guard
- Stop reconnect loop on permanent close errors (permission denied, auth rejected)
- Fix port-forward: replace log.Fatal with log.Errorf+return, improve error messages
- Add wserror.go with IsPermanentCloseError, IsInternalServerError, IsAgentResponseTimeout,
ServiceUnavailableMessage helpers and full test coverage
erebe
approved these changes
May 5, 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.
Context
Customer bug (Jonathan Petitcolas): `qovery shell` WebSocket connections drop with "Deadline of 30s exceeded for receiving agent response" because the K8s namespace lookup + pod list + exec can take longer than the hardcoded 30s gateway timeout.
Companion MR on rust-backend: qovery/backend/rust-backend!593
Changes
Keepalive
Idle-but-healthy connections now survive indefinitely; only truly dead connections are detected and closed.
WebSocket error classification (`wserror.go`)
These show a specific "retrying…" message instead of the generic "service unavailable" one.
Port-forward
Tests