Skip to content

fix(browser): fail closed on Cloudflare challenges and stale pairing controls - #28

Open
AKzar1el wants to merge 2 commits into
devnoname120:mainfrom
AKzar1el:contrib/browser-recovery-safety-20261117
Open

AKzar1el wants to merge 2 commits into
devnoname120:mainfrom
AKzar1el:contrib/browser-recovery-safety-20261117

Conversation

@AKzar1el

Copy link
Copy Markdown
Contributor

Summary

  • Recognize ChatGPT's documented cf-mitigated: challenge response header on ChatGPT document navigation, without treating ordinary 403/429 responses or unrelated sites as challenges. If the transport cannot read the header, preserve the existing status and retry-after handling.
  • On a verified pre-Send model-picker TimeoutError, reacquire the current composer/control at most once, only while the conversation URL remains unchanged. Never retry on abort, semantic errors, different conversations, or after submitting a message.
  • Add isolated Node regression tests covering challenged vs ordinary responses, failed header reads, stale controls, page changes, and bounded retries.

Scope / compatibility

  • Based on upstream main at v2.4.0; these are two focused commits.
  • Preserves upstream browser-pool, session, model selection, per-action concurrency, and Send-gate behavior.
  • No new browser processes, profile changes, goal admission expansion, automation defaults, or update scripts.

Verification (Windows)

  • node node_modules/typescript/bin/tsc --noEmit --project tsconfig.json — pass
  • bun test tests/navigation.test.ts tests/pairing-submit.test.ts tests/browser-window.test.ts — 112 pass, 101 conditional skips, 0 fail
  • node --test tests/challenge-navigation.node.cjs tests/pairing-retry.node.cjs — 6 pass, 0 fail
  • git diff --check — pass

These tests do not claim a complete model-generated answer; challenge detection and picker reacquisition happen before Send.

This branch has not been deployed

No deployments
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