Skip to content

feat: add Deep Research browser automation support#112

Open
xrliAnnie wants to merge 7 commits intosteipete:mainfrom
xrliAnnie:feat/deep-research-plan
Open

feat: add Deep Research browser automation support#112
xrliAnnie wants to merge 7 commits intosteipete:mainfrom
xrliAnnie:feat/deep-research-plan

Conversation

@xrliAnnie
Copy link

Summary

  • Add --deep-research CLI flag for ChatGPT Deep Research browser automation
  • Implement full lifecycle: activate Deep Research pill → submit prompt → wait for auto-confirm → monitor 5-30 min research → extract markdown report
  • Support reattach to interrupted Deep Research sessions via oracle session <slug>
  • Show browser/dr mode label in oracle status for Deep Research sessions
  • Extend zombie timeout and auto-reattach timing for long-running research

Changes

  • Phase 1: Types (BrowserAutomationConfig.deepResearch), config pipeline, --deep-research CLI flag with --engine browser auto-forcing and modelStrategy: "ignore"
  • Phase 2: Core action module (src/browser/actions/deepResearch.ts) — activateDeepResearch, waitForResearchPlanAutoConfirm, waitForDeepResearchCompletion, checkDeepResearchStatus
  • Phase 3: Wire Deep Research into main browser flow (src/browser/index.ts) — conditional activation, skip thinking time, separate response monitoring with early return
  • Phase 4: Reattach support (src/browser/reattach.ts) — detect completed/in-progress research on reconnect, extend zombie timeout, adjust auto-reattach timing
  • Phase 5: 22 unit tests covering all action functions, CLI config, session table labels, reattach flow; manual test checklist in docs/manual-tests.md

Plan Reference

docs/deep-research-plan/ (5 phase plans + overview)

Test Plan

  • All unit tests pass (641/683, 1 pre-existing flaky timeout)
  • Build succeeds (0 TypeScript errors)
  • Lint passes (0 oxlint warnings)
  • 22 new tests for Deep Research functionality
  • Manual browser testing with ChatGPT Plus/Pro account

🤖 Generated with Claude Code

xrliAnnie and others added 7 commits March 7, 2026 19:34
6-phase plan for adding ChatGPT Deep Research support via browser automation:
- Phase 0: Architecture overview, DOM selectors, iframe strategy
- Phase 1: Types, config, and CLI flag plumbing
- Phase 2: Core action module (activate, plan auto-confirm, completion polling)
- Phase 3: Main flow integration in index.ts
- Phase 4: Reattach & session support for long-running research
- Phase 5: Testing strategy (unit, integration, live, manual)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Wire --deep-research flag through the full config pipeline:
CLI → BrowserFlagOptions → buildBrowserConfig → BrowserSessionConfig →
BrowserAutomationConfig → ResolvedBrowserConfig.

Adds DOM selector constants, 40-min default timeout override, and
forces modelStrategy to "ignore" when Deep Research is active.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Create src/browser/actions/deepResearch.ts with three exported functions:
- activateDeepResearch: DOM automation to enable Deep Research mode
- waitForResearchPlanAutoConfirm: wait for ~70s auto-confirm countdown
- waitForDeepResearchCompletion: poll completion over 5-30+ min runs

Reuses existing captureAssistantMarkdown/readAssistantSnapshot for
response extraction.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Wire Deep Research actions into the browser orchestration loop:
- Skip thinking time selection when Deep Research is active
- Activate Deep Research mode via pill before prompt submission
- After submission, wait for research plan auto-confirm (~70s)
- Monitor research completion (5-30min) with timeout error enrichment
- Return early with extracted result, bypassing normal response flow
- Update session timing hint for Deep Research runs
- Add Deep Research re-exports to pageActions.ts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add checkDeepResearchStatus() for quick status check during reattach
- Export extractDeepResearchResult() for reattach result extraction
- Add Deep Research branch to resumeBrowserSession and resumeBrowserSessionViaNewChrome
- Show "browser/dr" mode label in oracle status table for Deep Research sessions
- Extend zombie timeout threshold for Deep Research sessions (40 min minimum)
- Adjust auto-reattach timing: 2 min initial delay, 1 min interval, 5 min per attempt

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add 14 unit tests for activateDeepResearch, waitForResearchPlanAutoConfirm,
  waitForDeepResearchCompletion, and checkDeepResearchStatus
- Add 4 CLI config tests for --deep-research flag behavior
- Add 3 session table tests for browser/dr mode label
- Add Deep Research reattach test (completed status path)
- Add manual test checklist to docs/manual-tests.md

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The attachment UI verification after submitting a message would throw
an error even though the message (with attachments) was already
successfully sent. This caused browser runs with file uploads to fail
unnecessarily when ChatGPT's DOM did not expose the expected attachment
UI on the sent user turn.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant