fix: improve iCloud polling and add-phone handoff
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
# iCloud Polling And Add Phone Handoff Drift Adjudication Ledger
|
||||
|
||||
Immutable spec path: `/root/projects/resister-codex/codex-oauth-automation-extension-upstream-base-vu8.0/codex-oauth-automation-extension/.worktrees/fix-icloud-polling-addphone-handoff/docs/superpowers/specs/2026-05-08-icloud-polling-addphone-fix-design.md`
|
||||
|
||||
Immutable plan path: `/root/projects/resister-codex/codex-oauth-automation-extension-upstream-base-vu8.0/codex-oauth-automation-extension/.worktrees/fix-icloud-polling-addphone-handoff/docs/superpowers/plans/2026-05-08-icloud-polling-addphone-fix-plan.md`
|
||||
|
||||
Controller-only mutation rule: only the P9/controller may create, append, supersede, close, summarize, or otherwise mutate this ledger. Subagents may read it, cite `DRIFT_ID`, report evidence, and request supersession, but may not edit it directly.
|
||||
|
||||
## Active Adjudications Summary
|
||||
|
||||
| DRIFT_ID | STATUS | SCOPE | P9_FINAL_ADJUDICATION | EFFECTIVE_EXECUTION_CONTRACT |
|
||||
|---|---|---|---|---|
|
||||
@@ -0,0 +1,85 @@
|
||||
# iCloud Polling And Add Phone Handoff Fix Plan
|
||||
|
||||
## Goal
|
||||
|
||||
Implement the fix described in `docs/superpowers/specs/2026-05-08-icloud-polling-addphone-fix-design.md` on the Ultra8.0 operation-delay branch.
|
||||
|
||||
## Architecture
|
||||
|
||||
- Keep operation-delay excluded from polling.
|
||||
- Adjust iCloud polling in the verification flow and/or iCloud polling payload construction so normal no-code polling uses a larger iCloud-specific attempt/time window.
|
||||
- Reuse the existing shared phone verification flow when Step 7 lands on `/add-phone` and phone verification is enabled.
|
||||
- Preserve fatal behavior when phone verification is disabled.
|
||||
|
||||
## Implementation Granularity
|
||||
|
||||
- Implementer granularity: TaskGroup.
|
||||
- Reviewer granularity: TaskGroup.
|
||||
- One checkpoint commit after both spec and code reviewers approve.
|
||||
|
||||
## TaskGroup 1: iCloud polling and Step 7 add-phone handoff
|
||||
|
||||
### Task 1: Expand iCloud polling window without using operation-delay
|
||||
|
||||
Files likely involved:
|
||||
|
||||
- `background/verification-flow.js`
|
||||
- `content/icloud-mail.js`
|
||||
- `tests/verification-flow-polling.test.js`
|
||||
- `tests/icloud-mail-content.test.js`
|
||||
- Existing operation-delay exclusion tests as regression coverage.
|
||||
|
||||
Required behavior:
|
||||
|
||||
- Add failing tests proving iCloud Step 4 no-code polling is not configured as one attempt under normal conditions.
|
||||
- Add failing tests proving iCloud response timeout is large enough to cover the configured attempt count and interval.
|
||||
- Implement the minimum production change that gives iCloud at least 5 configured polling attempts and a response timeout derived from the iCloud polling window.
|
||||
- Do not wrap iCloud `POLL_EMAIL` handlers with `performOperationWithDelay`.
|
||||
- Keep provider-specific fast-failure for actual transport non-response.
|
||||
|
||||
Suggested verification:
|
||||
|
||||
```bash
|
||||
node --test tests/verification-flow-polling.test.js tests/icloud-mail-content.test.js tests/mail-polling-operation-delay-exclusion.test.js
|
||||
```
|
||||
|
||||
### Task 2: Continue Step 7 direct add-phone through shared phone verification when enabled
|
||||
|
||||
Files likely involved:
|
||||
|
||||
- `content/signup-page.js`
|
||||
- `background/steps/oauth-login.js`
|
||||
- `background.js`
|
||||
- `tests/background-step6-retry-limit.test.js`
|
||||
- `tests/auto-run-step6-restart.test.js`
|
||||
- `tests/step7-phone-login-entry.test.js`
|
||||
- `tests/step8-retry-page-recovery.test.js`
|
||||
- `tests/phone-verification-flow.test.js`
|
||||
|
||||
Required behavior:
|
||||
|
||||
- Add failing tests for Step 7 password submit landing on `/add-phone` with phone verification enabled.
|
||||
- Add or preserve tests for Step 7 password submit landing on `/add-phone` with phone verification disabled.
|
||||
- Add or preserve tests proving phone-login entry pages are not misclassified as add-phone.
|
||||
- Reuse existing shared phone verification helpers; do not implement new phone/SMS submission logic in Step 7.
|
||||
- Keep existing fatal propagation for shared phone verification failures.
|
||||
|
||||
Suggested verification:
|
||||
|
||||
```bash
|
||||
node --test tests/background-step6-retry-limit.test.js tests/auto-run-step6-restart.test.js tests/step7-phone-login-entry.test.js tests/step8-retry-page-recovery.test.js tests/phone-verification-flow.test.js
|
||||
```
|
||||
|
||||
## Final Verification
|
||||
|
||||
Run these before completion:
|
||||
|
||||
```bash
|
||||
node --test tests/verification-flow-polling.test.js tests/icloud-mail-content.test.js tests/mail-polling-operation-delay-exclusion.test.js tests/operation-delay-injection.test.js tests/content-operation-delay.test.js
|
||||
node --test tests/background-step6-retry-limit.test.js tests/auto-run-step6-restart.test.js tests/step7-phone-login-entry.test.js tests/step8-retry-page-recovery.test.js tests/phone-verification-flow.test.js
|
||||
npm test
|
||||
git diff --check
|
||||
git status --short --branch --untracked-files=all
|
||||
```
|
||||
|
||||
If `npm test` creates `scripts/__pycache__/`, remove it before final status.
|
||||
@@ -0,0 +1,60 @@
|
||||
# iCloud Polling And Add Phone Handoff Fix Spec
|
||||
|
||||
## Goal
|
||||
|
||||
Fix two Ultra8.0 runtime failures on top of the migrated operation-delay branch:
|
||||
|
||||
- iCloud verification email polling must wait longer and perform more than one check before declaring the code missing.
|
||||
- Step 7 password login that lands directly on `https://auth.openai.com/add-phone` must continue into the existing phone verification flow when phone verification is enabled, instead of failing immediately.
|
||||
|
||||
## Non-Goals
|
||||
|
||||
- Do not add operation-delay waits to email polling, SMS polling, backend retries, or background timers.
|
||||
- Do not change non-iCloud provider polling cadence unless required by shared test harness setup.
|
||||
- Do not duplicate phone verification logic inside Step 7.
|
||||
- Do not treat ordinary phone-login entry pages as add-phone pages.
|
||||
- Do not continue add-phone when phone verification is disabled or when the existing phone verification flow reports a fatal error.
|
||||
|
||||
## iCloud Polling Behavior
|
||||
|
||||
The current failure log shows Step 4 iCloud polling using fast timeout protection with a 22 second response timeout and a `最多 1 次` polling payload, then failing after roughly 3 seconds. This is too short for the user's active iCloud-only workflow.
|
||||
|
||||
For iCloud verification-code polling:
|
||||
|
||||
- Step 4 signup-code polling and Step 8 login-code polling must not be reduced to a single attempt under normal no-code conditions.
|
||||
- The iCloud polling payload must use an iCloud-specific minimum attempt floor of at least 5 attempts.
|
||||
- The iCloud polling interval must allow delayed mail arrival and may be longer than the current 3 second effective no-code window.
|
||||
- The tab-message response timeout for iCloud polling must be large enough for the configured iCloud polling attempts and intervals to complete, plus a small transport margin.
|
||||
- Transport-unresponsive protection must remain: if the iCloud content script itself does not respond, the flow should fail or recover through the existing transport-error path instead of hanging indefinitely.
|
||||
- Logs must accurately describe the actual iCloud attempt count and wait window.
|
||||
- Operation-delay remains excluded from all email polling paths.
|
||||
|
||||
## Add Phone Handoff Behavior
|
||||
|
||||
When Step 7 password submission transitions directly to an add-phone page:
|
||||
|
||||
- If phone verification is enabled, Step 7 must not throw the current fatal `提交密码后页面直接进入手机号页面,未经过登录验证码页` error.
|
||||
- The flow must hand off to the existing shared phone verification implementation used by later steps.
|
||||
- After successful phone verification, the automation should continue through the existing OAuth/login flow instead of stopping the run.
|
||||
- If phone verification is disabled, the flow must keep a clear fatal error telling the user that add-phone requires phone verification to be enabled.
|
||||
- Existing fatal conditions from the shared phone verification flow remain fatal, including unavailable phone numbers, provider failures, phone already exists, and user stop.
|
||||
- Existing phone-login entry detection must remain separate from add-phone detection.
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
- Reproducing the reported iCloud Step 4 path no longer emits `开始轮询 iCloud 邮箱(最多 1 次)` for normal iCloud no-code polling.
|
||||
- iCloud Step 4 no-code polling performs at least 5 configured attempts before the missing-code failure path.
|
||||
- iCloud polling response timeout is derived from the configured iCloud attempt count and interval rather than being capped to a too-short single-attempt window.
|
||||
- Mail polling operation-delay exclusion tests still pass.
|
||||
- Existing non-iCloud provider tests continue to pass.
|
||||
- Step 7 password-submit to `/add-phone` with phone verification enabled continues into the shared phone verification flow.
|
||||
- Step 7 password-submit to `/add-phone` with phone verification disabled still fails clearly.
|
||||
- Step 7 phone-login entry pages are still treated as login phone input, not add-phone.
|
||||
- Relevant targeted tests and full `npm test` pass.
|
||||
|
||||
## Verification Targets
|
||||
|
||||
- `node --test tests/verification-flow-polling.test.js tests/icloud-mail-content.test.js`
|
||||
- `node --test tests/background-step6-retry-limit.test.js tests/auto-run-step6-restart.test.js tests/step7-phone-login-entry.test.js tests/step8-retry-page-recovery.test.js tests/phone-verification-flow.test.js`
|
||||
- `node --test tests/mail-polling-operation-delay-exclusion.test.js tests/operation-delay-injection.test.js tests/content-operation-delay.test.js`
|
||||
- `npm test`
|
||||
Reference in New Issue
Block a user