Repository navigation
fix(antigravity-ls-proxy): bound language-server RPCs with timeouts (#2102) - #4080
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 25 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. CodeRabbit Verify
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3afde72a9b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| while (completedResponse === null && Date.now() < cascadeDeadline) { | ||
| await new Promise(r => setTimeout(r, 250)); | ||
| const trajectory = await lsManager.callRpc('GetCascadeTrajectorySteps', { cascadeId }); |
There was a problem hiding this comment.
Apply the remaining cascade deadline to each poll
When a trajectory poll starts near the deadline, the subsequent sleep and RPC are not constrained by the remaining time, and a completed response is accepted even after the deadline expires. With production defaults, this can overrun the advertised 30-second polling limit by the sleep, heartbeat, and full 5-second RPC budget. I reproduced HTTP 200 after approximately 1.3 seconds with a 100ms cascade deadline and a 1000ms trajectory delay. Bound the sleep and in-flight poll by the remaining cascade budget, and check expiration before accepting the result.
Useful? React with 👍 / 👎.
…proxy-rpcs # Conflicts: # bin/antigravity-ls-proxy.test.mjs
…eadline (#2102) Codex P2 on PR #4080: a poll starting near the deadline could sleep a full 250ms, run a full 5s RPC, and have its late response accepted, overrunning the 30s cascade deadline. The sleep and the poll RPC are now capped at the remaining budget (callRpc gains an optional cap that can only shrink the per-method budget), a poll that hits the cap reads as the deadline expiring, and a response landing after the deadline is discarded. Regression test mirrors the Codex repro (100ms deadline, 1000ms trajectory delay): the request now ends at the deadline with the cascade timeout error instead of HTTP 200 after ~1.3s. node --test bin/antigravity-ls-proxy.test.mjs: 20/20 pass on laptop.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Fixes #2102 (task 5092).
Change
bin/antigravity-ls-proxy.mjs—callRpcno longer fetches the language server unbounded:AbortSignal.timeoutthat covers both the fetch and the response-body read: GetAvailableModels 3000ms, StartCascade 30000ms, SendUserCascadeMessage 30000ms, GetCascadeTrajectorySteps 5000ms, GetModelResponse 300000ms (long generations keep their minutes); default 30000ms for any other method. A timeout throwsRPC <method> timed out after <budget>ms.Date.now()based) instead of the old 120-iteration count that slow polls could stretch far past 30s./v1/modelsfall back to the static/cached catalog (existinggetLiveCatalogbehavior, now actually reachable in bounded time); stalled chat RPCs surface as a clean API error from the existing chat error handler — nothing hangs indefinitely.ANTIGRAVITY_LS_RPC_TIMEOUTS(JSON method→ms) and the cascade deadline viaANTIGRAVITY_LS_CASCADE_DEADLINE_MS, so tests use ~200ms budgets instead of waiting minutes.Heartbeat and sync-models timeouts were already bounded and are untouched; design-code-proxy (#2097) and clef-proxy (#2100) are out of scope.
Tests
node --test bin/antigravity-ls-proxy.test.mjs— 18/18 pass (13 existing + 5 new):/v1/modelsstill serves the static catalog, boundedNeed help on this PR? Tag
@codesmith-botwith what you need.