GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(proxy): raise default upstream stall timeout to 600s by Wibias · Pull Request #378 · lidge-jun/opencodex

Conversation

@Wibias

@Wibias Wibias commented Jul 24, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Summary

Operator sessions on Cursor external models (especially gpt-5.6-sol / xhigh) regularly sit on Connect heartbeat-only frames for well over five minutes while the model thinks — no thinkingDelta / tokenDelta yet, but the stream is still alive.

With the previous default (stallTimeoutSec = 300), the Responses bridge treated that silence as a hung upstream and aborted at ~302s:

  • response.incomplete / upstream_stall_timeout
  • client-visible 502 with Upstream stalled: no data for the stall-timeout window
  • usageStatus: unreported (turn never finished)

Concrete local examples (same night, before the bump): ocx-mrycu6ah-2q and ocx-mryd0nmg-2r both failed at ~302147ms / ~302170ms on gpt-5.6-sol xhigh via cursor, while a neighboring turn that finished under five minutes (ocx-mrycr9qt-2p, ~134s) returned 200. Cursor sometimes also drops with NGHTTP2_INTERNAL_ERROR mid-heartbeat, but those are separate; the ~302s 502s are specifically our stall watchdog.

This PR raises DEFAULT_STALL_TIMEOUT_SEC 300 → 600 so those long heartbeat-only thinks get a 10-minute window before we cut them. Hung streams still die; they just match real Cursor/xhigh think times better. Docs (EN + locales) and web-search stall budget expectations (default + 30s margin → 630) are updated to match.

Operators who already set stallTimeoutSec in config are unchanged; unset installs pick up 600.

Test plan

  • bun test tests/stall-timeout.test.ts
  • bun test web-search stall / bridge-budget cases (expect 630)
  • Local: ~/.opencodex/config.json stallTimeoutSec: 600 + proxy restart (immediate mitigation while this merges)
  • After merge/install: confirm long gpt-5.6-sol xhigh thinks past 5 minutes no longer land as ~302s upstream_stall_timeout 502s

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

