Repository navigation
perf(desktop): a starting local backend no longer delays connecting to the primary by 10 s - #237
Merged
tusharbhardwaj-bk merged 1 commit intoSep 27, 2026
Conversation
…o the primary by 10 s The platform source builds every registration before handing any to the registry, so the remote primary only connects once each desktop-local backend has described itself. A managed build starts its bundled backend after the window opens, and a backend still starting holds requests until it is ready, so the descriptor fetch waited out its 10 s timeout. Cap it at 1.5 s; a ready loopback backend answers in milliseconds and a slow one is retried on the next 3 s poll. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: unavailable · PR result: Scenario and decoded snapshot size10 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.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
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.
Problem. Reopening the managed desktop app ("StageBKT3Code") sometimes took about 10 s before any message synced. The expbkt3 traces for this app show the same gap on 2 of 3 window opens (08:34:51 → 08:35:02 and 14:13:53 → 14:14:03 on 2026-09-27): the renderer fetched
/api/auth/session,/api/orchestration/usersand/.well-known/t3/environmentstraight away, then waited ~10.5 s before it requested a WebSocket ticket.Cause.
buildPlatformRegistrationsbuilds every registration before returning any. After the primary it walks the desktop-local backends one by one. A managed build registers its bundled backend and starts it after the window opens. While that backend is starting, its readiness middleware holds every request, so the descriptor fetch waited out its default 10 s timeout. The primary was installed, and the supervisor allowed to connect, only after that. The loopback requests never reach the remote server, which is why its traces show an empty gap.Fix. Pass a 1.5 s
timeoutMsto the desktop-local descriptor fetch (desktopLocalDiscovery.expbkt3.ts, one marked seam inplatform.ts). A ready loopback backend answers in milliseconds. One still starting is skipped for this poll and retried on the next, 3 s later. The bearer bootstrap is untouched: it runs only once the descriptor has answered, and by then the backend is ready.Verification.
/.well-known/t3/environmentand/api/auth/websocket-ticketin the expbkt3 traces should be under 2 s.🤖 Generated with Claude Code