Skip to content

fix(managed): tolerate an in-flight wake across the primary environment - #83

Merged
logancsack merged 1 commit into
mainfrom
fix/devpc-wake-drop-in-tolerance
Aug 25, 2026
Merged

fix(managed): tolerate an in-flight wake across the primary environment#83
logancsack merged 1 commit into
mainfrom
fix/devpc-wake-drop-in-tolerance

Conversation

@logancsack

Copy link
Copy Markdown
Owner

Problem

#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 15 seconds against a multi-minute wake — so a mid-wake page load surfaced "Something went wrong… fetch-session-state (HTTP 503)" instead of the workbench. Observed live on Aldo staging with the 0.0.31-devpc.16 pin.

What changed

  • New isManagedWorkspaceUnavailable(): the workspace cannot serve its primary environment yet (asleep, or a wake/restart/runtime update in flight). The gateway has already authenticated the browser in every such state.
  • Used wherever sleeping alone gated availability: the server-auth bootstrap bypass, the cached environment-descriptor fallback in connection registration, and the composer's waking-workspace status (which now also shows during in-flight wakes).

Verification

  • apps/web full unit suite: 2088 passed (235 files), including a lifecycle-state matrix test for the new predicate.
  • tsgo typecheck clean; production build succeeds.

🤖 Generated with Claude Code

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.
@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
@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 +13 B (+0.1%) 15.1 KiB
Codex Thread snapshot wire 5.9 KiB 5.9 KiB +2 B (+0.0%) 7.3 KiB
Codex Live turn WebSocket wire 6.0 KiB 6.0 KiB +11 B (+0.2%) 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.8 KiB +6 B (+0.0%) 15.1 KiB
Claude Thread snapshot wire 5.9 KiB 5.9 KiB +3 B (+0.1%) 7.3 KiB
Claude Live turn WebSocket wire 6.0 KiB 6.0 KiB +3 B (+0.0%) 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: 8749dc5 · PR result: c086cc1 · 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 e419630 into main Aug 25, 2026
11 checks passed
logancsack added a commit that referenced this pull request Aug 25, 2026
Wake drop-in tolerance: the primary environment treats every
not-yet-running managed lifecycle state as gateway-authenticated and
cache-served, so a mid-wake page load renders the workbench instead of
a fatal session-state error (#83).

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