-
Notifications
You must be signed in to change notification settings - Fork 0
fix: stop aborting live answer streams at a flat 60s timeout #466
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
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
7190c84
fix: stop aborting live answer streams at a flat 60s timeout
claude 54d5229
Merge origin/main into claude/search-timeout-failure-s6aiuj
claude 072adf9
fix: tolerate cancelled answer streams
BigSimmo cb19f96
test: stabilize flaky UI assertions
Copilot e33a148
test: fix flaky ci ui assertions
Copilot 01c8893
Merge remote-tracking branch 'origin/main' into codex/pr-466-fixes
BigSimmo cb5271e
fix: retain current differential evidence state
BigSimmo 1f29b94
Merge remote-tracking branch 'origin/main' into codex/pr-466-fixes
BigSimmo 4c90e66
test: align advisory UI assertions
BigSimmo b341fed
fix: clear stale differential evidence during reruns
BigSimmo 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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| // SSE liveness for long-running answer streams. Generation legitimately goes | ||
| // silent for stretches (e.g. strong-route reasoning before the first output | ||
| // token, bounded by OPENAI_ANSWER_TIMEOUT_MS), during which neither progress | ||
| // events nor token deltas are emitted. A periodic comment line keeps | ||
| // intermediaries from idling out the connection and gives the client's stall | ||
| // watchdog a byte-level liveness signal. Comment lines (leading ":") are | ||
| // ignored by SSE parsers, so clients need no changes to tolerate them. | ||
|
|
||
| export const answerStreamHeartbeatIntervalMs = 15_000; | ||
|
|
||
| // A bare SSE comment line followed by a blank line — a complete, ignorable frame. | ||
| export const sseHeartbeatFrame = ": heartbeat\n\n"; | ||
|
|
||
| /** | ||
| * Start emitting heartbeat frames via `enqueue` every `intervalMs`. Returns a | ||
| * stop function. If `enqueue` throws (stream closed or cancelled by the | ||
| * client), the heartbeat stops itself. | ||
| */ | ||
| export function startSseHeartbeat(enqueue: (frame: string) => void, intervalMs = answerStreamHeartbeatIntervalMs) { | ||
| const timer = setInterval(() => { | ||
| try { | ||
| enqueue(sseHeartbeatFrame); | ||
| } catch { | ||
| clearInterval(timer); | ||
| } | ||
| }, intervalMs); | ||
| // Node's setInterval keeps the event loop alive; unref where available so a | ||
| // stray stream cannot pin the process. No-op in edge/browser runtimes. | ||
| (timer as unknown as { unref?: () => void }).unref?.(); | ||
| return () => clearInterval(timer); | ||
| } |
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.