Skip to content

feat(managed): open the cached shell while a wake is in flight - #81

Merged
logancsack merged 1 commit into
mainfrom
feature/devpc-drop-into-ui
Aug 25, 2026
Merged

feat(managed): open the cached shell while a wake is in flight#81
logancsack merged 1 commit into
mainfrom
feature/devpc-drop-into-ui

Conversation

@logancsack

Copy link
Copy Markdown
Owner

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

  • prepareManagedDevPc now 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.
  • The workspace status surface names a runtime update ("Updating…" / "Installing the latest Aldo runtime before opening…") when the gateway reports the new additive runtimeUpdating flag, so a minutes-long install reads as progress rather than a stalled start.

Verification

  • apps/web full unit suite: 2087 passed (235 files), including two new drop-in tests and the status-label tests.
  • tsgo --noEmit clean; vp lint clean on changed files; production vp build succeeds.
  • Gateway counterpart (runtimeUpdating, status derivation) already deployed to Aldo staging.

🤖 Generated with Claude Code

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.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:M labels Aug 25, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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…";

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

@github-actions

Copy link
Copy Markdown

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 11.8 KiB 11.8 KiB −17 B (−0.1%) 15.1 KiB
Codex Thread snapshot wire 5.9 KiB 5.9 KiB −1 B (−0.0%) 7.3 KiB
Codex Live turn WebSocket wire 6.0 KiB 6.0 KiB −16 B (−0.3%) 7.8 KiB
Codex Live turn WebSocket decoded 50.6 KiB 50.6 KiB 0 B (0.0%) 66.4 KiB
Codex Live turn messages 16 16 0 (0.0%) 21
Claude Total thread wire 11.8 KiB 11.9 KiB +10 B (+0.1%) 15.1 KiB
Claude Thread snapshot wire 5.9 KiB 5.9 KiB +5 B (+0.1%) 7.3 KiB
Claude Live turn WebSocket wire 6.0 KiB 6.0 KiB +5 B (+0.1%) 7.8 KiB
Claude Live turn WebSocket decoded 51.4 KiB 51.4 KiB 0 B (0.0%) 66.4 KiB
Claude Live turn messages 16 16 0 (0.0%) 21

Baseline: edbfea0 · PR result: 92ddc87 · Source CI: success

Scenario and decoded snapshot size

10 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.

  • Codex decoded thread snapshot: 96.9 KiB
  • Claude decoded thread snapshot: 97.6 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

@logancsack
logancsack merged commit 7c962a7 into main Aug 25, 2026
12 checks passed
logancsack added a commit that referenced this pull request Aug 25, 2026
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.
logancsack added a commit that referenced this pull request Aug 25, 2026
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant