Repository navigation
Make a hosted agents v2 box ready in seconds on the server - #2201
Closed
niall-sandboxaq wants to merge 6 commits into
Closed
niall-sandboxaq wants to merge 6 commits into
niall-sandboxaq wants to merge 6 commits into
Conversation
Core waited for a controller report that came after the scaler's running, so a box usually sat a full report interval before ready. One helper now marks a box ready when the second signal arrives, in either order, and re-checks that the report is current, from this machine's controller, and not revoked. With v2 off nothing changes. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Records switch.hosted.start_seconds tagged by case and stage only, from one fixed list, with the first click and the box request timed apart. Adds start panels to both dashboards and an alert when first starts are slow. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Core's machine list marks a v2 box it counts as made. When the scaler reports it missing at the current revision, Core asks for it again once per revision through every gate, never for a box set for removal, with a revoked controller, or whose owner may no longer have one. On that re-ask or a Retry, the old box's controllers are revoked and their codes cleared, after an audit entry is committed. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A box retained or wanted deleted, but stopped as turned off, could be switched back to wanted running by a message to one of its agents. The wake path now refuses it. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The `hosted.box_controllers_revoked` audit entry is now written by `box_provision.record_controllers_revoked`, which already writes the other box provision entries in unbound sessions that touch only `server_audit_events`. `cloud_controllers` opens no raw session again, so the tenant exemption allowlist stays as it was. Same order: the entry is committed before any revoke. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A v2 box's controller nearly always reports before the scaler sees the box running, and F1 then makes the box ready on `running`. But the owner's summary counted a workspace's report only if it came after `running_observed_at`, so the workspace still showed `provisioning` until the controller's next report. Each workspace's report now records its revision and controller (v2 boxes only). `workspace_reported` also counts a report made at the machine's current revision, by that workspace's own live, unrevoked controller, for that workspace only: F1's own rule. v1 and v2-off unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Collaborator
Author
|
Closing: this is being folded into a single hosted agents v2 PR, built from current main. A link will be added here once it's up. The branch is kept for history. |
Collaborator
Author
|
Folded into #2216, which brings all of hosted agents v2 into one PR with one commit per area. Closing this one in its favour. |
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.
Stacked on #2042. Core's side of making a hosted agents v2 box ready in seconds, plus a box-missing re-ask and one wake fix. With v2 off nothing changes.
Ready when both signals are in
running, or a report from the box's controller. Before, Core waited for the controller's next periodic report afterrunning, which added about a minute to nearly every start.cloud_controllers.ready_if_both_signals, makes the decision for both paths. On therunningpath it re-checks that the recorded report is at the current revision, from the controller still on this machine for that workspace, and not revoked.Ready on screen at once
running. Since the controller nearly always reports first, a box that was ready still showed as starting until its next report.Start timing
switch.hosted.start_seconds, tagged only with a case (first_start,wake) and a stage, from one fixed list inobservability/hosted.py. The first click and the box request are timed separately.Re-asking for a missing box
box_expected): one with a finished provision since its latest revival.box_missingat the current revision, Core records it and asks for the box again once per revision, through every gate. It never re-asks for a box whose disk is set for removal, whose controller was revoked, or whose owner may no longer have a box. Those go toerror.errorand a Retry recovers it.box_provision.record_controllers_revoked, socloud_controllersopens no unbound session and the tenant exemption allowlist is unchanged.A kept box is never woken
turned_offcould be switched back to wanted running by a message to one of its agents. It no longer can.Not in this PR
totalends at Core's ready. Egress opening, when the box's first model call can get out, isn't timed yet. That needs the box controller to report it.Testing
🤖 Generated with Claude Code