fix(client-runtime): retry auth-blocked reconnects during server-update resume - #138
Conversation
…te resume A restarted remote server can reject the environment credential once and leave the supervisor blocked. The update resume loop only nudged backoff, so recovery stopped. Admit authentication-blocked supervisor states on the same one-second cadence as backoff. Permission and configuration failures stay blocked. A command-boundary test drives the public updateServer path through that transient block to a matching ready event. Refs #134 Co-authored-by: Gannon Hall <gannonh@users.noreply.github.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 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. Comment |
|
@coderabbitai review |
|
Co-authored-by: Gannon Hall <gannonh@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5f2875ccb6
ℹ️ 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".
What Changed
nudgeReconnectDuringUpdateRestartnow also retries when the connection supervisor is blocked onauthenticationduring a remote server-update resume. Permission and configuration blocks stay idle.Why
A restarted remote server can reject the first environment credential. The supervisor then parks in
blocked, and the resume loop used to stop nudging because it only watchedbackoff. Recovery could sit until the four-minute timeout.This ports upstream pingdotgg/t3code#7953 and keeps the existing one-second pacing and four-minute resume lifetime.
Scope
packages/client-runtime/src/state/server.ts. Widen the nudge stream type and admitphase === "blocked"only whenlastFailure?.reason === "authentication".packages/client-runtime/src/state/server.test.ts. Helper filter test plus a command-boundary test ofcreateServerEnvironmentAtoms(...).updateServer.Out of scope: credential storage, authorization policy, supervisor retry policy, contracts, server, UI.
Closes #134
Tradeoffs
Retrying every blocked reason would hide real setup failures. The filter admits only
authentication.Blast Radius
Web, desktop, and mobile share this client-runtime command. Remote update resume is the only new retry path. Idle blocked permission and configuration behavior is unchanged.
Verification
vp test run packages/client-runtime/src/state/server.test.ts(15 passed)vp run --filter @kata-sh/code-client-runtime typecheck(exit 0)@t3tools/,T3CODE_,t3@,t3code,pingdotgg/t3code(no matches)Build report: #134 (comment)
Acceptance criteria matrix
Full matrix: #134 (comment)
updateServercommand-boundary test plus filterforkChildplustimeoutOption(4 minutes)recovers the update command after a transient credential rejection@kata-sh/code-cli@copy test; identity grep emptyTotals: 7 Pass / 0 Fail / 0 Blocked (acceptance checkboxes). Supplementary live remote update: Blocked (no disposable target).
Convergence: #134 (comment)
UI Changes
None.
Checklist