Repository navigation
Cloud start: read a new machine's state 1 s apart and stop waiting as soon as it runs - #35023
Conversation
…s soon as it runs A new machine's wait slept 3 s before every read, the first one included, so a start lost up to 3 s after the machine already ran. Now the first 20 reads are 1 s apart (then 3 s, about 3 min in all), and a pause ends as soon as any other read shows the machine running, with no extra list read. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-2281e166aee16df17217
|
cmux status (one comment, edited in place; each line is updated by the job that owns it) Review App of this head (app.zip, kept 1 day)
Shipped in:
|
teamleaderleo
left a comment
There was a problem hiding this comment.
Review (claude-opus-5-5): SHIP at d26c8e7
Review (subagent claude-opus-5-5 medium): SHIP at d26c8e7
Checked Swift 6 isolation (the condition closure captures session like CloudHandlers.swift:363), that machine.status only becomes .running from a server record applied through listed/applyRecord (so skipping the forced read loses nothing), cancellation (CloudWait.holds returns, checkCancellation throws, untilRunning returns), the wakeup-allow lint (the only direct sleep is gone), and the new test case (old code reads once, new code zero times). check-concurrency.sh passes.
Follow-ups: [follow-up] the longest wait is about 200 s, up from 180 s, with up to 20 reads in the first 20 s of a new machine (not blocking).
|
Found 6 test failures on Blacksmith runners: Failures
|
![Fix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/fix-with-codesmith-light-3x.png)
Leo-ask: ask-e09ceb4656
Leo, 2026-11-04: "why is it taking so long to start a chat "in cloud"?"
Why it takes long
Every first send from a Mac workspace that has no Cloud machine yet makes a new machine (one workspace per small Cloud machine, #30020), so the wait is mostly that machine starting. On top of that, the client wasted time:
CloudMove.connectedslept 3 s before every read, the first included, then did a full list read. A machine that came up just after a read was seen up to 3 s late.This change
Expected saving: about 1–3 s per first send that makes a machine (average lag after the machine runs goes from ~1.5 s + the 3 s first sleep to ~0.5 s). Not measured on a real start yet; the larger fixes for this ask are the prewarm PRs already open (#34974 prewarm while typing, #34487 warm on composer select), which start the machine before Send.
Risk: low. One wait loop's pacing; a provisioning machine now costs up to 20 extra list reads in its first 20 s.
Test:
CloudMachineChangeStateTests.aStartWaitsForANewMachineToRungains a case: a machine seen running during a pause is not read again.Agent session: agent session
🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.Summary by cubic
Speeds up the first send from a Mac workspace that provisions a new Cloud machine. Previously
CloudMoveslept 3 s before every state read (the first included), so a machine that came up just after a read was seen up to 3 s late.Written for commit d26c8e7. Summary will update on new commits.