GeezerVison is showing github.com — fix(desktop): a WSL backend counts as ready only when it answers as this launch by juliusmarminge · Pull Request #41985 · pingdotgg/t3code
Conversation
What changes
A backend started inside WSL has no control channel to the desktop app (wsl.exe passes only stdin, stdout and stderr), so the app decides it is ready by polling it over HTTP. That poll used to accept any successful response from the backend's address.
Now each WSL launch gets its own readiness secret, delivered on stdin with the rest of the bootstrap. The app polls /.well-known/t3/desktop-readiness with a fresh challenge and treats the backend as ready only when the answer is a proof derived from that launch's secret. A backend launched without a readiness secret does not serve the route (404). Backends with a control channel are unchanged: they still report readiness there.
Nothing changes for users when startup is healthy. If something other than the launched backend is listening on the WSL backend's address, the app now reports that the server did not become ready instead of connecting to it.
How it is built
packages/shared/src/desktopReadinessProof.ts: derive and check the proof (HMAC-SHA256 over the challenge), shared by server and desktop.
packages/contracts: optional desktopReadinessSecret in the desktop bootstrap.
- Server: the route in
apps/server/src/http.ts, registered in server.ts.
packages/shared/src/httpReadiness.ts: optional accept(body) so a caller can decide from the response body whether the listener counts as ready.
- Desktop:
DesktopBackendConfiguration creates the secret and probe per WSL start config; DesktopBackendManager uses the probe when a backend has no control channel.
Testing
DesktopBackendManager.test.ts: a polled backend stays not ready while its address answers 200 without the proof, and becomes ready once the proof is served. This test fails on main.
DesktopBackendConfiguration.test.ts: every WSL config resolve yields a different secret, each probe uses a new challenge, and a probe accepts only a proof from its own launch's secret.
http.test.ts: the route answers with a valid proof, and returns 404 without a challenge, with an oversized one, or without a configured secret.
desktopReadinessProof.test.ts: proof validity per secret and challenge.
- Ran the real server on Linux with a stdin bootstrap carrying a readiness secret in a temporary home: the route returned the expected proof once startup finished, and 404 without a challenge.
- Not exercised: an actual Windows host launching through
wsl.exe. The WSL launch path itself is covered only by the unit tests above.
vp run check:changed passes.
🤖 Generated with Claude Code
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…his launch
A WSL backend has no control channel, so the desktop app polls it over HTTP.
Each WSL launch now gets its own readiness secret on stdin, and the app treats
the backend as ready only when the listener at its address answers a fresh
challenge with a proof derived from that secret.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Thread transfer impact
✅ Thread transfer remains within every enforced ceiling.
| Provider |
Metric |
Main baseline |
This PR |
Impact |
PR ceiling |
|
| Codex |
Total thread wire |
5.0 KiB |
5.0 KiB |
0 B (0.0%) |
6.8 KiB |
✅ |
| Codex |
Thread snapshot wire |
3.8 KiB |
3.8 KiB |
0 B (0.0%) |
4.9 KiB |
✅ |
| Codex |
Live turn WebSocket wire |
1.2 KiB |
1.2 KiB |
0 B (0.0%) |
2.0 KiB |
✅ |
| Codex |
Live turn WebSocket decoded |
21.5 KiB |
21.5 KiB |
0 B (0.0%) |
24.4 KiB |
✅ |
| Codex |
Live turn messages |
1 |
1 |
0 (0.0%) |
8 |
✅ |
| Claude |
Total thread wire |
5.0 KiB |
5.0 KiB |
0 B (0.0%) |
6.8 KiB |
✅ |
| Claude |
Thread snapshot wire |
3.8 KiB |
3.8 KiB |
0 B (0.0%) |
4.9 KiB |
✅ |
| Claude |
Live turn WebSocket wire |
1.2 KiB |
1.2 KiB |
0 B (0.0%) |
2.0 KiB |
✅ |
| Claude |
Live turn WebSocket decoded |
21.9 KiB |
21.9 KiB |
0 B (0.0%) |
24.4 KiB |
✅ |
| Claude |
Live turn messages |
1 |
1 |
0 (0.0%) |
8 |
✅ |
Other scenarios
All 64 scenario measurements match main.
All 64 scenario measurements
| Provider |
Scenario |
Metric |
Main baseline |
This PR |
Impact |
PR ceiling |
|
| Codex |
short turn resume |
WebSocket decoded |
10.5 KiB |
10.5 KiB |
0 B (0.0%) |
12.7 KiB |
✅ |
| Codex |
short turn resume |
WebSocket messages |
2 |
2 |
0 (0.0%) |
2 |
✅ |
| Codex |
long turn running, cold open |
HTTP decoded |
281.7 KiB |
281.7 KiB |
0 B (0.0%) |
302.7 KiB |
✅ |
| Codex |
long turn running, cold open |
rows |
75 |
75 |
0 (0.0%) |
75 |
✅ |
| Codex |
long turn running, history page |
HTTP decoded |
92.4 KiB |
92.4 KiB |
0 B (0.0%) |
107.4 KiB |
✅ |
| Codex |
long turn running, history page |
rows |
75 |
75 |
0 (0.0%) |
75 |
✅ |
| Codex |
long turn finished, cold open |
HTTP decoded |
381.5 KiB |
381.5 KiB |
0 B (0.0%) |
410.2 KiB |
✅ |
| Codex |
long turn finished, cold open |
rows |
151 |
151 |
0 (0.0%) |
151 |
✅ |
| Codex |
long turn finished, socket cold open |
WebSocket decoded |
381.6 KiB |
381.6 KiB |
0 B (0.0%) |
410.2 KiB |
✅ |
| Codex |
long turn finished, socket cold open |
WebSocket messages |
2 |
2 |
0 (0.0%) |
2 |
✅ |
| Codex |
long turn finished, socket cold open |
rows |
151 |
151 |
0 (0.0%) |
151 |
✅ |
| Codex |
long turn finished, work page |
HTTP decoded |
186.2 KiB |
186.2 KiB |
0 B (0.0%) |
200.2 KiB |
✅ |
| Codex |
long turn finished, work page |
rows |
150 |
150 |
0 (0.0%) |
150 |
✅ |
| Codex |
idle thread resume |
WebSocket decoded |
65 B |
65 B |
0 B (0.0%) |
200 B |
✅ |
| Codex |
idle thread resume |
WebSocket messages |
1 |
1 |
0 (0.0%) |
1 |
✅ |
| Codex |
fleet shell snapshot |
HTTP decoded |
42.4 KiB |
42.4 KiB |
0 B (0.0%) |
53.7 KiB |
✅ |
| Codex |
fleet shell snapshot |
rows |
27 |
27 |
0 (0.0%) |
27 |
✅ |
| Codex |
fleet shell subscribe |
WebSocket decoded |
65 B |
65 B |
0 B (0.0%) |
200 B |
✅ |
| Codex |
fleet shell subscribe |
WebSocket messages |
1 |
1 |
0 (0.0%) |
1 |
✅ |
| Codex |
fleet shell resume check |
HTTP decoded |
18 B |
18 B |
0 B (0.0%) |
100 B |
✅ |
| Codex |
fleet shell resume check |
rows |
0 |
0 |
0 |
0 |
✅ |
| Codex |
stale shell reload |
HTTP decoded |
42.4 KiB |
42.4 KiB |
0 B (0.0%) |
53.7 KiB |
✅ |
| Codex |
stale shell reload |
rows |
27 |
27 |
0 (0.0%) |
27 |
✅ |
| Codex |
stale shell resume |
WebSocket decoded |
140 B |
140 B |
0 B (0.0%) |
400 B |
✅ |
| Codex |
stale shell resume |
WebSocket messages |
2 |
2 |
0 (0.0%) |
2 |
✅ |
| Codex |
stale todo list cold open |
HTTP decoded |
72.4 KiB |
72.4 KiB |
0 B (0.0%) |
83.0 KiB |
✅ |
| Codex |
stale todo list cold open |
rows |
75 |
75 |
0 (0.0%) |
75 |
✅ |
| Codex |
stale todo list cold open |
nodes |
2 |
2 |
0 (0.0%) |
4 |
✅ |
| Codex |
stale todo list cold open |
subagents |
2 |
2 |
0 (0.0%) |
4 |
✅ |
| Codex |
stale todo list cold open |
plans |
1 |
1 |
0 (0.0%) |
2 |
✅ |
| Codex |
stale todo list cold open |
providerTurns |
1 |
1 |
0 (0.0%) |
2 |
✅ |
| Codex |
stale todo list cold open |
checkpoints |
1 |
1 |
0 (0.0%) |
2 |
✅ |
| Claude |
short turn resume |
WebSocket decoded |
10.6 KiB |
10.6 KiB |
0 B (0.0%) |
12.7 KiB |
✅ |
| Claude |
short turn resume |
WebSocket messages |
2 |
2 |
0 (0.0%) |
2 |
✅ |
| Claude |
long turn running, cold open |
HTTP decoded |
283.3 KiB |
283.3 KiB |
0 B (0.0%) |
302.7 KiB |
✅ |
| Claude |
long turn running, cold open |
rows |
75 |
75 |
0 (0.0%) |
75 |
✅ |
| Claude |
long turn running, history page |
HTTP decoded |
93.4 KiB |
93.4 KiB |
0 B (0.0%) |
107.4 KiB |
✅ |
| Claude |
long turn running, history page |
rows |
75 |
75 |
0 (0.0%) |
75 |
✅ |
| Claude |
long turn finished, cold open |
HTTP decoded |
384.2 KiB |
384.2 KiB |
0 B (0.0%) |
410.2 KiB |
✅ |
| Claude |
long turn finished, cold open |
rows |
151 |
151 |
0 (0.0%) |
151 |
✅ |
| Claude |
long turn finished, socket cold open |
WebSocket decoded |
384.3 KiB |
384.3 KiB |
0 B (0.0%) |
410.2 KiB |
✅ |
| Claude |
long turn finished, socket cold open |
WebSocket messages |
2 |
2 |
0 (0.0%) |
2 |
✅ |
| Claude |
long turn finished, socket cold open |
rows |
151 |
151 |
0 (0.0%) |
151 |
✅ |
| Claude |
long turn finished, work page |
HTTP decoded |
188.1 KiB |
188.1 KiB |
0 B (0.0%) |
200.2 KiB |
✅ |
| Claude |
long turn finished, work page |
rows |
150 |
150 |
0 (0.0%) |
150 |
✅ |
| Claude |
idle thread resume |
WebSocket decoded |
66 B |
66 B |
0 B (0.0%) |
200 B |
✅ |
| Claude |
idle thread resume |
WebSocket messages |
1 |
1 |
0 (0.0%) |
1 |
✅ |
| Claude |
fleet shell snapshot |
HTTP decoded |
43.0 KiB |
43.0 KiB |
0 B (0.0%) |
53.7 KiB |
✅ |
| Claude |
fleet shell snapshot |
rows |
27 |
27 |
0 (0.0%) |
27 |
✅ |
| Claude |
fleet shell subscribe |
WebSocket decoded |
66 B |
66 B |
0 B (0.0%) |
200 B |
✅ |
| Claude |
fleet shell subscribe |
WebSocket messages |
1 |
1 |
0 (0.0%) |
1 |
✅ |
| Claude |
fleet shell resume check |
HTTP decoded |
18 B |
18 B |
0 B (0.0%) |
100 B |
✅ |
| Claude |
fleet shell resume check |
rows |
0 |
0 |
0 |
0 |
✅ |
| Claude |
stale shell reload |
HTTP decoded |
43.0 KiB |
43.0 KiB |
0 B (0.0%) |
53.7 KiB |
✅ |
| Claude |
stale shell reload |
rows |
27 |
27 |
0 (0.0%) |
27 |
✅ |
| Claude |
stale shell resume |
WebSocket decoded |
140 B |
140 B |
0 B (0.0%) |
400 B |
✅ |
| Claude |
stale shell resume |
WebSocket messages |
2 |
2 |
0 (0.0%) |
2 |
✅ |
| Claude |
stale todo list cold open |
HTTP decoded |
73.4 KiB |
73.4 KiB |
0 B (0.0%) |
83.0 KiB |
✅ |
| Claude |
stale todo list cold open |
rows |
75 |
75 |
0 (0.0%) |
75 |
✅ |
| Claude |
stale todo list cold open |
nodes |
2 |
2 |
0 (0.0%) |
4 |
✅ |
| Claude |
stale todo list cold open |
subagents |
2 |
2 |
0 (0.0%) |
4 |
✅ |
| Claude |
stale todo list cold open |
plans |
1 |
1 |
0 (0.0%) |
2 |
✅ |
| Claude |
stale todo list cold open |
providerTurns |
1 |
1 |
0 (0.0%) |
2 |
✅ |
| Claude |
stale todo list cold open |
checkpoints |
1 |
1 |
0 (0.0%) |
2 |
✅ |
Baseline: f8b3ff0 · PR result: 1424821 · Source CI: success
Scenario and decoded snapshot size
10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
- Codex decoded thread snapshot: 108.5 KiB
- Claude decoded thread snapshot: 108.8 KiB
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|

