Files
codex-oauth-plus-onboarding…/skill/codex-oauth-plus-onboarding/references/openai-add-phone-strict-country-gate-2026-05-10.md
T

90 lines
2.8 KiB
Markdown

# Strict OpenAI phone country/area-code gate (2026-05-10)
## Trigger
Use this note for any OpenAI `auth.openai.com/add-phone` automation that buys and submits 5sim phone numbers.
## Bug that caused this rule
During a 1085 + Indonesia test, the browser page had silently reverted to the United States selector (`美国 (+1)`) while the agent bought an Indonesia `+62` number. The number was submitted as a US local number, and OpenAI moved to `phone-verification` showing it had sent to a `+1 (...)` number. That attempt was invalid and the 5sim order was canceled.
## Mandatory rule
Never rely on the intended country in the script. Before buying, after filling, and immediately before clicking Continue, verify BOTH:
1. Native select value equals the intended ISO country code.
2. Visible country button text contains the intended country and dialing code.
Examples:
| Country | ISO | Visible text |
| --- | --- | --- |
| Argentina | `AR` | `阿根廷 (+54)` |
| Netherlands | `NL` | `荷兰 (+31)` |
| Indonesia | `ID` | `印度尼西亚 (+62)` |
If either check fails:
- Do not click Continue.
- If a 5sim order was already bought, cancel it immediately.
- Reset the country selector and re-check before retrying.
- Exclude the invalid attempt from country/provider result statistics.
## Reliable country setting
React Aria click/pointer events are unreliable. Use the hidden/native select directly:
```js
const sel = document.querySelector('select');
sel.focus();
sel.value = 'ID'; // AR, NL, ID, etc.
sel.dispatchEvent(new Event('input', { bubbles: true }));
sel.dispatchEvent(new Event('change', { bubbles: true }));
await new Promise(r => setTimeout(r, 800));
```
## Gate function
```js
function visibleCountryText() {
return [...document.querySelectorAll('button')]
.map(b => b.innerText)
.find(t => /\(\+\d+\)/.test(t));
}
function assertCountryGate(iso, visible) {
const selectValue = document.querySelector('select')?.value;
const country = visibleCountryText();
if (selectValue !== iso || country !== visible) {
throw new Error(`country_gate_failed: select=${selectValue} visible=${country}`);
}
}
```
## Correct runner behavior
1. Restore or open `add-phone`.
2. Set country via native select.
3. Run `assertCountryGate()`.
4. Only then buy a 5sim activation.
5. Fill the local part of the phone number.
6. Run `assertCountryGate()` again.
7. Click Continue.
8. Read the result:
- direct rejection (`无法向此电话号码发送验证码` / `电话号码无效`) -> cancel and rotate;
- accepted/waiting -> poll 5sim, click resend once, poll again, then cancel/rotate if still no SMS.
## Replacement limit
For the current configured test, BOSS requested 10 replacements:
```text
PHONE_VERIFICATION_REPLACEMENT_LIMIT=10
```
Keep using configured country order first:
```text
FIVE_SIM_COUNTRY_ORDER=argentina,netherlands,indonesia
```