fix(browser): thread the preferred profile through readiness and status checks - #2262
Open
Benjamin-eecs wants to merge 1 commit into
Open
fix(browser): thread the preferred profile through readiness and status checks#2262Benjamin-eecs wants to merge 1 commit into
Benjamin-eecs wants to merge 1 commit into
Conversation
Benjamin-eecs
marked this pull request as ready for review
August 6, 2026 15:19
Benjamin-eecs
force-pushed
the
fix/status-preferred-profile
branch
from
August 7, 2026 03:55
d9b952d to
4102e87
Compare
Benjamin-eecs
force-pushed
the
fix/status-preferred-profile
branch
from
August 8, 2026 11:01
4102e87 to
08d186f
Compare
…us checks The /status path dropped preferredContextId, so a configured default read as multi-profile ambiguity (jackwener#2259).
Benjamin-eecs
force-pushed
the
fix/status-preferred-profile
branch
from
August 8, 2026 13:02
08d186f to
8e9d907
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
With two or more profiles connected and a default set via
opencli profile use, every command relying on the readiness pre-check failed withMultiple Browser Bridge profiles are connected, anddoctorreported FAIL claiming no default was selected (#2259). The readiness path droppedpreferredContextIdbefore it reached the daemon:/statusonly ever receivedcontextId, so the daemon-side arbitration/commandalready exercises never ran for health checks.The preferred id now rides the same params as the explicit one through the readiness path into the
/statushandler, which passes it toresolveExtensionConnectionexactly as/commanddoes.doctorthreads the resolved selection too, so an explicitOPENCLI_PROFILEis likewise diagnosed as the profile it names. Arbitration semantics are unchanged (#2073): a stale default still falls back or fails fast rather than pinning readiness.The diagnosis and the fix plan are @lyc10031's, laid out in the issue; this implements them with tests.
Related issue: Closes #2259
Type of Change
Checklist
Documentation (if adding/modifying an adapter)
docs/adapters/(if new adapter)docs/adapters/index.mdtable (if new adapter)docs/.vitepress/config.mts(if new adapter)README.md/README.zh-CN.mdwhen command discoverability changedCliErrorsubclasses instead of rawErrorScreenshots / Output
Live, two profiles connected (the real Chrome profile
fvqtde6bplus a second synthetic extension connection), default set tofvqtde6b. Before, on v1.8.6:After, same setup on this branch:
The daemon-level flip on the same run:
/statuswith no params keepsprofileRequired: true;?preferredContextId=fvqtde6breturnsprofileRequired: falsewithcontextId: fvqtde6b; a stale preferred with two live profiles staystrue, keeping the #2073 fallback semantics.Every touched source file is individually pinned: reverting any one of the seven alone fails at least one named test, with the daemon-side
/statusforwarding pinned end-to-end by a real-daemon e2e case intests/e2e/daemon-transport.test.ts. The six touched suites pass 106 / 106 (npx vitest runover src/browser.test.ts, bridge-readiness, daemon-client, doctor, daemon, and tests/e2e/daemon-transport); typecheck, both lint gates and doc coverage pass;cli-manifest.jsonunchanged.