fix: improve explicit browser profile selection across CLI and DSH - #298
Merged
Merged
Conversation
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.
Refs #219.
When a task requires Chrome profile A but only profile B is connected, an unqualified session start selects B. The existing browser selector can select A correctly once its extension instance is known, but users and agents lacked a consistent way to establish and carry that mapping across the CLI and DeepSeek Harness.
This PR provides a partial mitigation through an explicit profile-selection workflow. It does not fully implement #219's requested profile discovery and enforced task/workspace binding, so the issue should remain open.
Changes
browser_sessioncall for the current instance, with guidance to use the appropriate interface for every new session. DSH users are directed to use the tool instead of starting a separate CLI session. Copying is disabled when disconnected or before the instance ID is available; clipboard failures do not report success. English, Chinese, and Korean are covered.chrome://version, use the same profile's popup ID, and select it through either interface. Explain Windows/macOS behavior and why Chrome process arguments cannot prove which profile owns an extension instance.Scope and remaining limitations
This uses the existing instance-ID/unique-label routing; it adds no browser permissions, filesystem scanning, automatic profile metadata, or persisted required-profile configuration. An explicitly supplied unavailable or ambiguous selector is rejected. A requirement expressed only in conversation is not enforced by the program if the agent omits the selector: with just B connected, an unqualified start can still select B. This remaining case was reproduced in the validation, not treated as fixed.
Instance IDs are routing identifiers, not independent proof of a filesystem path. Users must confirm the initial mapping, and reconfirm it after extension storage resets or profile cloning.
Validation
Final follow-up commit:
88718fd, on the existing PR basec6c888e.not_found. The DSH call sends one selected start, performs no navigation, creates no owned session, and does not retry on B. Reconnecting A restores the same selector.invalid_params) through DSH, with no fallback. Confirmed ordinary unqualified starts still select the sole online browser, including B when A is offline. All validation sessions, browser processes, and the isolated daemon were stopped.pnpm lint: passed, including DSH typecheck and 333 tests. Five added DSH cases cover ID/label forwarding, failure propagation without fallback/navigation, and compatibility of unqualified starts.The earlier additional Windows skill-install check had 34 passing tests and two Hermes path-layout failures (
skills_dirs_match_harness_spec,detects_hermes_from_home_layout), both reproduced on unchanged main. Those unrelated files remain unchanged.macOS shares the implementation and documented workflow; no macOS hardware test is claimed. These checks establish explicit-selector behavior, not that every model will always follow the guidance.