Skip to content

fix(runtime): avoid empty session snapshots when the bridge is unavailable - #879

Merged
Panniantong merged 2 commits into
Panniantong:mainfrom
remote-controlled-man:codex/prflow-d648d68b1b38
Nov 1, 2026
Merged

Panniantong merged 2 commits into
Panniantong:mainfrom
remote-controlled-man:codex/prflow-d648d68b1b38

Conversation

@remote-controlled-man

Copy link
Copy Markdown
Contributor

Fixes #867.

OpenCLI site-cookie export returned an empty list when the Browser Bridge was unavailable. Session discovery could then record a successful copied_cookies: 0 snapshot, making a missing Bridge indistinguishable from a site with no saved cookies.

Add one shared running/compatible Bridge check to direct site-cookie export and before a browser-backed discovery result is recorded. An unavailable Bridge raises NEED_SETUP with agent-reach browser setup recovery. Cached imported snapshots, optional native-CLI discovery, and protection of incompatible existing daemons retain their behavior.

Validation:

  • Regression tests reproduced the silent empty-session and direct-export results before their fixes.
  • Session onboarding, Reddit, and release-policy tests: 50 passed.
  • Full pytest: 480 passed (Python 3.12, macOS).
  • Ruff: passed.
  • mypy: passed (49 source files).

The tests isolate Bridge availability and site calls. No live browser session or credentials were used; platform CI remains pending.

Copilot AI balanced review requested due to automatic review settings October 30, 2026 08:04

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@Panniantong
Panniantong merged commit cbd02f5 into Panniantong:main Nov 1, 2026
10 checks passed
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.

Session reuse silently copies 0 cookies when the Browser Bridge daemon is asleep, surfacing as "OpenCLI finished but returned no notes"

3 participants