Skip to content

fix(tui): rehydrate sessions after reconnect - #37957

Closed
nxxxsooo wants to merge 2 commits into
anomalyco:devfrom
nxxxsooo:reconnect-hydration
Closed

fix(tui): rehydrate sessions after reconnect#37957
nxxxsooo wants to merge 2 commits into
anomalyco:devfrom
nxxxsooo:reconnect-hydration

Conversation

@nxxxsooo

@nxxxsooonxxxsooo commented Jul 20, 2026

Copy link
Copy Markdown

Issue for this PR

Closes#32175

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

The TUI could stop receiving events after a transient global SSE failure, and sessions already mounted before the gap remained stale after transport returned.

This change keeps those two concerns separate. The SDK provider retries rejected connections, iterator failures, and normal stream completion with bounded exponential backoff. Later server.connected epochs then reconcile the authoritative session list/status and atomically refresh already-loaded session metadata, messages, parts, todo, and diff state. Confirmed deletions are pruned, failed hydration preserves prior state, and reconnect storms are serialized without overlapping passes.

How did you verify your code works?

  • Transport regression suite: 15 pass, 0 fail.
  • Reconnect coordinator: 6 pass, 0 fail; 120 pass across --rerun-each 20.
  • Hydration suites: 16 isolated and 5 live tests pass.
  • Full TUI package: 228 pass, 1 skip, 0 fail; package typecheck passes.
  • Fresh arm64 native build from 00470701974fa23189a34c63f61b1932f2a4f394: SHA-256 a1ddeef525be970223b354706bf240728c07d961932a129b70bf2718c9c3953b.
  • Two isolated proxy-gap cycles kept the same mounted attach PID, converged to direct REST state after restoration, and added exactly one server SSE lifecycle each. The second outage lasted 1.624 seconds, beyond the initial retry interval.
  • The temporary session/processes were removed, QA ports were freed, and production was not contacted or modified.

Screenshots / recordings

Not applicable. This fixes transport and store reconciliation behavior; the runtime check asserted the mounted TUI pane title before, during, and after each gap.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

nxxxsoooand others added 2 commits July 20, 2026 23:59
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
@github-actionsgithub-actionsBot added the needs:compliance This means the issue will auto-close after 2 hours. label Jul 20, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Based on my search results, I found one potentially related PR:

Related PR:

However, PR #34010 appears to focus on a different layer (core response streams) while PR #37957 specifically addresses TUI event delivery after SSE transport failures and session state reconciliation through reconnect epochs.

These are related but distinct improvements—#34010 handles lower-level stream error retries, while #37957 provides comprehensive reconnection and rehydration for the TUI sync provider.

@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window.

Feel free to open a new pull request that follows our guidelines.

@github-actionsgithub-actionsBot removed the needs:compliance This means the issue will auto-close after 2 hours. label Jul 20, 2026
Sign up for freeto 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.

SSE reconnection never fires after initial connection failure

1 participant

@nxxxsooo