Skip to content

fix(qwen-web): open headed browser window on mid-run human-verification challenge #106

Closed

Description

@mdev34-lab

Symptom

When Qwen serves a human-verification challenge mid-run, the provider surfaces:

Qwen is showing a human-verification challenge. Complete it in the browser window, then retry. AlphaCode never solves challenges automatically.

But no browser window is ever opened, so the user has nothing to complete the challenge in. The run is stuck: retrying just hits the challenge again.

Root cause

\packages/webchat/src/adapters/qwen/browser.ts\ launches Chromium headless by default (\QWEN_WEB_HEADLESS=true). The headed flip (\switch to headed mode for interactive login) only fires in the login flow when a display is available and headless was not explicitly requested.

Mid-run challenge paths (\challengeError()\ in \�rrors.ts, \classifyStreamError()\ \waf_challenge\ branch, \waitForLogin()\ challenge wait) never flip to headed. The persistent context was launched headless, and headless cannot be toggled on a live context — it requires close + relaunch.

Expected

On challenge detection mid-run (with a display available and headless not explicitly forced): close the headless context, relaunch headed so the user can solve the CAPTCHA/verification, wait for the challenge to clear, then resume. If headless was explicitly requested or no display is available, keep current behavior but say so in the error (no phantom window promised).

Acceptance

  • Challenge mid-run flips to headed automatically (display available, headless not explicit)
  • Error message no longer promises a window when none will open
  • Unit tests cover the flip decision logic
  • Docs updated (\specs/v2/qwen-web-provider.md\ verification section)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions