Skip to content

feat: support Agent Window sizing (session start --width/--height, window resize) - #52

Open
BB-fat wants to merge 1 commit into
mainfrom
feat/window-size
Open

feat: support Agent Window sizing (session start --width/--height, window resize)#52
BB-fat wants to merge 1 commit into
mainfrom
feat/window-size

Conversation

@BB-fat

@BB-fat BB-fat commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

What

  • bsk session start --width <px> --height <px> — open the Agent Window with an explicit outer size (chrome.windows.create). Omitting both keeps the previous browser-default behavior.
  • bsk window resize --session <id> --width <px> --height <px> — resize the session's Agent Window at runtime (chrome.windows.update).

Dimensions are validated on all three layers (CLI / daemon / extension) as integers in 100..=7680 CSS px; width/height must be given together.

How

  • protocol: new tool.window_resize method (classified BrowserMutation in Method::effect()) with WindowResizeParams/WindowResizeResult; optional width/height on tool.session_start params; JSON schemas regenerated via dump-schema.
  • daemon: CliSessionStartParams forwards the optional size; mismatched pairs rejected with invalid_params; tool.window_resize routed through the per-session dispatch queue like other tab/window tools.
  • extension: AgentWindowApi.create(url, size?), SessionManager.start(sessionId, size?), new tools/window.ts handler with injectable WindowResizeApi for tests; chrome API failures surface as protocol_error, bad params as invalid_params.
  • CLI: window_size clap value parser shared by both commands; skill/SKILL.md command reference updated.

Tests

  • Rust: new cli_parse.rs cases (valid size, out-of-range/missing rejection, resize requires both dimensions); protocol round-trip tests; Method classification assertions. cargo clippy --workspace --all-targets clean, cargo test --workspace green (one pre-existing env-dependent failure in skill_install::sync::tests::sync_continues_on_partial_error also fails on unmodified main).
  • Extension: new tools/__tests__/window.test.ts (15 tests: resize happy path, unknown/missing session, missing/out-of-range/non-integer dimensions, chrome failure mapping; session_start size passthrough + validation) and a SessionManager.start size-forwarding test. vitest run green for touched files; biome check clean; ext:build succeeds.

Use case: deterministic viewport sizes for responsive-layout testing and reproducible screenshots.

- `bsk session start --width <px> --height <px>` opens the Agent Window
  with the given outer size (chrome.windows.create)
- new `bsk window resize --session <id> --width <px> --height <px>`
  resizes the Agent Window at runtime (chrome.windows.update)
- both validated on CLI, daemon and extension sides (100..=7680 CSS px)
- protocol: new tool.window_resize method (BrowserMutation) and
  optional width/height on tool.session_start params; schemas regenerated
@BB-fat
BB-fat requested a review from Ljy-0827 July 31, 2026 06:31
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