cccc icon indicating copy to clipboard operation
cccc copied to clipboard

Browser session open can fail with repeated "oneshot canceled" during Chrome session restore

Open wva2ccyk-prog opened this issue 2 months ago • 1 comments

Summary

Opening the ChatGPT Web browser can fail with:

invalid_request: oneshot canceled: oneshot canceled: oneshot canceled

when Chromium restores multiple persisted tabs and one of the page targets disappears while CCCC is enumerating/reusing pages.

Tested on CCCC v0.4.40, Linux ARM64, Chromium 151, system_browser_cdp.

Reproduction observed

  1. Use the persistent ChatGPT Web Chrome profile.
  2. Let Chrome accumulate/restores entries under: Default/Sessions/
  3. Close/reopen or delete/recreate a Web Model actor/group, then choose Open ChatGPT.
  4. CCCC launches Chromium, but the request eventually returns HTTP 400:
{"error":{"code":"invalid_request","message":"oneshot canceled: oneshot canceled: oneshot canceled"},"ok":false}

The same Chromium binary, same profile, and same ChatGPT URL work when launched directly outside CCCC.

Removing only Default/Sessions also makes CCCC open successfully, which points to transient restored targets rather than a corrupt profile or login state.

Root cause

Startup code enumerates Chromium pages and calls page.url().await?.

During Chrome session restore, a target can disappear between page enumeration and the URL request. Chromiumoxide then returns a canceled oneshot.

CCCC already has is_page_gone() recovery logic in crates/cccc-web/src/browser_surface/page_recovery.rs, but:

  • oneshot canceled is not classified as a recoverable page-gone error.
  • startup reusable_page() propagates page.url() errors instead of skipping vanished targets.
  • similar URL enumeration paths in page recovery/internal-page cleanup can fail the whole operation for the same transient target churn.

Expected

A restored page target disappearing during enumeration should be skipped. It should not fail the entire browser-session open.

Local verification

Using the exact same persisted Default/Sessions files:

Stock v0.4.40

  • browser-session/open -> HTTP 400
  • repeated oneshot canceled
  • failure after ~30-38s

Local recovery patch

  • classify oneshot canceled as a page-gone condition
  • skip page URL failures matching is_page_gone() in startup/recovery cleanup paths

Result:

  • browser-session/open -> HTTP 200
  • active=true
  • ready=true
  • login preserved
  • close -> reopen also succeeds without deleting Sessions
  • cccc-web --lib: 490 passed, 0 failed, 5 ignored

This appears to be a transient-target recovery issue rather than a Chromium/profile corruption issue.

wva2ccyk-prog avatar Sep 19 '26 04:09 wva2ccyk-prog

Thanks for the detailed investigation! The pending patch skips failed candidate pages only when the browser confirms their targets have disappeared. Connection failures still propagate, and saved profiles are preserved. Isolated browser tests pass; your exact ARM64 session-restore scenario still needs confirmation.

ChesterRa avatar Sep 19 '26 08:09 ChesterRa