No actionable comments were generated in the recent review.
Walkthrough
-
WSL launches now receive a per-launch readiness secret and probe. The server exposes a challenge-bound HMAC proof route, and desktop HTTP polling validates response bodies before marking a backend ready. Shared HTTP readiness polling accepts an optional response validator and retains default acceptance when none is supplied.
Changes: WSL readiness proof
| Layer / File(s) |
Summary |
Readiness proof contract packages/shared/src/desktopReadinessProof.ts, packages/shared/src/desktopReadinessProof.test.ts, packages/shared/package.json, packages/contracts/src/desktopBootstrap.ts |
The shared package adds HMAC proof generation and timing-safe validation. The bootstrap schema adds the optional readiness secret, and tests cover valid and invalid proofs. |
Server proof route apps/server/src/config.ts, apps/server/src/cli/config.ts, apps/server/src/http.ts, apps/server/src/server.ts, apps/server/src/http.test.ts |
Server configuration reads the bootstrap secret. A registered route returns a challenge-bound proof when the secret and challenge are valid, and returns 404 otherwise. |
HTTP readiness response validation apps/desktop/src/backend/DesktopBackendManager.ts, packages/shared/src/httpReadiness.ts, apps/desktop/src/backend/DesktopBackendManager.test.ts |
HTTP polling can use a configured path and response-body predicate. The shared poller reads successful response bodies and rejects responses that fail the predicate. |
Per-launch WSL probe apps/desktop/src/backend/DesktopBackendConfiguration.ts, apps/desktop/src/backend/DesktopBackendConfiguration.test.ts |
WSL configuration creates a random secret and challenge-specific probe, passes the secret through bootstrap data, and supplies the probe at startup. Tests verify that only the matching launch proof is accepted. |
Estimated code review effort: 3 (Moderate) | ~25 minutes
Change: Bug fix
Sequence Diagram(s)
sequenceDiagram
participant Config as DesktopBackendConfiguration
participant Poller as DesktopBackendManager
participant Route as ServerHttp.layerDesktopReadinessProofRoute
participant Validator as isValidDesktopReadinessProof
Config->>Poller: supply launch-specific readiness probe
Poller->>Route: GET proof path with challenge
Route-->>Poller: return proof for configured secret and challenge
Poller->>Validator: validate response body with launch secret and challenge
Validator-->>Poller: return accepted or rejected
Loading
Possibly related issues
Merge Risk: Minimal · up to 14248
-
WSL backend readiness now requires proof from the backend launched by this desktop session, so a different server at the same address is reported as not ready. Healthy startup is unchanged and backends without a readiness secret behave as before. The change is isolated and covered by unit tests. Only the real Windows-to-WSL launch path was not exercised.
Pre-merge checks: 4
-
| Check name |
Status |
Explanation |
| Title check |
 |
