Skip to content

feat: support opt-in incognito Agent Windows - #467

Merged
iuyo5678 merged 2 commits into
mainfrom
feat/incognito-agent-window
Oct 20, 2026
Merged

iuyo5678 merged 2 commits into
mainfrom
feat/incognito-agent-window

Conversation

@iuyo5678

@iuyo5678 iuyo5678 commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

Sessions currently always use the profile's ordinary website state. Add bsk session start --incognito and the equivalent per-session incognito: true extension parameter so temporary tasks can use Chrome's incognito browsing session. The default remains a normal Agent Window.

The existing window and tab lifecycle handles both modes. Creation checks Allow in incognito before opening a window and verifies the browser returned the requested mode. CLI and daemon compatibility checks require protocol 1.4 for incognito starts, preventing older peers from silently ignoring the option. Ordinary sessions keep their existing compatibility floor.

Incognito sessions cannot borrow tabs, and normal sessions cannot borrow incognito tabs. Stop preserves user-created tabs and protected popups as before. All incognito windows within a profile share site state, which lasts until the last incognito window closes; the docs explain these boundaries.

If a borrowed tab's original window has closed, both explicit tab return and session stop exclude incognito windows from fallback selection and explicitly create a normal window when needed. A focused incognito user window, including one released by a completed task, cannot block return of an ordinary tab.

Validation:

  • cargo test --workspace --locked -- --test-threads=1; final parameter changes also verified with cargo test --workspace --locked incognito.
  • cargo clippy --workspace --all-targets --locked -- -D warnings and Rust formatting checks.
  • pnpm ext:test: 2,673 passed on the initial feature commit. After the fallback correction, all 108 tab-return/session-stop suite tests and the extension type check pass, including original-window reuse, normal/incognito fallback selection, cancellation, and cleanup failures.
  • Extension type check and production build; pnpm lint, including 538 plugin tests.
  • Real Chrome for Testing regression: permission denial, ordinary/incognito isolation, shared incognito state, input/snapshot operations, borrowing rejection, explicit tab close, preservation of user tabs, and clearing site data after the final incognito window closes. Both cases pass. Run from apps/extension with BSK_INCOGNITO_CHROME=/path/to/chrome pnpm exec vitest run src/session-manager/__tests__/incognito.browser.test.ts.
  • Skill package/bundle validation and git diff --check.

Validation limitation: an additional local Page.captureScreenshot probe stalled for both ordinary and incognito windows. Screenshots are therefore not covered by the new browser regression; the screenshot implementation is unchanged.

Refs #466.

@iuyo5678
iuyo5678 merged commit 0717ec8 into main Oct 20, 2026
11 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.

2 participants