Use when a user asks Codex to run a JD.com product monitoring, availability check, cart, or checkout task in a visible browser with a product URL, quantity, purchase strategy, local CDP browser, or aligned polling interval. Do not use for CAPTCHA solving, risk-control bypass, bot evasion, stealth automation, internal API automation, or payment verification.
Operate JD.com purchase tasks as a visible-browser harness. Codex performs each check and browser action itself under the protocol; do not generate a long-running automation program, cron job, daemon, or request-level bot.
Read these before acting:
references/task-schema.md for task parsing and validation.references/harness-protocol.md for allowed states, transitions, page signals, and evidence rules.references/examples.md when the user request is ambiguous or you need parsing examples.references/harness-protocol.md.Status Format.dry_run unless the user explicitly requests submit_order.submit_order, click final submit at most once, then stop.Refuse only the unsafe part when possible. Offer a compliant alternative such as notify_only, dry_run, screenshots, HTML snapshots, slower aligned checks, or pausing for manual intervention.
Reject requests to:
Build an in-memory task object before opening the browser:
product_url: JD product detail URL.quantity: purchase quantity, default 1.purchase_strategy: notify_only, dry_run, or submit_order; default dry_run.poll_aligned_minutes: default 5.max_attempts: default 0, meaning no fixed cap while the session remains active.browser.mode: cdp or visible; prefer cdp only when a local endpoint is available.If any required or safety-relevant field is ambiguous, show the interpreted task object and ask for confirmation before continuing.
For CDP mode, ask the user to start Chrome when no endpoint is available:
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome \
--remote-debugging-port=9222 \
--user-data-dir=/tmp/jdbuy-chrome-profile
Connect to http://127.0.0.1:9222 with the available browser-control tool. If connection fails, stop and ask the user to restart Chrome with the command above.
Run exactly this high-level loop:
purchase_strategy.dry_run, stop before final order submission.submit_order, click submit order once, then stop for manual payment.At every state transition, report one short block:
state: <STATE>
page: <current URL or page label>
signal: <visible button/text/challenge/checkout marker>
next: <next action or next scheduled check time>
Stop immediately when:
STOPPEDWhen stopped, summarize the last state, last observed signal, and what user action is needed next.