The title names the main change: WSL backend readiness is now gated on a proof from this launch's secret. It uses the conventional commit prefix and matches the changeset, which adds a per-launch read… |
| Description check |
 |
The description follows the template sections (What changes, How it is built, Testing) and covers the problem, the change, and verification with specific tests and manual checks. It omits the template… |
| Linked Issues check |
 |
Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check |
 |
Check skipped because no linked issues were found for this pull request. |
Full details: Title check
-
Explanation
The title names the main change: WSL backend readiness is now gated on a proof from this launch's secret. It uses the conventional commit prefix and matches the changeset, which adds a per-launch readiness secret, a proof route, and a probe-based readiness check.
Full details: Description check
-
Explanation
The description follows the template sections (What changes, How it is built, Testing) and covers the problem, the change, and verification with specific tests and manual checks. It omits the template's Problem, Scope, and issue-link headings, and it does not link an issue or say why no issue is needed. It also does not state the template's required model/harness attribution, which the template requests when an agent was used. The description does cite Claude Code, so the attribution is partly present. The missing Scope link and the template headings are the main gaps.
Resolution
Consider adding a Problem section and a Scope section that links the issue showing the bug, or explains why no issue is needed. Rename the sections to match the template headings where practical.
Finishing Touches
-
Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info
-
Run configuration
-
Commits
-
Reviewing files that changed from the base of the PR and between f8b3ff0 and 1424821.
Files selected for processing: 14
-
apps/desktop/src/backend/DesktopBackendConfiguration.test.ts
apps/desktop/src/backend/DesktopBackendConfiguration.ts
apps/desktop/src/backend/DesktopBackendManager.test.ts
apps/desktop/src/backend/DesktopBackendManager.ts
apps/server/src/cli/config.ts
apps/server/src/config.ts
apps/server/src/http.test.ts
apps/server/src/http.ts
apps/server/src/server.ts
packages/contracts/src/desktopBootstrap.ts
packages/shared/package.json
packages/shared/src/desktopReadinessProof.test.ts
packages/shared/src/desktopReadinessProof.ts
packages/shared/src/httpReadiness.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
vedprakash2302
added a commit
to vedprakash2302/Cody
that referenced
this pull request
Nov 25, 2026
- Windows work-account sign-in (desktop browser tabs): upstream pingdotgg#42461 grew its
header listener to add navigation client hints. Electron keeps one listener per
session, so Cody moved upstream's listener body into previewRequestHeaders and
runs it inside the sign-in listener; upstream's listener registers only when
sign-in is off. BrowserSession.test.ts now checks persistent sessions keep the
client hints.
- DesktopBackendConfiguration: WSL start config keeps Cody's sign-in helper beside
upstream's launch readiness proof (pingdotgg#41985).
- index.html: Cody splash labels plus upstream's migration progress line (pingdotgg#37209).
- agentContextBudget.json: Cody's Claude and Codex sizes (+371 for final_answer),
upstream's MCP tool list size.
- SideThreadPane: Cody's side chat imports beside upstream's thread find (pingdotgg#28919).
- New macOS camera/microphone prompts (pingdotgg#38146) and the server startup page
(pingdotgg#37209) say Cody.
- BrowserSession.test.ts: drop a duplicate HostProcess import; layerDarwin provides
DesktopClientSettings for Cody's sign-in setting.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
size:L
100-499 changed lines (additions + deletions).
vouch:trusted
Author is trusted by repo permissions or the VOUCHED list.
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|