Skip to content

fix: once server disconnects, drop the connectino - #36

Merged
InftyAI-Agent merged 1 commit into
InftyAI:mainfrom
kerthcet:fix/resolve-semi-connectionerror
Aug 4, 2026
Merged

fix: once server disconnects, drop the connectino#36
InftyAI-Agent merged 1 commit into
InftyAI:mainfrom
kerthcet:fix/resolve-semi-connectionerror

Conversation

@kerthcet

@kerthcet kerthcet commented Aug 4, 2026

Copy link
Copy Markdown
Member

What this PR does / why we need it

Which issue(s) this PR fixes

Fixes #

Special notes for your reviewer

Does this PR introduce a user-facing change?


Signed-off-by: kerthcet <kerthcet@gmail.com>
Copilot AI lite review requested due to automatic review settings August 4, 2026 08:54
@InftyAI-Agent InftyAI-Agent added needs-triage Indicates an issue or PR lacks a label and requires one. needs-priority Indicates a PR lacks a label and requires one. do-not-merge/needs-kind Indicates a PR lacks a label and requires one. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Aug 4, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR makes the daemon proactively treat a failed heartbeat send as a definitive disconnect signal, so the main serve loop breaks and main() can reconnect even when the WebSocket read side remains blocked due to a half-open connection.

Changes:

  • Add a tokio::sync::oneshot “dead connection” signal from the heartbeat task to the main tokio::select! loop.
  • On heartbeat send failure, trigger reconnection by breaking the serve loop with ServeOutcome::Disconnected.
  • Expand inline documentation explaining why heartbeat-send failure is used as the disconnect trigger in DERP-relayed/mesh scenarios.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@kerthcet

kerthcet commented Aug 4, 2026

Copy link
Copy Markdown
Member Author

/lgtm
/kind bug

@InftyAI-Agent InftyAI-Agent added lgtm Looks good to me, indicates that a PR is ready to be merged. bug Categorizes issue or PR as related to a bug. and removed do-not-merge/needs-kind Indicates a PR lacks a label and requires one. labels Aug 4, 2026

@InftyAI-Agent InftyAI-Agent left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved: PR has both lgtm and approved labels

@InftyAI-Agent
InftyAI-Agent merged commit 66d7df8 into InftyAI:main Aug 4, 2026
42 of 44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. bug Categorizes issue or PR as related to a bug. lgtm Looks good to me, indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a label and requires one. needs-triage Indicates an issue or PR lacks a label and requires one.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants