Skip to content

SMOODEV-4260: th chrome tab group management - #858

Merged
brentrager merged 2 commits into
mainfrom
SMOODEV-4260-chrome-tab-groups
Nov 5, 2026
Merged

brentrager merged 2 commits into
mainfrom
SMOODEV-4260-chrome-tab-groups

Conversation

@brentrager

Copy link
Copy Markdown
Contributor

Problem

Claude in Chrome leaves stale "Claude" tab groups behind, and th chrome had no way to see or clean them up. Its only group code put agent-opened tabs into the purple "Smooth" group.

Solution

chrome.tabGroups + chrome.tabs see every group in the browser, so the extension now manages them all (needs Agent browsing on, which already grants tabs/tabGroups).

  • th chrome browse groups [--json] lists each group's id, tab count, last used (newest tab.lastAccessed), color, window, state (in use = holds the focused window's active tab; active tab; collapsed) and title.
  • th chrome browse groups close|ungroup [ids…] [--title <exact|glob>] [--idle 30m|2h|1d|1h30m] [--all] [--dry-run] [--json]. Ids and --title add candidates; --all, or --idle alone, takes every group; --idle then keeps only groups unused that long. At least one selector is required.
  • Safety: a group holding the active tab of any window is never touched; with --idle, recently used groups (or ones with no last-used time) are left alone. The output says what was left alone and why, unknown ids, and any group Chrome refused.
  • Extras: groups rename|color|collapse|expand.
  • MCP: browse_groups (action list|close|ungroup, same filters); close/ungroup dry-run unless confirm=true. It's a write tool, so the read-only gate hides it.
  • Selection and safety are a pure SmoothGroups.select in the new extension/groups.js, run inside the extension against the live browser at the moment it acts (groups.apply), so a stale listing can't close a group that just became active. chrome/groups.rs parses selectors/durations and formats output.
  • Extension 0.1.0 → 0.2.0. An older extension gets "run th chrome install, then reload it" instead of "unknown method".
  • Docs: docs/Engineering/Chrome-Extension.md (new Tab groups section, tool count 21 browse_*). mcpb manifest re-blessed. Changeset added.

Verification

  • cargo test -p smooai-smooth-cli: 1510 passed, 0 failed (new tests cover duration parsing, selector validation, clap parsing, request params, update params, table/result formatting, and MCP arg validation).
  • cargo fmt --all -- --check clean. cargo clippy -p smooai-smooth-cli --all-targets: no warnings in the touched code.
  • pnpm test:chrome-page: all pass, including the new scripts/chrome-groups-smoke.mjs (19 checks on selection and safety rules) and new chrome-sw-smoke.mjs checks that drive groups.list/groups.apply/groups.update against a stub chrome (dry run changes nothing, close/ungroup touch only selected groups, failures are reported).
  • oxfmt@0.64.0 --check . clean.
  • Live, read-only: the built th against the user's Chrome (extension still 0.1.0) prints the reinstall hint. No groups or tabs were changed, and the extension was not reloaded.

Jira: https://smooai.atlassian.net/browse/SMOODEV-4260

🤖 Generated with Claude Code

https://claude.ai/code/session_01SJgkv17wVrJrdcDo1mntz4

…ps can be cleaned up

Claude in Chrome leaves "Claude" tab groups behind and nothing in th could see
them. chrome.tabGroups sees every group in the browser, so the extension now
lists them (tab count, last used, whether in use) and closes or ungroups them by
id, title glob, idle time or all, with a dry run.

Selection and the safety rules live in the extension (groups.js, a pure module)
and run against the live browser at the moment it acts, so a group holding any
window's active tab is never touched even if it became active after a listing.
Also rename/color/collapse/expand and a browse_groups MCP tool (dry run unless
confirm=true). Extension bumped to 0.2.0; an older one gets a reinstall hint.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SJgkv17wVrJrdcDo1mntz4
@changeset-bot

changeset-bot Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: f8091c6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@smooai/smooth Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@brentrager
brentrager enabled auto-merge (squash) November 5, 2026 01:58
@brentrager
brentrager merged commit b112dd0 into main Nov 5, 2026
5 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