Skip to content

fix: improve explicit browser profile selection across CLI and DSH - #298

Merged
iuyo5678 merged 2 commits into
mainfrom
fix/profile-bound-sessions-219
Sep 20, 2026
Merged

iuyo5678 merged 2 commits into
mainfrom
fix/profile-bound-sessions-219

Conversation

@iuyo5678

@iuyo5678 iuyo5678 commented Sep 20, 2026

Copy link
Copy Markdown
Collaborator

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

  • Add Copy profile instructions to the extension popup. It copies both the exact CLI command and the native DSH browser_session call 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.
  • Require a verified profile-to-instance mapping in both the CLI skill and the independent DSH skill, even with only one connected browser. Unknown mappings require user confirmation; unavailable targets require reconnection, without dropping or replacing the selector.
  • Correct the public DSH session-tool description and share its browser-parameter guidance with the internal action schema. Remove the misleading claim that a selector is needed only when multiple browsers are connected. Ordinary tasks without a required profile keep the optional parameter and existing routing behavior.
  • Document how to verify Profile Path through 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 base c6c888e.

  • 29 live checks passed on Windows 11 with Chrome for Testing 153.0.8010.36, two disposable profiles under one User Data root, the built extension/CLI/daemon, and a local page containing different per-profile storage markers. The DSH checks invoke the actual registered tools and real process runner, rather than mock CLI responses.
  • Clicked the popup copy buttons using browser input and the real clipboard API. Checked both copied interfaces carry the same instance ID. The CLI command and DSH call select A and read marker A while B remains connected; selecting B reads marker B.
  • With A disconnected and B connected, explicit A selection returns 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.
  • Verified unique-label selection and duplicate-label rejection (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.
  • Popup/App tests: 34 passed, including the seven profile-copy cases now checking the exact DSH call as well as the CLI command, changed identity, clipboard failure/retry, unavailable targets, and translations.
  • Localization tests: 52 passed. Extension TypeScript compilation, extension production build, and DSH production build passed.
  • Earlier validation of the initial popup implementation: full extension suite 1,873 passed / 103 environment-gated skipped, Rust formatting and 18 browser-selector tests passed. No Rust changes were added in this follow-up.

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.

@iuyo5678 iuyo5678 changed the title fix: bind profile-specific tasks to the selected browser instance fix: improve explicit browser profile selection across CLI and DSH Sep 20, 2026
@iuyo5678
iuyo5678 merged commit 0225683 into main Sep 20, 2026
7 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.

1 participant