perf(server): tighten pair probe budgets - #12028
Adamulek123 wants to merge 12 commits into
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: pingdotgg/t3code/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📥 CommitsReviewing files that changed from the base of the PR and between 6c5f68900894564f8f10e00ba0df10d1dcf10931 and 6947f22. 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review. 📝 WalkthroughWalkthroughThe pair command bounds and validates environment descriptor responses before decoding. It probes live candidates concurrently, selects the first descriptor by precedence, cancels lower-priority probes, and avoids a final retry delay. ChangesPair target discovery
Priority: ⬇️ Low Estimated code review effort: 4 (Complex) | ~45 minutes Change: Bug fix Sequence Diagram(s)sequenceDiagram
participant PairCommand
participant CandidateState
participant EnvironmentProbes
participant DescriptorDecoder
PairCommand->>CandidateState: collect live candidates
PairCommand->>EnvironmentProbes: start concurrent probes
EnvironmentProbes->>DescriptorDecoder: decode bounded 2xx JSON response
DescriptorDecoder-->>EnvironmentProbes: descriptor or failure
EnvironmentProbes-->>PairCommand: probe results
PairCommand->>EnvironmentProbes: cancel lower-priority probes
PairCommand-->>PairCommand: select descriptor by precedence
Suggested reviewers: Merge Risk: ⚪ Minimal · up to Pair discovery now bounds and validates responses, probes candidates concurrently while preserving precedence, cancels unnecessary probes, and avoids the final retry delay. These changes limit hangs and improve pairing responsiveness without a concrete merge-blocking risk. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — The production pairing path now performs concurrent, cancelable server discovery and applies new response-size, media-type, status, timeout, and retry rules before selecting the server used for pairing. Although the change is well covered by tests and does not alter schemas or deployment configuration, its runtime and authentication-path impact is substantial enough for human review. You can add or adjust custom eligibility rules. Learn more. |
f36c1a8 to
5c5e602
Compare
Dismissing prior approval to re-evaluate 5c5e602
Stream the descriptor and 502/503/504 drain through a byte-counted read capped at MAX_PROBE_BODY_BYTES with PAIR_PROBE_TIMEOUT, before decoding to text. Normalize the JSON content-type check. Covers uppercase content types, slow-drip bodies, and multibyte UTF-8 oversize.
… media-type check
…r is known Fork all candidate probes under a scope, join fibers in discovery order, and return the first descriptor without waiting for losers (scope teardown interrupts them). Adds overlap/cancellation, discovery-order, and test-clock retry-budget coverage.
6c5f689 to
6947f22
Compare
Dismissing prior approval to re-evaluate 6b91dc5
Summary
Pairing discovery probed up to 4 candidates strictly sequentially (worst ~10s), and the Tailscale cert-wait slept a full second after its final attempt.
What changed
Validation
vp test run apps/server/src/cli/pair.test.ts— 26/26 pass.Summary by CodeRabbit
Bug Fixes