chatgpt-codex-connector[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@Wibias
fix(proxy): raise default upstream stall timeout to 600s
c4bb1aa
Long Cursor external xhigh turns often stay heartbeat-only past five minutes; the previous 300s default cut them with upstream_stall_timeout. Align docs and web-search budget expectations.
@Wibias
Wibias requested review from Ingwannu and lidge-jun as code owners July 24, 2026 03:22
@github-actions github-actions Bot added the bug Something isn't working label Jul 24, 2026
@coderabbitai

coderabbitai Bot commented Jul 24, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: a91084d1-9d40-44c0-8018-00202b43afc2

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The default upstream stall timeout increases from 300 to 600 seconds. Runtime fallback logic, web-search timeout calculations, tests, and architecture/configuration documentation are updated accordingly.

Changes

Stall timeout default

Layer / File(s) Summary
Runtime default
src/stall-timeout.ts:5-9
DEFAULT_STALL_TIMEOUT_SEC and invalid or unset-value fallback behavior now use 600 seconds.
Timeout calculation tests
tests/stall-timeout.test.ts:5-7, tests/stall-timeout.test.ts:18-20, tests/web-search-timeout-plan.test.ts:90-92, tests/web-search-timeout-plan.test.ts:106, tests/web-search.test.ts:1224-1227, tests/web-search.test.ts:1237, tests/web-search.test.ts:1240-1244
Assertions now expect the updated 600-second default and resulting 630-second effective web-search stall budgets; bounded 230- and 630-second cases remain covered.
Reference documentation
docs-site/src/content/docs/reference/{architecture,configuration}.md, docs-site/src/content/docs/ja/reference/{architecture,configuration}.md, docs-site/src/content/docs/ko/reference/{architecture,configuration}.md, docs-site/src/content/docs/ru/reference/{architecture,configuration}.md, docs-site/src/content/docs/zh-cn/reference/{architecture,configuration}.md, structure/04-transports-and-sidecars.md:103
Architecture, configuration, and transport references describe the 600-second stallTimeoutSec default while retaining the existing stall handling and 2-second heartbeat behavior.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: lidge-j, ingwannu

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: increasing the default upstream stall timeout from 300s to 600s.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/stall-timeout-600

Comment @coderabbitai help to get the list of available commands.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

coderabbitai[bot]
coderabbitai Bot reviewed Jul 24, 2026
View reviewed changes

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@structure/04_transports-and-sidecars.md`:
- Line 103: Update the derived web-search budget documentation to reflect the
600-second default stallTimeoutSec: document the effective default as 630
seconds, consistent with max(600, 200, 200, 200) plus the 30-second allowance.
Keep the documented CLI/API defaults and calculation synchronized.
- Around line 103-105: Update the stall deadline documentation to explicitly
state that the shared ChatGPT forward/passthrough adapter and bridge streaming
path powers both the web-search and vision sidecars. Make clear that the
600-second timeout and heartbeat behavior apply across this shared
forward/sidecar path, not only to the primary provider request or web search.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 13e835cc-abc6-489e-85e8-5fd7b32db9d1

📥 Commits

Reviewing files that changed from the base of the PR and between a83ac81 and c4bb1aa.

📒 Files selected for processing (15)
  • docs-site/src/content/docs/ja/reference/architecture.md
  • docs-site/src/content/docs/ja/reference/configuration.md
  • docs-site/src/content/docs/ko/reference/architecture.md
  • docs-site/src/content/docs/ko/reference/configuration.md
  • docs-site/src/content/docs/reference/architecture.md
  • docs-site/src/content/docs/reference/configuration.md
  • docs-site/src/content/docs/ru/reference/architecture.md
  • docs-site/src/content/docs/ru/reference/configuration.md
  • docs-site/src/content/docs/zh-cn/reference/architecture.md
  • docs-site/src/content/docs/zh-cn/reference/configuration.md
  • src/stall-timeout.ts
  • structure/04_transports-and-sidecars.md
  • tests/stall-timeout.test.ts
  • tests/web-search-timeout-plan.test.ts
  • tests/web-search.test.ts

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread structure/04_transports-and-sidecars.md
timer (Codex's default `stream_idle_timeout` is 300 s and ANY SSE event re-arms it). Those
bridge-enqueued keepalive frames do NOT count as activity for the bridge's own watchdog: a bounded
stall deadline (default 300 s, configurable via `stallTimeoutSec`, checked on the 2 s heartbeat tick)
stall deadline (default 600 s, configurable via `stallTimeoutSec`, checked on the 2 s heartbeat tick)

@coderabbitai coderabbitai Bot Jul 24, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Update the derived web-search budget to 630 seconds.

Line [103] now documents a 600-second base stall timeout, but Lines [124]-[132] still say the effective default is 230 seconds. With the documented defaults, the calculation is max(600, 200, 200, 200) + 30 = 630 seconds. This contradiction can mislead operators when diagnosing or configuring long web-search turns.

As per path instructions, user-facing documentation must remain synchronized with actual CLI/API behavior.

Proposed documentation fix
-`max(base stall, connect timeout, routed-model stall, sidecar timeout) + 30 s` (230 s at defaults),
+`max(base stall, connect timeout, routed-model stall, sidecar timeout) + 30 s` (630 s at defaults),
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@structure/04_transports-and-sidecars.md` at line 103, Update the derived
web-search budget documentation to reflect the 600-second default
stallTimeoutSec: document the effective default as 630 seconds, consistent with
max(600, 200, 200, 200) plus the 30-second allowance. Keep the documented
CLI/API defaults and calculation synchronized.

Source: Path instructions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread structure/04_transports-and-sidecars.md
Comment on lines +103 to 105
stall deadline (default 600 s, configurable via `stallTimeoutSec`, checked on the 2 s heartbeat tick)
closes the stream with `response.incomplete` / `upstream_stall_timeout` and cancels the upstream
request if no real adapter events arrive. Adapter-yielded `{ type: "heartbeat" }` events DO reset

@coderabbitai coderabbitai Bot Jul 24, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Clarify that the shared bridge path also covers both sidecars.

The timeout description should explicitly state that the ChatGPT forward/passthrough adapter and bridge streaming path powers both the web-search and vision sidecars. Without that scope, readers may incorrectly assume this 600-second stall deadline applies only to the primary provider request or web search.

As per path instructions, bridge stall-timeout wording must reflect the shared forward/sidecar path.

Proposed clarification
 The HTTP/SSE bridge emits `response.heartbeat` events during upstream silence ...
+The same ChatGPT forward/passthrough adapter and bridge streaming path powers the web-search and
+vision sidecars, so this stall deadline applies to those sidecar streams as well.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
stall deadline (default 600 s, configurable via `stallTimeoutSec`, checked on the 2 s heartbeat tick)
closes the stream with `response.incomplete` / `upstream_stall_timeout` and cancels the upstream
request if no real adapter events arrive. Adapter-yielded `{ type: "heartbeat" }` events DO reset
stall deadline (default 600 s, configurable via `stallTimeoutSec`, checked on the 2 s heartbeat tick)
closes the stream with `response.incomplete` / `upstream_stall_timeout` and cancels the upstream
request if no real adapter events arrive. Adapter-yielded `{ type: "heartbeat" }` events DO reset
The same ChatGPT forward/passthrough adapter and bridge streaming path powers the web-search and
vision sidecars, so this stall deadline applies to those sidecar streams as well.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@structure/04_transports-and-sidecars.md` around lines 103 - 105, Update the
stall deadline documentation to explicitly state that the shared ChatGPT
forward/passthrough adapter and bridge streaming path powers both the web-search
and vision sidecars. Make clear that the 600-second timeout and heartbeat
behavior apply across this shared forward/sidecar path, not only to the primary
provider request or web search.

Source: Path instructions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Wibias
Wibias marked this pull request as draft July 24, 2026 03:37
@Wibias
docs(structure): sync stall docs with 600s default for CodeRabbit
02d7eb5
Fix the leftover 230s web-search budget example to 630s, and note that the
bridge stall deadline also covers web-search and vision sidecar streams.
@lidge-jun

lidge-jun commented Jul 24, 2026

Copy link
Copy Markdown
Owner

Closing with thanks — the premise no longer holds on current dev. Since the heartbeat work landed (WP4), the bridge resets the stall clock on EVERY adapter event, including keepalive heartbeats (src/bridge.ts:452; pinned by tests/bridge.test.ts:461), and Cursor converts token deltas/checkpoint progress into heartbeat events (src/adapters/cursor/live-transport.ts:860,935). So a "heartbeat-only progress got cut at 300s" scenario points to a pre-WP4 runtime or a heartbeat-delivery gap — not to a too-small budget.

Raising the global default to 600s would keep truly dead upstreams alive for 10 minutes everywhere and push the web-search watchdog to ~630s (structure/04_transports-and-sidecars.md:124) — a global double-mask. Long-running Cursor operators already have the per-config stallTimeoutSec override.

If a 300s cut still reproduces on a WP4+ runtime, please reopen with the exact SHA, a restarted proxy, and the last adapter-event type + timestamp — that would indicate a heartbeat delivery bug, which we would fix directly instead.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@lidge-jun lidge-jun closed this Jul 24, 2026
lidge-jun added a commit that referenced this pull request Jul 24, 2026
@lidge-jun
docs(devlog): triage final — #356/#358/#377 MERGED, #378 CLOSED, #370/#…
9dc88f2
…376/#379 DEFER
@coderabbitai coderabbitai Bot mentioned this pull request Jul 24, 2026
fix(web-search): bound sidecar search deadline to 60s + graceful degradation (#398) #416
Merged
@Wibias
Wibias deleted the fix/stall-timeout-600 branch July 31, 2026 08:26
@coderabbitai coderabbitai Bot mentioned this pull request Sep 6, 2026
fix: preserve compaction progress and use a 600s stall budget #3736
Closed
4 of 7 tasks
agentHits pushed a commit to agentHits/opencodex that referenced this pull request Sep 17, 2026
@lidge-jun
docs(devlog): triage final — lidge-jun#356/lidge-jun#358/lidge-jun#377 …
e4e5fe7
…MERGED, lidge-jun#378 CLOSED, lidge-jun#370/lidge-jun#376/lidge-jun#379 DEFER
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@coderabbitai coderabbitai[bot] coderabbitai[bot] left review comments
@lidge-jun lidge-jun Awaiting requested review from lidge-jun lidge-jun is a code owner
@Ingwannu Ingwannu Awaiting requested review from Ingwannu Ingwannu is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

bug Something isn't working

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@Wibias @lidge-jun
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.