Commit Graph
3 Commits
Author SHA1 Message Date
Benjamin Carlsson f39fcc1bfb Hold Cloud reply streams until history can be refreshed (#62140)
## Why

A Cloud conversation can miss an entire turn while disconnected. A
successful reattach, even with an idle thread, cannot establish that the
client's history is complete.

## What changed

Add an app-server client operation that reattaches a disconnected,
loaded Cloud thread and returns its cached settings. The worker holds
the replacement stream so the caller can refresh turn and item history
before explicitly installing the stream and receiving buffered events.

Reattachment, recovery history reads, and stream installation share a
deadline and use the original Cloud sign-in and network permit. Dropping
the release handle cancels the replacement. Personal access token
sessions still reconnect by reopening the conversation.

## Testing

Extend Cloud connection tests to cover quiet and busy reattachments,
buffered event delivery, cancellation and retry, slow history reads,
and sign-in changes during recovery.

GitOrigin-RevId: a4e5cb967e097021596bc83aac2f8d1a95373712
2026-11-18 00:32:11 +00:00
Benjamin Carlsson 8e30237f64 Report Cloud stream recovery failures and cancel abandoned reads (#61599)
## Why

Cloud stream failures previously used a generic reopen message even when the conversation was missing, access was denied, or sign-in had changed. Abandoned turn and item list requests could also keep the native worker occupied.

## What changed

- Report specific disconnect reasons for missing conversations, lost access, and changed or expired sign-in, including failures during idle reconnection.
- Report exhausted reconnect attempts and other nontransient recovery failures with dedicated messages.
- Cancel in-flight `ThreadTurnsList` and `ThreadItemsList` requests when their callers drop, matching `ThreadList` behavior.

## Testing

Add regression coverage for abandoned history reads, changed sign-in during accepted idle recovery, and access-denied stream errors.

GitOrigin-RevId: 29923b46c2d377f2247d699757553777a31d08ca
2026-11-15 03:15:06 +00:00
Benjamin Carlsson f988ada4bf Reconnect idle Cloud conversations after transient stream loss (#60969)
## Why

A lost Cloud reply stream previously required reopening the conversation, even when it was idle. Recover the displayed conversation automatically while holding queued input until its reply stream is usable.

## What changed

- Add bounded retries for transient stream failures in the displayed, idle conversation, with credential and network-policy checks. Keep explicit reopen behavior when recovery is unavailable or fails.
- Enable HTTP/2 keepalive pings for Cloud connections.
- Queue input while disconnected and resume ordinary submission after recovery. Mark recovered history as potentially incomplete so an explicit reopen reloads missed turns while preserving drafts and reconciling pending submissions.
- Store retained input per backend and apply background settings updates to the owning backend's drafts.

## Testing

Add regression coverage for queued input during disconnection and extend resume and backend-handoff tests to cover history refresh, draft preservation, and retained settings.

GitOrigin-RevId: 3d753e53d3c0d594680a90cac8a75fe33b91e219
2026-11-12 01:57:33 +00:00