fix(alert): derive the request envelope from an alert wait window

Merged
TH
4h ago
+224-15

Summary

alert wait previously used the fixed 90-second request envelope, so longer accepted windows could time out early. Its policy derives the envelope from the window plus the existing margin. get, accept and dismiss keep their existing budgets.

Windows above 2147453647 ms are refused with INVALID_ARGS, details.reason: alert-wait-window-too-long and details.maxWaitWindowMs, rather than shortened.

agent-device alert wait 120000       # 150-second request envelope
agent-device alert get 120000        # existing get policy
agent-device alert wait 2147453648   # refused

Closes #4566. Nine files change; no new flags or native interaction changes. Scope covers timeout admission, regression coverage and help/docs, including Apple-only get budgets and capped first/remaining wait reads.

Validation

  • Base 189570486a11ae3e637abdd55fcaff2cebb26362; head 4a808cd54215c1b9eb72ec9e6b511bd0aac23f89.
  • Initial same-command regression evidence at e9ad4fac9f: four failures against base production files, 25 tests passed with the fix. The 120000 ms wait reproduced 90000 !== 150000 before the fix.
  • Review follow-up: three focused suites passed all 57 tests, including Apple polling and typed refusal details. All 903 eager-closure checks passed.
  • Exact-head affected gate: all 11 runnable checks passed; seven hosted/parked lanes skipped. Receipt .tmp/validation/run-LiklFS/receipt.json: exactCommit=true, checkoutChanged=false, no fail-open reasons.
  • No device run; native polling/interaction unchanged. Hosted checks/reviews remain CI obligations. The numeric ceiling is source/test verified, not a multi-day live wait.
  • Cold full-diff review completed; no independent reviewer before publication.

Co-authored-by: Apex noreply@callstack.ai


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.