ChatGPT Pro Async Delegate
Use src/chatgpt-pro-task.ts.
For the full end-to-end architecture and publish-ready flow notes, read:
docs/chatgpt-pro-async-delegate-README.mddocs/chatgpt-login-session-README.md
Default rules
- Prefer visible Chrome (
--channel chrome,--headless 0) for stability. - Default effort is
standard. - Upgrade to
extendedonly when the user explicitly asks for very deep / high-intensity / deeply researched analysis. - Persist every task under
/tmp/codex-chatgpt-pro-tasks/<task_id>/. - Do not wait synchronously for long-running Pro tasks unless the user explicitly wants a blocking check.
- NEVER substitute ChatGPT Pro with Codex GPT-5.4 extra_high reasoning. ChatGPT Pro extended deep research is a different workflow with much longer tool-assisted analysis.
- On slow networks, ChatGPT may take 30-60s to fully load. Wait for Playwright page loading to settle and for the composer UI to become interactive before clicking model / Pro / send buttons.
Auth session prerequisites
- This skill depends on a valid ChatGPT
session.json. - Preferred location:
data/accounts/account-your-email@example.com/session.json
- Obtain it by composing the existing login/session flow:
npm run chatgpt-login:session -- --account data/accounts/account-your-email@example.com --otp-provider mail.com --secrets-file /path/to/temp.env --channel chrome --verbose 1
npm run chatgpt-auth:session -- --account data/accounts/account-your-email@example.com
chatgpt-auth:sessionnow saves to<account-dir>/session.jsonby default.chatgpt-auth:sessionexpects a real logged-in persistent browser profile for that account.- If it cannot extract
sessionToken + user + account, it now fails explicitly instead of writing a fake partial file. - Do not rely on
storage_state.jsonalone for ChatGPT Pro delegation.
Context Supply Requirement
When handing a deep research task to ChatGPT Pro, provide as much context as possible.
Minimum recommendation:
- upload at least 5 files when the task is complex
- prefer a mix of docs, code, configs, screenshots, and data samples
Priority order:
- PRD / requirements docs
- relevant source files or zipped code folders
- screenshots / UI captures
- API responses / sample data / schemas
- architecture docs / notes / diagrams
Example:
npm run chatgpt-pro:submit -- \
--account account-your-email@example.com \
--prompt-file /tmp/prompt.md \
--attach /tmp/context/prd.md \
--attach /tmp/context/src-components.zip \
--attach /tmp/context/screenshot-1.png \
--attach /tmp/context/data-sample.json \
--attach /tmp/context/architecture.md \
--effort extended \
--json
For serious analysis, you should err on the side of over-supplying context rather than under-supplying it.
Submit a task
- Put the full prompt in a markdown/text file, or pass it through stdin.
- Run:
npm run chatgpt-pro:submit -- --account account-your-email@example.com --prompt-file /path/to/prompt.md --source codex --json
Or:
cat /path/to/prompt.md | npm run chatgpt-pro:submit -- --account account-your-email@example.com --source codex --json
Or explicitly choose a session file:
npm run chatgpt-pro:submit -- --session data/accounts/account-your-email@example.com/session.json --prompt-file /path/to/prompt.md --json
- Report back:
- submitted successfully or not
- current status
- effort (
standard/extended) - local task dir
- conversation URL / UUID
- screenshot path
- tell the user to come back with “检查任务状态” / “取回结果”
Check a task
- Latest task:
npm run chatgpt-pro:check -- --task latest --json
- Specific task:
npm run chatgpt-pro:check -- --task <uuid-or-task-id> --json
- Blocking E2E verification for a simple prompt:
npm run chatgpt-pro:check -- --task latest --wait 1 --timeout-ms 120000 --poll-interval-ms 5000 --json
If you need to force a specific account/session at check time:
npm run chatgpt-pro:check -- --task latest --account account-your-email@example.com --json
Report back:
- current status
- last checked time
- local task dir
- result file path if completed
- screenshot path
- failure reason if failed / unknown
Status interpretation
created: local task scaffold created, not yet submittedsubmitted: prompt sent and conversation URL capturedthinking: ChatGPT is still generatingcompleted:response.mdsaved locallyfailed: a hard error happened; inspect metadata and screenshotunknown: the page loaded but the state could not be determined reliably
Local files
Each task dir should contain at least:
metadata.jsonprompt.mdresponse.mdwhen completedevents.logscreenshots/*.png
metadata.json should record:
session_pathaccount_ref/account_dir/account_emailwhen knownchat_urlconversation_uuideffortstatusresult_file
Reporting discipline
- Never claim completion unless
response.mdexists. - When state is uncertain, report
unknown. - Always include the local task dir and a screenshot path in your final reply.