Prewarm Cloud machines while typing

Closed
TE
2d ago
+319-15

HOLD: F1 passive wake retry regression requires final native verification and independent review.

An existing Cloud chat with a retained session ID now sends a best-effort wake hint on its first non-empty composer edit, overlapping machine resume with typing. Pending hints are deduplicated; accepted hints retain the two-second dedupe window. A hint refused while the inventory loads or rejected by transport can retry on the next edit. Successful native null replies count as accepted. The native bridge accepts a paused machine from the current signed-in inventory and preserves script origin; it consumes no gesture credit. Unsupported or failed hints leave typing and Send working normally.

This implements the existing-chat portion of the request to prewarm while typing before Send. Fresh drafts and missing-session recovery are tracked in #34828; deduplication across A → B → A chat switches is tracked in #34829. No visual behavior changes. The change is on by default and can be reverted independently.

Performance:

metricbeforeafterdeltaharness or run link
wake hints emitted for the first non-empty edit of an existing Cloud chat01+1cloudTypingPrewarm.test.ts deterministic bridge-port harness

This measures request emission, not machine readiness. First-keystroke-to-agent-ready p50/p95 is measured separately by the Cloud readiness probe; this PR does not claim those results.

Validation: nine focused typing-hint tests, including declined/rejected retry and pending/stale completion handling; native request decoding/passive-gesture tests and script-origin propagation coverage. Exact-head CI and review receipts are linked in the checks and review comments.

šŸ¤– Generated with Codex

Agent session: agent session