Skip to content

fix(review): give a branch review five minutes to read its changes - #14

Merged
ragnorc merged 4 commits into
mainfrom
claude/angry-noether-8cf918
Oct 31, 2026
Merged

ragnorc merged 4 commits into
mainfrom
claude/angry-noether-8cf918

Conversation

@ragnorc

@ragnorc ragnorc commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Reviews on the hosted personal graph often failed with "Could not reach the server: the request timed out". Studio gave every read 60 s. The server works out a whole page of changes before it answers, and it sets no deadline of its own. On the personal graph (server 0.14.1-edge+7711e4a, measured 2026-10-25), one review page took 37–62 s. So a review landed on either side of the limit, and went over it when the server's caches were cold.

The slowness is in the engine:

What changes

Testing

  • New tests: graph_client a_read_of_changes_waits_longer_than_other_reads and a_timeout_says_whether_the_server_was_reached; review a_slow_review_says_the_server_is_still_working and a_review_that_timed_out_says_the_server_was_still_working.
  • On this branch, rebased onto main at 9ec4e68: cargo test --workspace --no-fail-fast (1,043 passed, 0 failed), cargo clippy --workspace --all-targets -- -D warnings, cargo fmt --all --check, python3 script/check-layers.py, script/check-brand.py and script/check-design-tokens.py all pass.
  • Not tried in the running app against the personal graph.

Note

Medium Risk
Touches HTTP timeout plumbing and review loading/error paths used on every branch review; behavior change is intentional but affects reliability UX on slow graphs rather than security or writes.

Overview
Reviews on large graphs were failing at the old 60 s read limit because the server finishes an entire change page before responding, which often takes close to or over a minute.

graph_client now uses a public CHANGE_READ_TIMEOUT (300 s)—matching write timeout—for the change feed, GET /diff, per-commit changes, and merge dry run; other reads stay at 60 s. fetch / read_within take an explicit timeout, and ReadError::timed_out() distinguishes a slow server response from a connection that never opened (clearer “request timed out” vs “connection timed out” messaging).

Review UI after 10 s shows that the server may still be computing changes; on failure after 5 minutes it explains Studio stopped waiting (not “could not reach the server”) and adds Refresh. Spec/docs record engine deferrals E35–E38 and validation for the new behavior.

Reviewed by Cursor Bugbot for commit b90ca37. Bugbot is set up for automated code reviews on this repo. Configure here.

A page of the change feed, of a diff, of one commit's changes, and a merge's dry run now wait
up to 300 s for their answer, as a write does; every other read keeps 60 s. The server works
such a page out whole before it answers and sets no deadline: on the hosted personal graph one
page of a branch's review took 37 to 60 s, so a 60 s read failed about as often as it answered.
A read is still sent once, unless refused with 429.
A review read for more than 10 s says so: "The server is still working out the changes…",
with "On a large graph this can take a few minutes." under the header. A page of changes the
server had not answered when Studio stopped waiting reads "The server was still working out the
changes after 5 minutes, and Studio stopped waiting." rather than that the server could not be
reached, and the failed review offers Refresh. `ReadError::timed_out` tells such a request from
a connection that did not open, which now reads "the connection timed out".
Spec 012 and the deferred index gain E35 (a diff reads whole tables, #969), E36 (every change
page restarts its work, #970), E37 (a commit only a branch holds is looked up in every branch,
#972) and E38 (a feed page works through up to 128 commits and the HTTP API cannot lower it,
#1157), with the draft RFC #1171, which proposes fragment identity for the first and a commit
ceiling for the last. Spec 008 records why a merged-in review still names its head by commit
id: a diff's page token binds every later page to the sides as the first page spelled them, so
naming the branch stays exact only by reading a page twice when the branch moves.
# Conflicts:
#	crates/graph_client/src/client.rs
#	specs/008-branches-review-merge/plan.md
@cursor

cursor Bot commented Oct 31, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: df6fb8ed-25e2-49fa-a916-ee1394ca4f8a)

@ragnorc
ragnorc merged commit b72f544 into main Oct 31, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant