Skip to content

Headless: Logout link click dispatches but does not navigate (reproducible on the-internet.herokuapp.com/secure) #7

@SparshKesari

Description

@SparshKesari

Environment

  • kane-cli version: 0.2.4
  • OS: macOS (Apple Silicon, Darwin 25.2.0)
  • Install method: npm (@testmuai/kane-cli global)

What happened

Running a simple login → logout objective with --headless causes the agent to get stuck (reason_code: stuck.dag_cycle). Playwright reports locator.click() as successful on the Logout <a> element every time, but the browser never navigates from /secure to /logout/login. The identical objective passes cleanly on the same machine without --headless in ~93s.

Steps to reproduce

kane-cli run "Type 'tomsmith' in the Username field, type 'SuperSecretPassword!' in the Password field, click the Login button, wait for the secure area page to load, click the Logout button, store the flash message text as 'logout_flash', store the current URL as 'final_url', assert the URL contains '/login', assert the flash message contains 'You logged out'" --agent --headless --timeout 120 --url https://the-internet.herokuapp.com/login

Expected behavior

After clicking the Logout link on /secure, the browser navigates to /login with flash message "You logged out of the secure area!".

Actual behavior

  • Login and navigation to /secure succeed.
  • Playwright reports every Logout click as success: true via locator internal:role=link[name=\"Logout\"i].
  • URL never changes. page_observer confirms page is complete and Logout button is visible.
  • focus_info on every click action is null.
  • At step 9 the agent self-diagnoses and invokes its own report_bug tool: "Logout link click does not navigate away from /secure… Action feedback indicates no element focused, suggesting the click may be missing or the link is not responding."
  • Agent retries 6+ times via DOM locator, vision coordinates, and page.reload() — none recover — until the DAG cycle detector forces stuck.
  • Run ends: result_code: 320, reason_code: stuck.dag_cycle, duration 216.9s.

Comparison — headed mode works

Identical objective without --headless:

  • Duration: 92.9s
  • result_code: 100, reason_code: success.complete
  • Single Logout click → navigates to /login → flash "You logged out of the secure area!" extracted → assertions pass.

Flat DOM at stuck-point (step 9 — Logout link is correctly resolved)

{ "role": "link", "name": "Logout",
  "locator": "role=link[name='Logout']",
  "url": "https://the-internet.herokuapp.com/logout",
  "is_enabled": true,
  "bounding_box": { "x": 475, "y": 207, "width": 104, "height": 46 } }

Hypothesis

Headless Chromium is not processing the <a> element's default navigation after Playwright's synthetic click resolves. Possible causes:

  1. Click-vs-navigation race — click returns before Chromium schedules the navigation.
  2. Missing user-activation gesture gate in headless for anchor navigation.
  3. Session cookie handling diverging between headed and headless.

Reliably reproducible on this machine across multiple runs.

Logs / artifacts (local)

Happy to upload the session tarball if useful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    agentTo identify the issues created by agentsbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions