Skip to content

fix(daemon): survive relay disconnect edge cases#19

Merged
glittercowboy merged 2 commits intomainfrom
fix/connection-resilience-daemon
Apr 14, 2026
Merged

fix(daemon): survive relay disconnect edge cases#19
glittercowboy merged 2 commits intomainfrom
fix/connection-resilience-daemon

Conversation

@glittercowboy
Copy link
Copy Markdown
Contributor

TL;DR

Daemon reconnect Hello frames now include active task IDs, handler-level relay errors no longer tear down the entire connection, interactive waits time out cleanly, duplicate task IDs are ignored, and temp uploads/image goroutines clean up correctly.

Why it matters

This keeps in-flight tasks alive across reconnects, prevents one bad browser or filesystem request from disconnecting all sessions, avoids duplicate execution, and closes cleanup leaks around temp files and upload goroutines.

How it works now

  • Hello includes ActiveTasks
  • readPump logs handler errors and continues
  • actor sequence numbers use atomic increments
  • permission and question waits time out and surface TaskError
  • task-scoped image uploads use the task context
  • duplicate task IDs are ignored per actor
  • downloaded image temp files are removed after executor exit

Verification

  • go test ./internal/relay ./internal/session ./internal/loop ./internal/claude
  • go test -race ./...

Landing / post-merge

  • Merge after the relay PR lands and the relay deploy is healthy.
  • Daemon changes are backward-compatible, but the relay queue-state fix should ship first.

@glittercowboy glittercowboy enabled auto-merge April 14, 2026 00:09
@glittercowboy glittercowboy force-pushed the fix/connection-resilience-daemon branch from a5c0cef to 18b64b0 Compare April 14, 2026 00:28
@glittercowboy glittercowboy merged commit bd27b5d into main Apr 14, 2026
1 check passed
@glittercowboy glittercowboy deleted the fix/connection-resilience-daemon branch April 14, 2026 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant