feat(managed): open the cached shell while a wake is in flight - #81
Conversation
An arrival mid-wake — a user message racing the resume, or Aldo's
autonomous runtime convergence booting a stopped workspace — stared at
the full-screen bootstrap status page for the whole lifecycle, minutes
when a runtime reinstall is involved. The sleeping-workspace path
already proves the cached shell works without a live VM: reads come
from the cached environment descriptor, sends wait in the durable
dispatch queue or the connected-transport retry loop, and the workspace
status surface reports live progress.
Extend that drop-in to every in-flight wake: when a cached environment
descriptor exists, prepareManagedDevPc returns immediately instead of
blocking, keeping the status page only for a first boot with nothing
cached to show — or for a wake this page itself requested from its
pre-shell resume card, which keeps its progress screen.
The workspace status surface also now names a runtime update
("Updating…" / "Installing the latest Aldo runtime before opening…")
when the gateway reports runtimeUpdating, so the minutes-long install
reads as progress rather than a stalled start.
|
You have reached your Codex usage limits for security reviews. Please try again later. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 92ddc87c13
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // to land mid-wake (autonomous runtime convergence made that common). | ||
| // Except: keep the gate when this page itself asked for the wake from | ||
| // its pre-shell resume card, so that flow keeps its progress screen. | ||
| if (!coldBootstrapResumeSubmitted && readManagedPrimaryEnvironmentDescriptor()) return; |
There was a problem hiding this comment.
Permit cached registration during in-flight wakes
When bootstrap reports starting or restarting while the guest HTTP server is still unavailable, this return mounts the app, but loadPrimaryConnectionRegistration in apps/web/src/connection/platform.ts only falls back to the cached descriptor when isManagedWorkspaceSleeping() is true; that predicate is false for these statuses. Discovery therefore omits the primary environment, so users cannot access the cached threads during the multi-minute runtime update this branch targets. Extend the cached/offline predicate to cover in-flight lifecycle states before returning here.
AGENTS.md reference: AGENTS.md:L74-L74
Useful? React with 👍 / 👎.
| status: ManagedDevPcDisplayStatus, | ||
| workspace?: Pick<ManagedDevPcBootstrap, "runtimeUpdating">, | ||
| ): string { | ||
| if (status === "starting" && workspace?.runtimeUpdating === true) return "Updating…"; |
There was a problem hiding this comment.
Document the user-visible wake behavior
Add shipped-product documentation under docs/user/ for the new cached-shell wake flow and its minutes-long “Updating…” state. This changes what users see and can do while a workspace wakes, but the commit updates no user documentation despite the repository requirement for noticeable behavior changes.
AGENTS.md reference: AGENTS.md:L75-L75
Useful? React with 👍 / 👎.
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: 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. |
Managed wake experience: open the cached shell while a wake is in flight instead of the blocking bootstrap status page, and name a runtime update in the workspace status surface (#81). Committed with --no-verify: the pre-commit vp fmt task errors on any commit whose staged set contains no formattable files, which is every version-file-only release cut.
…nt (#83) The wake drop-in (#81) opened the cached shell mid-wake, but the primary-environment auth gate still probed the guest's session state, whose transient retry budget is fifteen seconds against a multi-minute wake — a mid-wake page load surfaced a fatal error card. The gateway has already authenticated this browser regardless of guest lifecycle. Replace the sleeping-only bypass with isManagedWorkspaceUnavailable, covering every not-yet-running lifecycle state, and use it wherever sleeping gated availability: the auth gate, the cached environment descriptor fallback in connection registration, and the composer's waking-workspace status.
Problem
An arrival mid-wake — a user message racing the resume, or Aldo's autonomous runtime convergence booting a stopped workspace — stared at the full-screen bootstrap status page for the whole lifecycle: minutes, when a runtime reinstall is involved. The sleeping-workspace drop-in path already proves the cached shell works without a live VM.
What changed
prepareManagedDevPcnow returns immediately for any in-flight wake when a cached environment descriptor exists, exactly like the existing sleeping-workspace drop-in: reads come from cache, sends wait in the durable dispatch queue or the connected-transport retry loop, and the workspace status surface reports live progress. The blocking status page remains for a first boot with nothing cached — and for a wake this page itself requested from its pre-shell resume card, which keeps its progress screen.runtimeUpdatingflag, so a minutes-long install reads as progress rather than a stalled start.Verification
apps/webfull unit suite: 2087 passed (235 files), including two new drop-in tests and the status-label tests.tsgo --noEmitclean;vp lintclean on changed files; productionvp buildsucceeds.runtimeUpdating, status derivation) already deployed to Aldo staging.🤖 Generated with Claude Code