-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Treat missing thread snapshots as terminal #4235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Quicksaver
wants to merge
76
commits into
pingdotgg:main
Choose a base branch
from
Quicksaver:fix/thread-not-found-subscription-loop
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+654
−96
Open
Changes from all commits
Commits
Show all changes
76 commits
Select commit
Hold shift + click to select a range
794c4cc
Stop retrying subscriptions for missing threads
Quicksaver a4f6fd3
Keep draft subscriptions alive until thread creation
Quicksaver 78cb397
Harden missing thread snapshot handling
Quicksaver 8b86c84
Use catchTags for missing thread recovery
Quicksaver 46651af
Merge remote-tracking branch 'upstream/main' into fix/thread-not-foun…
Quicksaver b337803
Merge remote-tracking branch 'upstream/main' into fix/thread-not-foun…
Quicksaver 0eda3f2
Merge remote-tracking branch 'upstream/main' into fix/thread-not-foun…
Quicksaver 506b583
Merge remote-tracking branch 'upstream/main' into fix/thread-not-foun…
Quicksaver b6e1a17
Merge remote-tracking branch 'upstream/main' into fix/thread-not-foun…
Quicksaver 4ed5d7d
Merge remote-tracking branch 'upstream/main' into fix/thread-not-foun…
Quicksaver 27c1c7a
Merge remote-tracking branch 'upstream/main' into fix/thread-not-foun…
Quicksaver 03650e3
Prevent deleted and draft thread resubscriptions
Quicksaver 2a63728
Merge remote-tracking branch 'upstream/main' into fix/thread-not-foun…
Quicksaver 62367a7
Merge remote-tracking branch 'upstream/main' into fix/thread-not-foun…
Quicksaver ab823aa
Merge remote-tracking branch 'upstream/main' into fix/thread-not-foun…
Quicksaver 2d25d20
Merge remote-tracking branch 'upstream/main' into fix/thread-not-foun…
Quicksaver 45dac5e
Merge remote-tracking branch 'upstream/main' into fix/thread-not-foun…
Quicksaver 285f15b
Merge remote-tracking branch 'upstream/main' into fix/thread-not-foun…
Quicksaver b6bb311
Merge remote-tracking branch 'upstream/main' into fix/thread-not-foun…
Quicksaver e933fa5
Keep authoritative HTTP thread_not_found responses terminal
Quicksaver 388cbb2
Merge remote-tracking branch 'upstream/main' into fix/thread-not-foun…
Quicksaver 63a41d6
Merge remote-tracking branch 'upstream/main' into fix/thread-not-foun…
Quicksaver 474f669
Merge remote-tracking branch 'upstream/main' into fix/thread-not-foun…
Quicksaver dacee90
Merge remote-tracking branch 'upstream/main' into fix/thread-not-foun…
Quicksaver 730363c
Merge commit '32843c2551bd5832d436ef46bff5ab1198cdc39c' into fix/thre…
Quicksaver ca19570
Merge remote-tracking branch 'upstream/main' into fix/thread-not-foun…
17ce0fd
Consolidate draft thread detail gating
c388555
Document canonical draft detail gate
f2cbd5c
Harden consolidated thread detail gating
043eb0c
Merge remote-tracking branch 'upstream/main' into fix/thread-not-foun…
649499c
Merge remote-tracking branch 'upstream/main' into fix/thread-not-foun…
420083d
Merge remote-tracking branch 'upstream/main' into fix/thread-not-foun…
17284df
Merge remote-tracking branch 'upstream/main' into fix/thread-not-foun…
1a6dd5c
Merge remote-tracking branch 'upstream/main' into fix/thread-not-foun…
721e5be
Merge remote-tracking branch 'upstream/main' into fix/thread-not-foun…
5adc4a2
Merge remote-tracking branch 'upstream/main' into fix/thread-not-foun…
210483f
Merge remote-tracking branch 'upstream/main' into fix/thread-not-foun…
2f61f5c
Merge remote-tracking branch 'upstream/main' into fix/thread-not-foun…
1ec6abf
Merge remote-tracking branch 'upstream/main' into fix/thread-not-foun…
1ae98f4
Merge remote-tracking branch 'upstream/main' into fix/thread-not-foun…
3a1214f
Merge remote-tracking branch 'upstream/main' into fix/thread-not-foun…
113a026
Merge remote-tracking branch 'upstream/main' into fix/thread-not-foun…
1e6b31d
Merge remote-tracking branch 'upstream/main' into fix/thread-not-foun…
ef8d66b
Merge remote-tracking branch 'upstream/main' into fix/thread-not-foun…
88c947d
Merge remote-tracking branch 'upstream/main' into fix/thread-not-foun…
ff11ae9
Merge remote-tracking branch 'upstream/main' into fix/thread-not-foun…
4b53153
Merge remote-tracking branch 'upstream/main' into fix/thread-not-foun…
b288cd3
Merge remote-tracking branch 'upstream/main' into fix/thread-not-foun…
e6de390
Merge remote-tracking branch 'upstream/main' into fix/thread-not-foun…
9a8e1a1
Merge commit 'bfc31507f8483b0ba22cf10f5862947b49b20a53' into fix/thre…
65e7c38
Merge remote-tracking branch 'upstream/main' into fix/thread-not-foun…
9feeb68
Handle missing threads after bounded resume fallback
993af0d
Document bounded missing-thread fallback
d54a158
Prevent deleted thread cache resurrection
82d6e88
Preserve missing thread error message
00b2257
Merge remote-tracking branch 'upstream/main' into fix/thread-not-foun…
bfd79b7
Merge remote-tracking branch 'upstream/main' into fix/thread-not-foun…
0b846d1
Merge remote-tracking branch 'upstream/main' into fix/thread-not-foun…
931a5c5
Merge remote-tracking branch 'upstream/main' into fix/thread-not-foun…
f3d4d81
Merge remote-tracking branch 'upstream/main' into fix/thread-not-foun…
fe3ea6e
Merge remote-tracking branch 'upstream/main' into fix/thread-not-foun…
f6f7948
Merge remote-tracking branch 'upstream/main' into fix/thread-not-foun…
27f4344
Merge remote-tracking branch 'upstream/main' into fix/thread-not-foun…
3eec12c
Merge remote-tracking branch 'upstream/main' into fix/thread-not-foun…
0ee9834
Merge remote-tracking branch 'upstream/main' into fix/thread-not-foun…
805c29b
Merge remote-tracking branch 'upstream/main' into fix/thread-not-foun…
2e17e8c
Merge remote-tracking branch 'upstream/main' into fix/thread-not-foun…
a43fb6e
test: preserve draft subscription guard across workspace modes
62d729b
docs: record draft workspace guard coverage
92a3030
Verify draft identity across workspace mode changes
04a3fa7
Merge remote-tracking branch 'upstream/main' into fix/thread-not-foun…
4669b6f
Merge remote-tracking branch 'upstream/main' into fix/thread-not-foun…
b4e5d7f
Merge remote-tracking branch 'upstream/main' into fix/thread-not-foun…
ef5b1e8
Merge remote-tracking branch 'upstream/main' into fix/thread-not-foun…
69a1588
Merge remote-tracking branch 'upstream/main' into fix/thread-not-foun…
Quicksaver 5b79dd2
Merge remote-tracking branch 'upstream/main' into fix/thread-not-foun…
Quicksaver File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| # Thread Detail Subscription Reliability | ||
|
|
||
| Thread-detail synchronization distinguishes an authoritative missing resource from a transient snapshot failure across both HTTP snapshot loading and WebSocket snapshot fallback so stale thread state cannot enter an unbounded subscription retry loop. | ||
|
|
||
| Expected behavior: | ||
|
|
||
| - An HTTP `thread_not_found` response clears the persisted detail cache and marks the client thread state deleted. | ||
| - When a bounded WebSocket resume falls back to a fresh snapshot, a dedicated `OrchestrationThreadNotFoundError` applies the same cache removal and deleted-state transition for a warm cached thread. | ||
| - Cache removal is serialized with snapshot persistence, and persistence rechecks deleted state under the same lock, so a queued or in-flight save cannot resurrect an authoritatively deleted thread. | ||
| - The missing-thread subscription terminates before opening or retrying its WebSocket stream, including after session replacement and application-foreground resubscription signals. | ||
| - `resolveThreadDetailRef` is the canonical web detail-subscription gate. `useThread` waits for the shell when either automatic draft-store detection or an explicit `waitForShell` request identifies a pre-creation thread, while direct detail/status consumers such as the server-thread route map their local-draft readiness through the same resolver. Draft workspace-mode changes before shell creation preserve lookup by the reserved thread ref, so this guard remains active while switching between current-checkout and new-worktree modes. The expected pre-creation HTTP 404 therefore cannot mark the draft deleted, and the new shell starts fresh synchronization after the first send. | ||
| - Other HTTP snapshot failures remain transient and fall back to the socket snapshot path. Other WebSocket snapshot failures remain transient and retain the existing retry behavior. | ||
|
|
||
| Primary files: | ||
|
|
||
| - `packages/client-runtime/src/state/threadSnapshotHttp.ts` | ||
| - `packages/client-runtime/src/state/threads.ts` | ||
| - `packages/client-runtime/src/state/threads-sync.test.ts` | ||
| - `packages/contracts/src/orchestration.ts` | ||
| - `packages/contracts/src/rpc.ts` | ||
| - `apps/server/src/ws.ts` | ||
| - `apps/server/src/server.test.ts` | ||
| - `apps/web/src/composerDraftStore.test.ts` | ||
| - `apps/web/src/state/entities.ts` | ||
| - `apps/web/src/state/entities.test.ts` | ||
| - `apps/web/src/routes/_chat.$environmentId.$threadId.tsx` | ||
|
|
||
| ## Development Ports | ||
|
|
||
| - Web: `5741` | ||
| - Server/WebSocket: `13781` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.