Repository navigation
fix(client-runtime): sync #45024 fixes and resolve #44850 review findings - #135
Merged
Merged
Conversation
…ver relay The better-route check now runs on connect, and a silent result there backed off for two minutes, so it skipped the check main ran at one minute. Start the silent-route backoff at one check interval. (cherry picked from commit c312867)
A check still queued for an ended lease filled the one-slot dropping queue, so the check the new lease asked for on connect was discarded. Keep the newest request instead. (cherry picked from commit 835e3ce)
A check runs a little after its tick, so a silent route's deadline landed just past the tick it was meant for and the route waited a whole extra interval. Set the deadline half an interval early. (cherry picked from commit f432f5b)
A socket that went silent while its host still answered a fresh request was replaced without counting against its route, so a route whose sockets kept going silent never cooled down. Record a route loss for that replacement, except during a long resume, when the OS killing a suspended socket is the likely cause. Fixes a CodeRabbit finding on pingdotgg#44850. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…t is removed The ath hash cache is keyed by the raw access token, and explicit removal never reached it, so a removed environment's token stayed in memory until a later miss filled the cache. Removal now clears the cache. Fixes a CodeRabbit finding on pingdotgg#44850. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…d upstream pingdotgg#45024 is taken at its final head f432f5b. pingdotgg#42658, pingdotgg#44742 and pingdotgg#45024 are closed upstream. pingdotgg#44742's head only merged upstream main, which the fork already resolved the same way, so its taken SHA moves to that head. Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
Codex Review Summary: ✅ CompletedThis 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. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Upstream closed pingdotgg#45024 after adding three bug-fix commits on top of the one the fork carries, and pingdotgg#44850 still has two unresolved CodeRabbit findings. This PR pulls in the pingdotgg#45024 fixes, fixes both pingdotgg#44850 findings, and refreshes the carried-PR manifest.
pingdotgg#45024: upstream's follow-up fixes
Cherry-picked unchanged from
pingdotgg/t3code#45024(the changed lines match upstream exactly, and pingdotgg#44850's route cooldown is untouched):c3128677a8: the silent-route backoff starts at one check interval, so after connecting over T3 Connect, LAN is still checked at one minute. The schedule is 0, 1, 3, 7 minutes instead of 0, 2, 6.835e3ce79e:betterRouteChecksisQueue.sliding(1), so a check still queued for an ended session can no longer drop the new session's check on connect.f432f5b91b: a silent route's deadline is set half an interval early, so a check that runs a little after its tick still gets the next tick.CodeRabbit's backoff finding on
f432f5b91bis a false positive, so the code is unchanged. The finding said2 ** (failures - 1)halves the backoff compared with2 ** failures. It does, on purpose: the new check on connect counts as the first failure, so the shorter exponent keeps main's 1, 3, 7 minute schedule and adds the 0-minute check. I restored2 ** failureslocally and the "checks a silent LAN route again" tests failed (4 LAN checks instead of 5, so the one-minute check was skipped). CodeRabbit withdrew the finding upstream after the author gave the same explanation.pingdotgg#44850: review findings
Silent sockets now count as route losses (valid, fixed). A socket that went silent while its host still answered a fresh request was replaced without being recorded, so a route whose sockets kept going silent (for example, a black-holed Tailscale tunnel) never cooled down. That replacement now records a route loss.
Replacements during a long resume (10 s or more in the background) still don't count. After a long suspension, iOS killing the socket is the likely cause, not the route. That applies both to a silent socket found during a long resume and to the long-resume probe timeout. Otherwise, switching apps a few times would push a healthy LAN to the back for five minutes.
Removing an environment now forgets cached
athhashes (valid, fixed). The hash cache is a module-level map keyed by the raw access token, and explicit removal never reached it.DpopProof.forgetAccessTokenHashesclears the cache, andEnvironmentRegistrycalls it next to the other cleanup on explicit removal. The cache does not know which environment a token belongs to, so removal clears every entry. Other environments rehash once on their next request.Carried-PR manifest
#45024:takenShaset tof432f5b91b,closedUpstream: true.#42658:closedUpstream: true.#44742:closedUpstream: true. Upstream's head also moved from4b16012003to462b6289c5, which only merges upstream main into the PR. The fork already matches it:ProviderEventIngestor.tsis identical, and the PR diff at462b6289c5reverse-applies cleanly to this branch. SotakenShanow points at462b6289c5, with a note like#17890's. Otherwise it would keep reporting drift.#44850: added a note that the fork carries the two fixes above on top of it.node scripts/fork-carried-prs.tsnow reports all 18 carried PRs asunchanged.Verification
vp test run src/connection/ src/relay/inpackages/client-runtime: 297 tests in 19 files pass.forgetAccessTokenHashes.vp test run scripts/fork-carried-prs.test.tspasses.vp run typecheckinpackages/client-runtimepasses.vp run check:changed 1318ff6efbpasses: format, lint, knip, typecheck (43 packages, since the manifest change runs everything), and 155 tests next to the changed files.Not exercised on a device. These are client-runtime connection changes with no UI.
Model and harness: Claude Opus 5.5 via Claude Code in T3 Code.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.