You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Amber] Long running sessions have ServiceAccount tokens expire #445
Fix WebSocket Reconnection Errors for Long-Running Sessions
Problem Analysis
The HTTP 500 error occurs when:
Long-running sessions (>45 minutes) have expired ServiceAccount tokens
User switches devices (desktop to mobile), triggering WebSocket reconnection
Backend returns HTTP 500 instead of proper 401 for expired tokens
Runner cannot recover from authentication failures
Root Causes Identified
Token Expiration: Runner ServiceAccount tokens expire after 45 minutes (runnerTokenRefreshTTL in components/operator/internal/handlers/helpers.go)
Backend Error Handling: SSAR failures return HTTP 500 instead of 401 (components/backend/handlers/middleware.go:309)
No Token Refresh: Runner doesn't refresh tokens during reconnection attempts (components/runners/runner-shell/runner_shell/core/transport_ws.py)
Implementation Plan
Phase 1: Immediate Fix - Backend Error Handling
Update components/backend/handlers/middleware.go ValidateProjectContext:
Return HTTP 401 for authentication failures instead of HTTP 500
Add specific error messages to distinguish token expiration from other SSAR failures
Log token validation failures with context
Activity
github-actions commentedon Dec 5, 2025
Amber Change Summary
The following files were modified:
Next Steps:
🔍 View AI decision process (logs available for 90 days)
fix(operator,runner): mount runner token as volume for dynamic refresh
github-actions commentedon Dec 5, 2025
🤖 Amber has created a pull request to address this issue: #446
The changes are ready for review. All automated checks will run on the PR.
🔍 View AI decision process (logs available for 90 days)
fix(backend): return 401 for expired tokens in ValidateProjectContext
fix(backend): return 401 for expired tokens in ValidateProjectContext (…
fix(backend): return 401 for expired tokens in ValidateProjectContext (…