Skip to content

Start Environment initialization sooner after a Runtime boots - #812

Merged
SaladDay merged 1 commit into
mainfrom
start-environment-initialization-sooner
Oct 21, 2026
Merged

SaladDay merged 1 commit into
mainfrom
start-environment-initialization-sooner

Conversation

@SaladDay

@SaladDay SaladDay commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Two steps on every hosted cold start, between the VM being created and Environment initialization starting:

  • The Runtime daemon runs its Harness preflights (Claude SDK Node check, codex --version, mcode) concurrently instead of one after another. Output is replayed in declaration order.
  • The Runtime gateway signals when a connection first reports its agent kinds, and the initialization loop scans on that signal instead of waiting for its next 250 ms poll. The poll stays as recovery.

No protocol, store or setting change.

Measurement

mx2 microsandbox node, fresh install of this commit, same workload as the #811 run (hosted regression, then prep_cache.py S1–S5, then S1–S4 again). Seconds from the VM create step finishing to Environment initialization starting, Core clock:

Run n median min max
main d893afb (#811 run) 7 1.31 1.12 1.53
a449ab7 (#809 + #810 run) 7 1.49 1.32 1.57
this PR 7 0.84 0.80 0.91
this PR, second batch 4 0.81 0.72 0.93

About 0.5–0.65 s off every hosted cold start. Hosted regression 9/9 for codex and claude_sdk; every cache case answered correctly.

Tests

  • TestDiscoveryAndRegistration fails when preflights run sequentially and checks output order.
  • TestFirstHeartbeatAnnouncesAgentKinds: only the first declaration of a connection signals.

The Runtime daemon ran its Harness preflights one after another before it
connected, and Core found the connected Runtime only on its next 250 ms
initialization scan. Both sit on every hosted cold start.

The daemon now runs the preflights concurrently and replays their output in
declaration order. The gateway signals the first agent-kind declaration of a
connection, and the initialization loop scans on that signal; the poll stays
as recovery.
@SaladDay
SaladDay merged commit e3c0617 into main Oct 21, 2026
22 checks passed
@SaladDay
SaladDay deleted the start-environment-initialization-sooner branch October 21, 2026 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant