Skip to content

feat(connectors): chrome connector — tool dispatcher v1#872

Merged
buremba merged 5 commits into
mainfrom
feat/chrome-tool-dispatcher
May 18, 2026
Merged

feat(connectors): chrome connector — tool dispatcher v1#872
buremba merged 5 commits into
mainfrom
feat/chrome-tool-dispatcher

Conversation

@buremba
Copy link
Copy Markdown
Member

@buremba buremba commented May 18, 2026

Summary

Replace four standalone connectors (chrome.tabs, browser.evaluate,
browser.page_text, browser.fill_form) with a single chrome
connector exposing:

  • feeds.open_tabs — auto-wired tab snapshot. Unchanged semantics.
  • actions.{navigate, get_accessibility_tree, click_ref, type_ref, wait_for_selector, screenshot, evaluate} — a fixed enumeration of
    typed browser tools. The extension dispatches each via
    chrome.debugger; new connectors compose on these without shipping
    per-connector code into the extension.

The cloud-side ConnectorDefinition is pure metadata; sync() /
execute() throw — actual work runs in
apps/chrome/tools.js
in the extension.

Why this shape

This is the architecture Claude in Chrome ships with — reverse-engineered
from the actual extension bundle. Fixed tool surface, custom
accessibility-tree content script with sensitive-field redaction, no
interpreter for gateway-supplied code. It's the Web-Store-friendly
pattern.

Codex review of the proposal narrowed v1 to exactly this surface:
set_file_input, get_cookies, key/scroll/hover variants land in
follow-up PRs as real connectors demand them. v1 validates the
architecture, not its full coverage.

Deletes

  • packages/connectors/src/chrome_tabs.ts
  • packages/connectors/src/browser/{evaluate,fill_form,page_text}.ts

What's NOT in this PR

  • No DB migration. The four prior connector_keys (chrome.tabs,
    browser.*) were never deployed to production users — they exist
    only in self-hosted dev installs. Self-hosters reload + repair their
    connection.
  • No ctx.chrome.* SDK helper. Server-side connectors that want to
    invoke these actions today must insert runs rows directly. The SDK
    helper lands in PR 2 with the parent-run linking primitive.

Pairs with

Test plan

  • make build-packages passes (already verified).
  • Extension reload picks up version: 0.4.0.
  • chrome.open_tabs feed run snapshots the user's tabs.
  • chrome.navigate action emits the {tab_id, current_url, title}
    envelope.
  • chrome.get_accessibility_tree returns a tree with ref_ids on
    example.com.
  • chrome.click_ref against one of those refs dispatches the click.

Summary by CodeRabbit

  • Refactor
    • Consolidated browser automation into a single Chrome connector and removed legacy per-feature browser connectors.
  • New Features
    • Added a unified Chrome connector with one-shot browser actions and opt-in Chrome Bookmarks, Downloads, and History feeds.
    • Expanded browser capability set to include downloads.
  • Bug Fixes
    • Worker action completion now enforces ownership/claim checks before updating runs.

Review Change Stack

Replace four standalone connectors (chrome.tabs / browser.evaluate /
browser.page_text / browser.fill_form) with a single `chrome` connector
exposing:

  feeds.open_tabs
    Auto-wired tab snapshot. Unchanged semantics.

  actions.{ navigate, get_accessibility_tree, click_ref, type_ref,
            wait_for_selector, screenshot, evaluate }
    A fixed enumeration of typed browser tools. The extension dispatches
    each via chrome.debugger; new connectors compose on these without
    shipping per-connector code into the extension. The set is modeled
    on Claude in Chrome's tool surface (reverse-engineered from the
    shipping extension) — same principle: narrow, auditable, no
    interpreter for gateway-supplied code.

The cloud-side ConnectorDefinition is pure metadata; sync() / execute()
throw — actual work runs in apps/chrome/tools.js in the extension.

Deletes:
  packages/connectors/src/chrome_tabs.ts
  packages/connectors/src/browser/{evaluate,fill_form,page_text}.ts

The matching extension-side dispatch lives in lobu-ai/owletto PR #TBD
(Owletto for Chrome 0.4.0). No DB migration in this PR — the prior
shape was never deployed to production users.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 18, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: e5ba44a8-2ef5-4c1e-98f1-dfc52f6381aa

📥 Commits

Reviewing files that changed from the base of the PR and between 0f61b29 and 0814c7d.

📒 Files selected for processing (1)
  • packages/core/src/capabilities.ts

📝 Walkthrough

Walkthrough

Consolidates multiple browser/Chrome connector stubs into a single ChromeConnector, adds chrome history/bookmarks/downloads connectors and barrel exports, and adds an ownership authorization guard to completeActionRun in the server worker API.

Changes

Chrome Connector Consolidation

Layer / File(s) Summary
Chrome connector overview and docs
packages/connectors/src/chrome.ts
Adds Chrome-only documentation describing execution semantics, ref-based accessibility interactions, allowlisting, and worker delegation.
Input schemas
packages/connectors/src/chrome.ts
Introduces BRIDGE_ONLY constant and JSON-schema constants for tabId and accessibility refId used by actions.
Connector definition and typed metadata
packages/connectors/src/chrome.ts
Defines ChromeConnector.definition with connector identity, browser.debugger capability, feeds.open_tabs (tab_snapshot) and typed actions (navigate, get_accessibility_tree, click_ref, type_ref, wait_for_selector, screenshot, evaluate, close_tab).
Runtime bridge stubs
packages/connectors/src/chrome.ts
Implements sync() and execute() as bridge-only stubs that throw BRIDGE_ONLY.
Chrome history connector
packages/connectors/src/chrome_history.ts
Adds ChromeHistoryConnector with visits feed emitting page_visit events and bridge-only runtime.
Chrome bookmarks connector
packages/connectors/src/chrome_bookmarks.ts
Adds ChromeBookmarksConnector with bookmarks feed emitting bookmark events and bridge-only runtime.
Chrome downloads connector
packages/connectors/src/chrome_downloads.ts
Adds ChromeDownloadsConnector with downloads feed emitting download events and bridge-only runtime.
Connector exports update
packages/connectors/src/index.ts
Replaces legacy browser/* and chrome_tabs exports with chrome.ts, adds opt-in chrome_history.ts, chrome_bookmarks.ts, chrome_downloads.ts, and reorders capterra.ts.

Worker API Authorization

Layer / File(s) Summary
completeActionRun authorization guard
packages/server/src/worker-api.ts, packages/server/src/index.ts
Adds authorizeRunForWorker call at start of completeActionRun and returns early on rejection; allowlists /api/workers/complete-action for user-scoped workers.

Possibly related PRs

  • lobu-ai/lobu#828: The main PR removes the previously added browser.evaluate, browser.fill_form, and browser/page_text bridge connectors (and their exports) that were introduced in the retrieved PR, replacing them with the new unified chrome.ts connector.
  • lobu-ai/lobu#773: The main PR’s connector refactor (removing the old chrome_tabs connector and shifting Chrome connector exports) and its server/core capability wiring overlap with the retrieved PR’s MV3 Chrome work.

Suggested labels

skip-size-check

Suggested reviewers

  • codex-approver

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐰 I hopped through code with tiny cheer,
One Chrome connector now appears.
Feeds and stubs in tidy rows,
A guard ensures the run it knows.
Hop, test, and ship—carrots near!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: replacing four standalone connectors with a single unified chrome connector that acts as a tool dispatcher.
Description check ✅ Passed The description includes all required sections: Summary (explaining the consolidation), Test plan (with detailed checklist), and Notes (context, rationale, pairing info, and scope clarifications).
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/chrome-tool-dispatcher

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov-commenter
Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/connectors/src/chrome.ts`:
- Line 301: The method signature async sync(_ctx: SyncContext):
Promise<SyncResult> should remove the unused parameter instead of
underscore-prefixing it; update the function declaration in the Chrome connector
(the sync method) to async sync(): Promise<SyncResult>, remove any unused local
reference to _ctx, and ensure call sites (if any) that invoke sync still work
with the no-argument signature.
- Line 98: The runtime platforms type is being double-cast to hide the fact that
'chrome-extension' isn’t allowed by the SDK type; update the platform union to
include 'chrome-extension' instead of using "as unknown as ['macos']". Change
the ConnectorDefinition (or the platforms type) in
packages/server/src/utils/connector-compiler.ts to allow 'chrome-extension'
alongside 'ios'|'android'|'macos'|'windows'|'linux', remove the workaround cast
in packages/connectors/src/chrome.ts (the runtime: { platforms: [...] } entry),
and ensure any related SDK types referenced in packages/server/src/worker-api.ts
are consistent with the new union.

In `@packages/connectors/src/index.ts`:
- Line 14: The barrel export uses "export * from './chrome.ts'" which omits the
default export ChromeConnector; fix by re-exporting the default explicitly—add
an explicit named re-export like "export { default as ChromeConnector } from
'./chrome.ts'" (or change chrome.ts to export const ChromeConnector as a named
export and keep the barrel), then rebuild with make build-packages so consumers
can import ChromeConnector from the package.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: d272167b-1efd-4d47-8a55-e99ae2673c69

📥 Commits

Reviewing files that changed from the base of the PR and between d4691a7 and 56b20b0.

📒 Files selected for processing (6)
  • packages/connectors/src/browser/evaluate.ts
  • packages/connectors/src/browser/fill_form.ts
  • packages/connectors/src/browser/page_text.ts
  • packages/connectors/src/chrome.ts
  • packages/connectors/src/chrome_tabs.ts
  • packages/connectors/src/index.ts
💤 Files with no reviewable changes (4)
  • packages/connectors/src/chrome_tabs.ts
  • packages/connectors/src/browser/fill_form.ts
  • packages/connectors/src/browser/page_text.ts
  • packages/connectors/src/browser/evaluate.ts

version: '0.2.0',
faviconDomain: 'google.com',
requiredCapability: 'browser.debugger',
runtime: { platforms: ['chrome-extension'] as unknown as ['macos'] },
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | 🏗️ Heavy lift

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# 1) Inspect the connector definition typing and platform declarations in repo
rg -n --type=ts -C3 "type ConnectorDefinition|interface ConnectorDefinition|platforms" packages

# 2) Locate all platform literals used by connectors
rg -n --type=ts -C2 "runtime:\\s*\\{\\s*platforms|chrome-extension|macos" packages/connectors/src

# 3) Pinpoint the unsafe cast
rg -n --type=ts -C1 "as unknown as \\['macos'\\]" packages/connectors/src/chrome.ts

Repository: lobu-ai/lobu

Length of output: 50369


🏁 Script executed:

# Read the chrome.ts file to inspect lines around 98 and 301
wc -l packages/connectors/src/chrome.ts
head -n 310 packages/connectors/src/chrome.ts | tail -n +90

Repository: lobu-ai/lobu

Length of output: 7215


🏁 Script executed:

# Check if there are other similar unused parameter patterns in the file
rg -n "async \w+\(_\w+:" packages/connectors/src/chrome.ts

# Verify the ConnectorDefinition type definition to confirm platform support
rg -A5 "type ConnectorDefinition|interface ConnectorDefinition" packages/server/src/utils/connector-compiler.ts | head -20

Repository: lobu-ai/lobu

Length of output: 115


Update the SDK type to include 'chrome-extension' as a valid runtime platform.

Line 98 uses as unknown as ['macos'] to suppress type errors, but the actual platform is 'chrome-extension'. The ConnectorDefinition type in packages/server/src/utils/connector-compiler.ts currently restricts platforms to ['ios' | 'android' | 'macos' | 'windows' | 'linux']. Since 'chrome-extension' is already recognized as a legitimate platform elsewhere in the codebase (e.g., packages/server/src/worker-api.ts), the SDK type definition should be updated to include it instead of relying on a double-cast workaround.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/connectors/src/chrome.ts` at line 98, The runtime platforms type is
being double-cast to hide the fact that 'chrome-extension' isn’t allowed by the
SDK type; update the platform union to include 'chrome-extension' instead of
using "as unknown as ['macos']". Change the ConnectorDefinition (or the
platforms type) in packages/server/src/utils/connector-compiler.ts to allow
'chrome-extension' alongside 'ios'|'android'|'macos'|'windows'|'linux', remove
the workaround cast in packages/connectors/src/chrome.ts (the runtime: {
platforms: [...] } entry), and ensure any related SDK types referenced in
packages/server/src/worker-api.ts are consistent with the new union.

},
};

async sync(_ctx: SyncContext): Promise<SyncResult> {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Remove the unused sync parameter instead of underscore-prefixing it.

_ctx should be deleted to satisfy the repo rule for unused parameters.

Suggested change
-  async sync(_ctx: SyncContext): Promise<SyncResult> {
+  async sync(): Promise<SyncResult> {
     throw new Error(BRIDGE_ONLY);
   }

As per coding guidelines, packages/**/*.{ts,tsx}: When fixing unused-parameter errors, delete the parameter rather than prefixing with \_``.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
async sync(_ctx: SyncContext): Promise<SyncResult> {
async sync(): Promise<SyncResult> {
throw new Error(BRIDGE_ONLY);
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/connectors/src/chrome.ts` at line 301, The method signature async
sync(_ctx: SyncContext): Promise<SyncResult> should remove the unused parameter
instead of underscore-prefixing it; update the function declaration in the
Chrome connector (the sync method) to async sync(): Promise<SyncResult>, remove
any unused local reference to _ctx, and ensure call sites (if any) that invoke
sync still work with the no-argument signature.

// dispatcher executes via chrome.debugger + a custom DOM accessibility
// snapshot). Replaces the four prior standalone connectors
// (chrome.tabs / browser.evaluate / browser.page_text / browser.fill_form).
export * from './chrome.ts';
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Confirm default export in chrome connector
rg -n --type=ts -C1 "^export default class ChromeConnector" packages/connectors/src/chrome.ts

# Confirm absence of non-default exports in chrome connector
rg -nP --type=ts "^(export\\s+(?!default).+)" packages/connectors/src/chrome.ts || true

# Confirm barrel uses star re-export
rg -n --type=ts -C1 "export \\* from '\\./chrome\\.ts';" packages/connectors/src/index.ts

Repository: lobu-ai/lobu

Length of output: 317


Barrel export drops ChromeConnector due to export * semantics.

Line 14 uses export *, which excludes default exports in ES modules. Since chrome.ts exports ChromeConnector as default, it won't be available to consumers of this barrel.

Suggested change
-export * from './chrome.ts';
+export { default as ChromeConnector } from './chrome.ts';

After applying this fix, run make build-packages to recompile the package.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
export * from './chrome.ts';
export { default as ChromeConnector } from './chrome.ts';
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/connectors/src/index.ts` at line 14, The barrel export uses "export
* from './chrome.ts'" which omits the default export ChromeConnector; fix by
re-exporting the default explicitly—add an explicit named re-export like "export
{ default as ChromeConnector } from './chrome.ts'" (or change chrome.ts to
export const ChromeConnector as a named export and keep the barrel), then
rebuild with make build-packages so consumers can import ChromeConnector from
the package.

buremba added 3 commits May 18, 2026 15:18
Codex review of the v1 PR pair surfaced architectural gaps. This addresses
the lobu-side items (the extension-side items land in lobu-ai/owletto
PR #177 same-name branch).

- packages/connectors/src/chrome.ts: add actions.close_tab. Required at
  the end of any multi-step session — the extension no longer auto-
  disposes scratch tabs between tool calls (that broke the natural
  navigate → get_accessibility_tree → click_ref flow).
- packages/connectors/src/chrome.ts: relax ref schema. document_epoch +
  ref_id required; frame_id reserved for v2 iframe support but not
  required in v1 (we don't emit it).
- packages/server/src/worker-api.ts: completeActionRun now runs through
  authorizeRunForWorker, matching the /complete and /stream endpoints.
  Without this, a leaked worker token could overwrite action_output on
  arbitrary runs.
Codex re-review: user-scoped workers (chrome-extension) couldn't reach
/api/workers/complete-action — that endpoint wasn't in
allowedPathsForUserWorker. Action runs from the chrome extension would
get a 403 on completion, the run would stay in 'running' forever, and
action_output never landed. Adds the path. authorizeRunForWorker still
gates ownership, so a user worker can only finalize runs it claimed.
…downloads

Four ambient feeds beyond the open_tabs snapshot:

1. chrome.feeds.tab_events — live stream of tab create/close/url-change/
   activate events. No new permission (uses baseline 'tabs'). Companion
   to open_tabs: snapshot tells you 'what's open right now', tab_events
   gives the lossless timeline.

2. chrome.history connector — one event per page visit. Opt-in via the
   user granting the optional 'history' Chrome permission in the
   sidepanel Permissions panel. Backfills ~90 days of history on first
   sync (chrome.history.search), then streams chrome.history.onVisited
   thereafter.

3. chrome.bookmarks connector — one event per bookmark with folder path.
   Opt-in via 'bookmarks' permission. Backfills the full tree, then
   streams onCreated/Removed/Changed/Moved.

4. chrome.downloads connector — one event per file downloaded with its
   source URL. Opt-in via 'downloads' permission (new optional perm —
   add to manifest in the matching owletto PR). Backfills recent
   downloads via chrome.downloads.search, then streams onCreated +
   onChanged (state=complete).

Auto-wire: the extension already advertises the corresponding
browser.history / browser.bookmarks / browser.downloads capabilities
when the user grants the optional permissions; device-reconcile.ts
auto-creates the connection per (org × device × connector) as soon as
the capability shows up.
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

♻️ Duplicate comments (2)
packages/connectors/src/chrome.ts (2)

344-344: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Remove the unused sync parameter instead of underscore-prefixing it.

The _ctx parameter should be deleted entirely to satisfy the coding guideline for unused parameters.

Suggested change
-  async sync(_ctx: SyncContext): Promise<SyncResult> {
+  async sync(): Promise<SyncResult> {
     throw new Error(BRIDGE_ONLY);
   }

As per coding guidelines, packages/**/*.{ts,tsx}: When fixing unused-parameter errors, delete the parameter rather than prefixing with _.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/connectors/src/chrome.ts` at line 344, The method signature async
sync(_ctx: SyncContext): Promise<SyncResult> should remove the unused parameter
instead of underscore-prefixing it; change the signature to async sync():
Promise<SyncResult> and update any internal references (if present) that used
_ctx to either remove them or obtain needed context differently, ensuring
imports/types referencing SyncContext are cleaned up if no longer used (look for
the sync method on the class that declares SyncContext and SyncResult).

97-97: ⚠️ Potential issue | 🟠 Major | 🏗️ Heavy lift

Update the SDK type to include 'chrome-extension' as a valid runtime platform.

The cast as unknown as ['macos'] suppresses a type error because ConnectorDefinition does not currently recognize 'chrome-extension' as a valid platform. The SDK type should be extended to include 'chrome-extension' in the platform union instead of relying on this workaround.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/connectors/src/chrome.ts` at line 97, The code currently circumvents
typing by casting runtime: { platforms: ['chrome-extension'] as unknown as
['macos'] }—instead, update the SDK/platform type definition used by
ConnectorDefinition to include 'chrome-extension' in the platform union, remove
the unsafe cast, and set runtime.platforms to a correctly typed array (e.g.,
runtime: { platforms: ['chrome-extension'] }). Locate the platform/SDK union
type referenced by ConnectorDefinition and add 'chrome-extension' to it so the
runtime.platforms assignment is type-safe.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/connectors/src/chrome_bookmarks.ts`:
- Around line 21-23: The function in chrome_bookmarks.ts currently accepts an
unused parameter named `_ctx` (and was earlier noted as `sync`), which was kept
by prefixing with an underscore; remove that unused parameter from the function
signature entirely (delete `_ctx`/unused `sync` instead of renaming it) and
update any internal references or call sites accordingly so the function and its
exported type no longer include the unused parameter name (`_ctx` /
`sync`)—leave all other parameters and logic unchanged.

In `@packages/connectors/src/chrome_downloads.ts`:
- Around line 22-24: The function sync declares an unused parameter named _ctx;
remove that parameter from the sync function signature (and from its type
annotation) so it no longer accepts _ctx, and update any local references/call
sites accordingly; target the sync function declaration in chrome_downloads.ts
and delete the unused _ctx parameter rather than prefixing it.

In `@packages/connectors/src/chrome_history.ts`:
- Around line 21-23: The function signature that currently includes the unused
parameter `_ctx` (the SyncContext parameter in the sync function that returns a
SyncResult) should be changed to remove that parameter entirely; locate the
function named `sync` (or the exported sync handler) in chrome_history.ts and
delete the `_ctx` parameter from its parameter list and any corresponding type
mention so the function no longer declares an unused parameter, leaving only the
parameters actually used inside the function.

---

Duplicate comments:
In `@packages/connectors/src/chrome.ts`:
- Line 344: The method signature async sync(_ctx: SyncContext):
Promise<SyncResult> should remove the unused parameter instead of
underscore-prefixing it; change the signature to async sync():
Promise<SyncResult> and update any internal references (if present) that used
_ctx to either remove them or obtain needed context differently, ensuring
imports/types referencing SyncContext are cleaned up if no longer used (look for
the sync method on the class that declares SyncContext and SyncResult).
- Line 97: The code currently circumvents typing by casting runtime: {
platforms: ['chrome-extension'] as unknown as ['macos'] }—instead, update the
SDK/platform type definition used by ConnectorDefinition to include
'chrome-extension' in the platform union, remove the unsafe cast, and set
runtime.platforms to a correctly typed array (e.g., runtime: { platforms:
['chrome-extension'] }). Locate the platform/SDK union type referenced by
ConnectorDefinition and add 'chrome-extension' to it so the runtime.platforms
assignment is type-safe.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 988ebdd0-d6cd-414a-b42a-81a3de0739cd

📥 Commits

Reviewing files that changed from the base of the PR and between 02d0e4b and 0f61b29.

📒 Files selected for processing (5)
  • packages/connectors/src/chrome.ts
  • packages/connectors/src/chrome_bookmarks.ts
  • packages/connectors/src/chrome_downloads.ts
  • packages/connectors/src/chrome_history.ts
  • packages/connectors/src/index.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/connectors/src/index.ts

Comment on lines +21 to +23
type SyncContext,
type SyncResult,
} from '@lobu/connector-sdk';
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Delete the unused sync parameter instead of prefixing with _.

Line 72 should not use _ctx for unused-parameter handling.

Proposed fix
 import {
   type ActionResult,
   type ConnectorDefinition,
   ConnectorRuntime,
-  type SyncContext,
   type SyncResult,
 } from '`@lobu/connector-sdk`';
@@
-  async sync(_ctx: SyncContext): Promise<SyncResult> {
+  async sync(): Promise<SyncResult> {
     throw new Error(BRIDGE_ONLY);
   }

As per coding guidelines, packages/**/*.{ts,tsx}: When fixing unused-parameter errors, delete the parameter rather than prefixing with _.

Also applies to: 72-74

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/connectors/src/chrome_bookmarks.ts` around lines 21 - 23, The
function in chrome_bookmarks.ts currently accepts an unused parameter named
`_ctx` (and was earlier noted as `sync`), which was kept by prefixing with an
underscore; remove that unused parameter from the function signature entirely
(delete `_ctx`/unused `sync` instead of renaming it) and update any internal
references or call sites accordingly so the function and its exported type no
longer include the unused parameter name (`_ctx` / `sync`)—leave all other
parameters and logic unchanged.

Comment on lines +22 to +24
type SyncContext,
type SyncResult,
} from '@lobu/connector-sdk';
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Apply the repo’s unused-parameter rule in sync.

Line 73 uses _ctx; remove the parameter instead.

Proposed fix
 import {
   type ActionResult,
   type ConnectorDefinition,
   ConnectorRuntime,
-  type SyncContext,
   type SyncResult,
 } from '`@lobu/connector-sdk`';
@@
-  async sync(_ctx: SyncContext): Promise<SyncResult> {
+  async sync(): Promise<SyncResult> {
     throw new Error(BRIDGE_ONLY);
   }

As per coding guidelines, packages/**/*.{ts,tsx}: When fixing unused-parameter errors, delete the parameter rather than prefixing with _.

Also applies to: 73-75

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/connectors/src/chrome_downloads.ts` around lines 22 - 24, The
function sync declares an unused parameter named _ctx; remove that parameter
from the sync function signature (and from its type annotation) so it no longer
accepts _ctx, and update any local references/call sites accordingly; target the
sync function declaration in chrome_downloads.ts and delete the unused _ctx
parameter rather than prefixing it.

Comment on lines +21 to +23
type SyncContext,
type SyncResult,
} from '@lobu/connector-sdk';
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Remove the underscore-unused sync parameter.

Line 73 uses _ctx to suppress an unused parameter; please delete the parameter instead.

Proposed fix
 import {
   type ActionResult,
   type ConnectorDefinition,
   ConnectorRuntime,
-  type SyncContext,
   type SyncResult,
 } from '`@lobu/connector-sdk`';
@@
-  async sync(_ctx: SyncContext): Promise<SyncResult> {
+  async sync(): Promise<SyncResult> {
     throw new Error(BRIDGE_ONLY);
   }

As per coding guidelines, packages/**/*.{ts,tsx}: When fixing unused-parameter errors, delete the parameter rather than prefixing with _.

Also applies to: 73-75

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/connectors/src/chrome_history.ts` around lines 21 - 23, The function
signature that currently includes the unused parameter `_ctx` (the SyncContext
parameter in the sync function that returns a SyncResult) should be changed to
remove that parameter entirely; locate the function named `sync` (or the
exported sync handler) in chrome_history.ts and delete the `_ctx` parameter from
its parameter list and any corresponding type mention so the function no longer
declares an unused parameter, leaving only the parameters actually used inside
the function.

Final codex pre-merge: the extension advertises browser.downloads when
the user grants the downloads permission, but pollWorkerJob in the
gateway drops any capability outside BROWSER_CAPABILITIES before
reconcileDeviceCapabilities runs. The chrome.downloads connector would
never auto-wire. Adding it.
@buremba buremba merged commit 6b2a32b into main May 18, 2026
17 of 19 checks passed
@buremba buremba deleted the feat/chrome-tool-dispatcher branch May 18, 2026 15:22
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