feat(session): support unfocused agent windows (--no-focus) - #87
Merged
Conversation
`bsk session start --no-focus` opens the Agent Window in the background without stealing focus. The flag threads focused=false through CLI -> daemon IPC -> tool.session_start -> chrome.windows.create; an omitted `focused` keeps the extension default (true) so older clients are unaffected. Reworked onto current main so it composes with #52 window sizing: AgentWindowApi.create / SessionManager.start (extension), start_session (CLI) and the daemon's session start now take options objects/structs ({ size, focused }) instead of colliding positional params. Co-authored-by: alectimison-maker <alec.timison@gmail.com>
BB-fat
force-pushed
the
takeover/pr54-no-focus
branch
from
August 12, 2026 11:58
20fa18f to
b713a7b
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.
Supersedes #54, closes #26 — reworked onto current main so it composes with #52 window sizing (options-object instead of colliding positional params). All credit to @alectimison-maker for the original design.
What
bsk session start --no-focusopens the Agent Window in the background without stealing focus from the user's current window.How it differs from #54
PR #54 threaded
focusedthrough the same positional parameter slot that #52 (merged since) now uses for windowsize. This rework switches the extension-side interfaces to options objects so the two features compose:AgentWindowApi.create(url, opts?: { size?: { width, height }; focused?: boolean })—focuseddefaults totrue, preserving today's behavior;chrome.windows.createreceivesfocusedplus the optional size.SessionManager.start(sessionId, opts?: { size?; focused? })— passes the options object straight through.Chain
crates/bsk-protocol):SessionStartParams.focused: Option<bool>withserde(default, skip_serializing_if), so old daemons/extensions interoperate; JSON schema regenerated viadump-schema.crates/bsk-cli):--no-focusflag onbsk session start;start_sessionnow takes aSessionStartOptionsstruct (browser/width/height/focused) instead of growing positional args;record startkeeps the defaults.CliSessionStartParams.focusedpass-through;start_sessiontakes anAgentWindowOptions { size, focused }struct (also fixes a newclippy::too_many_argumentsat 8 args).handleSessionStartvalidates size as before and forwards{ size, focused };chrome.windows.creategetsfocused: opts.focused ?? true.Tests
focusedoptional-by-default +falseround-trip.--no-focusparse test; daemon↔extension IPC round-trip assertsfocused: Some(false)reachestool.session_start.chromeAgentWindowApi.create(default focus /focused: false/ size),SessionManager.startoptions forwarding,handleSessionStartand dispatcherfocused: falseforwarding. Assertions updated from positional args to the options object.Verification
cargo fmt --all,cargo test -p bsk-protocol(115 passed),cargo test -p bsk --lib(226 passed; only the known environment-dependentsync_continues_on_partial_errorfails),cargo test -p bsk --test cli_parse --test sessions_ipc(43 passed),cargo clippy -p bsk-protocol -p bsk --all-targets -- -D warningsclean.pnpm install,wxt prepare,pnpm lint,tsc --noEmitall clean; vitest 567 passed with only the pre-existing React.act.tsxbaseline failures (48, identical on pristinemain— verified via stash).skill/SKILL.mdandcrates/bsk-cli/skill/SKILL.mdupdated and verified byte-identical withcmp.