Skip to content

feat: add output formats, event collection, URL blocking, and more - #8

Merged
aeroxy merged 26 commits into
mainfrom
dev
Jun 17, 2026
Merged

feat: add output formats, event collection, URL blocking, and more#8
aeroxy merged 26 commits into
mainfrom
dev

Conversation

@aeroxy

@aeroxy aeroxy commented Jun 14, 2026

Copy link
Copy Markdown
Owner
  • Introduce OutputFormat (Text/Json/Toon) with --toon flag alongside --json. TOON produces compact tabular output for LLM agents (toon-format crate).
  • Add console, network, and sw-logs commands for inspecting page console messages, network requests, and extension service worker logs.
  • Add persistent CDP session that stays attached to the current page so events accumulate across commands; console/network drain on demand instead of using blocking --duration windows.
  • Add --block-url/--allow-url under emulate (+ as global flags) for URL blocking via Network.setBlockedURLs; patterns persist in the daemon.
  • Add kill-daemon subcommand for stopping the background daemon cleanly.
  • Rewrite skill/chrome-devtools/SKILL.md with correct target-name workflow, pattern-based usage examples, and critical gotchas.

Summary by CodeRabbit

Release Notes

  • New Features
    • Added console, network, and sw-logs commands with optional type filtering and duration-based live collection (plus quick drain mode).
    • Added kill-daemon and persistent CDP event buffering to reuse inspection state across page targets.
  • Improvements
    • Expanded URL blocking with repeatable --block-url/--unblock-url and clearing options (--clear-blocks/--clear-all).
    • Unified output selection via mutually exclusive --json/--toon across key commands.
  • Documentation
    • Updated the Chrome DevTools Protocol CLI guide and refreshed README for new commands, output behavior, and blocking semantics.
  • Tests / Bug Fixes
    • Added coverage for per-tab emulation isolation and improved behavior when closing pages.

…ent session

- Introduce OutputFormat (Text/Json/Toon) with --toon flag alongside --json.
  TOON produces compact tabular output for LLM agents (toon-format crate).
- Add `console`, `network`, and `sw-logs` commands for inspecting page
  console messages, network requests, and extension service worker logs.
- Add persistent CDP session that stays attached to the current page so events
  accumulate across commands; `console`/`network` drain on demand instead of
  using blocking --duration windows.
- Add --block-url/--allow-url under `emulate` (+ as global flags) for URL
  blocking via Network.setBlockedURLs; patterns persist in the daemon.
- Add `kill-daemon` subcommand for stopping the background daemon cleanly.
- Rewrite skill/chrome-devtools/SKILL.md with correct target-name workflow,
  pattern-based usage examples, and critical gotchas.
@coderabbitai

coderabbitai Bot commented Jun 14, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: fc1abd34-35a8-41de-8cb8-4c068857d6e4

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR introduces an OutputFormat enum (Text/Json/Toon) to replace all boolean json_output flags, adds persistent CDP session management with buffered network/console events and URL blocklist rules to CdpClient, implements three new inspection commands (console, network, sw-logs) plus kill-daemon, extends the emulate command with URL block/unblock list controls, and comprehensively rewrites documentation in the skill guide and README.

Changes

CDP CLI Expansion: OutputFormat, Persistent Sessions, New Commands, URL Blocklist

Layer / File(s) Summary
OutputFormat enum and format_structured
Cargo.toml, src/format.rs, src/lib.rs
Introduces OutputFormat { Text, Json, Toon } with from_flags(json, toon) (Toon precedence), is_text/is_json/is_toon helpers, and format_structured(value, format) to serialize serde_json::Value using pretty JSON or TOON encoding. Adds toon-format = "0.5" dependency. Registers format module in crate root with unit tests validating precedence and format-resolution integration.
DaemonRequest protocol: OutputFormat, blocklists, format()
src/protocol.rs, tests/executor_tests.rs
Extends DaemonRequest with output_format: Option<OutputFormat>, block_url/unblock_url vectors (serde-defaulted), and marks legacy json_output: bool with serde-default. Adds format() method that uses output_format when present, otherwise maps json_output to Json or falls back to Text. Updates executor tests to initialize new fields.
Persistent CDP client: session lifecycle, buffers, network rules
src/cdp.rs
Adds persistent_session/persistent_target_id Options, network_events/console_events buffers capped by MAX_PERSISTENT_EVENTS, blocklist, and per-target emulation cache to CdpClient. Implements ensure_persistent_session to attach/enable/apply rules, forget_target to drop saved state, apply_emulation_internal and apply_network_rules, drain helpers, get_all_targets, and read_events_for(duration_ms) for timed event reads. Routes persistent session events to appropriate buffers via updated push_event. Adds join_console_args helper and unit tests for per-tab isolation.
Console, network, and service-worker log collection commands
src/commands/console.rs, src/commands/network.rs, src/commands/sw_logs.rs, src/commands/mod.rs
Adds collect_console (drain/live modes, process and type-filter Runtime events, format text or JSON), collect_network (drain/live modes, process Network events keyed by requestId, merge request/response/failure, preserve redirects), and collect_sw_logs (enumerate chrome-extension:// targets, attach sessions, map console/exception events to message objects with extracted extensionId). Each supports dual-mode collection from persistent buffer or live reading with timeout. All include comprehensive unit tests. Registers modules in public exports.
URL blocklist management in emulate command
src/commands/emulation.rs
Extends EmulateParams with block_url, unblock_url, clear_blocks fields; has_emulation() now counts them. emulate() adds blocklist maintenance phase before other work, calls apply_network_rules(), and returns status report of active overrides (including blocked URLs) instead of error when no other action taken. Viewport and geolocation parsing split per-field with dedicated error messages; after CDP update, caches via override structs.
OutputFormat adoption in existing commands
src/commands/evaluate.rs, src/commands/snapshot.rs, src/commands/pages.rs, src/commands/third_party.rs, src/commands/input.rs, src/commands/navigate.rs
Replaces as_json/json_output bool with OutputFormat in evaluate, snapshot, list_pages, list_3p_tools, and execute_3p_tool. Each branches on format.is_text(), routes non-text through format_structured. close_page adds client.forget_target() call to drop saved emulation state. Minor formatting-only refactors to error handling in input and navigate.
CLI: new commands, output flags, global blocklist, kill-daemon, direct-mode wiring
src/lib.rs
Adds mutually-exclusive --toon flag (conflicts with --json) and repeatable --block-url/--unblock-url to Cli. Adds Console, Network, SwLogs, KillDaemon command variants; Emulate gains clear_blocks; Evaluate loses -t alias. Implements output_format() method and early kill-daemon execution (reads PID/socket, sends SIGTERM on Unix, cleans up). Serializes output_format and block lists in daemon requests. Updates direct-mode handlers to use output_format() and propagate blocklist state to emulation params.
Executor: persistent sessions, blocklist merge, format routing, command dispatch
src/commands/executor.rs
Extends known_args validation for new commands and emulate options. Updates is_browser_level for sw-logs/kill-daemon. Conditionally skips clear_events() for collectors. Ensures persistent session and merges top-level block lists (except emulate), applies rules on update. Prefers existing persistent session when target matches. Refactors argument validation. Routes output-capable commands through req.format(). Wires collectors with type filtering and extension id filtering. Tightens numeric parsing for page index.
Comprehensive documentation updates
README.md, skill/chrome-devtools/SKILL.md, tests/telemetry_tests.rs
SKILL.md rewritten with mandatory friendly-name targeting, 11 standard patterns (navigate/emulate/blocking/forms/console/network/evaluation/formats/snapshots/screenshots/extensions/tools), complete command reference with updated flags, critical gotchas with examples, and output format guidance. README expanded with blocklist/console/network/daemon docs, clarified URL blocks target subresources only, refreshed source layout. Minor telemetry test formatting.

Sequence Diagrams

sequenceDiagram
  participant Executor
  participant CdpClient
  participant CDP as Chrome CDP
  participant Format as format_structured

  Executor->>CdpClient: ensure_persistent_session(target_id)
  CdpClient->>CDP: Target.attachToTarget (flatten)
  CdpClient->>CDP: Network.enable / Runtime.enable
  CdpClient->>CDP: Network.setBlockedURLs(blocklist)

  alt console/network with duration_ms == 0 (drain)
    Executor->>CdpClient: drain_console_events() / drain_network_events()
    CdpClient-->>Executor: Vec from persistent buffer
  else console/network with duration_ms > 0 (live)
    Executor->>CdpClient: read_events_for(duration_ms)
    loop until timeout
      CDP-->>CdpClient: Runtime/Network event
      CdpClient->>CdpClient: push_event → buffer
    end
    Executor->>CdpClient: drain_*_events()
  else sw-logs
    Executor->>CdpClient: get_all_targets()
    CdpClient-->>Executor: all targets including service_worker
    loop per service_worker
      Executor->>CDP: Target.attachToTarget
      Executor->>CDP: Runtime.enable
    end
    Executor->>CdpClient: read_events_for(duration_ms)
  end

  Executor->>Executor: process_*_events(raw CDP)
  Executor->>Format: format_structured(events, req.format())
  Format-->>Executor: formatted String
  Executor-->>Executor: CommandResult::output(formatted)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

Possibly related PRs

  • aeroxy/chrome-devtools-cli#7: Modifies list_3p_tools and execute_3p_tool in src/commands/third_party.rs, which this PR further updates to accept OutputFormat instead of a boolean flag and use format_structured for non-text output.
  • aeroxy/chrome-devtools-cli#5: Continues evolving the emulation/executor/pages surface—extending EmulateParams and blocklist logic in src/commands/emulation.rs and src/commands/executor.rs.

Poem

🐇 Hop through formats—Text, Json, and Toon,
Persistent sessions dance beneath the moon!
Networks buffered, consoles drained so clean,
Service workers logged in chrome-extension's scene.
Blocklists block, kill-daemon stands ready—
This rabbit's CLI keeps outputs steady! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly summarizes the main feature additions: output formats, event collection (console/network), URL blocking, and supporting infrastructure. It clearly reflects the PR's primary changes without being misleading or overly vague.
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.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@aeroxy

aeroxy commented Jun 14, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jun 14, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces persistent CDP sessions for continuous event collection, adds new commands for inspecting console logs, network requests, and extension service worker logs, and implements a compact, LLM-friendly TOON output format. The review feedback highlights critical issues that need to be addressed before merging: specifically, the event router in push_event and the service worker log processor both lack session ID filtering, which leads to event pollution from unrelated sessions. Additionally, several commands (sw-logs, console, and network) fail to disable domains or detach sessions if an error occurs during event reading, resulting in potential resource and session leaks.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/cdp.rs Outdated
Comment thread src/commands/sw_logs.rs Outdated
Comment thread src/commands/sw_logs.rs Outdated
Comment thread src/commands/console.rs Outdated
Comment thread src/commands/network.rs Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 7

🤖 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 `@src/cdp.rs`:
- Around line 560-570: The match expression in the `read_events_for` function
combines timeout errors and socket/read errors into the same case, causing real
WebSocket failures to be silently treated as normal timeout completion and
partial data returned as success. Differentiate the two error cases: handle the
timeout case (when tokio::time::timeout returns Err) by breaking the loop
normally, and handle the actual read/socket error case (when self.read_text()
returns Ok(Err)) separately to either propagate the error, log it, or return an
appropriate result instead of silently breaking with partial data.
- Around line 146-152: When detaching from an old target in the
`ensure_persistent_session` method, the event buffers for `network_events` and
`console_events` are not being cleared, causing stale events from the previous
target to persist and be drained under the new page context. In the block where
`persistent_session.take()` is called and we detach from the target, add
clearing of both `network_events` and `console_events` buffers alongside the
`persistent_target_id = None` assignment. Apply this same fix at the other
affected location mentioned in the comment (lines 174-176).
- Around line 212-233: The persistent event buffering logic is capturing Network
and Runtime events without verifying they belong to the active persistent
session, causing events from different sessions to be mixed together. Modify the
event handling in the block where you check for Network.requestWillBeSent,
Network.responseReceived, Network.loadingFinished, Network.loadingFailed,
Runtime.consoleAPICalled, and Runtime.exceptionThrown to extract the sessionId
from the incoming event and compare it against the sessionId stored in
self.persistent_session before appending to self.network_events or
self.console_events. Only push events to these buffers if the sessionIds match.
- Around line 166-172: The Network.enable and Runtime.enable calls for
persistent session setup are being silently ignored with let _ = discards, which
means failures go undetected and the session is still marked as persistent even
when critical domain initialization fails. Remove the let _ = pattern and
instead check the results of both send_to_target calls for "Network.enable" and
"Runtime.enable" - either propagate any errors returned or at minimum log them
and prevent the session from being marked as persistent if either call fails.
This ensures downstream collectors cannot skip per-command enables and miss
events due to uninitialized domains.

In `@src/commands/emulation.rs`:
- Around line 102-114: The allow_url processing block removes patterns from
client.blocklist but never adds them to client.allowlist, so allowed rules are
not persisted as daemon state. When iterating through params.allow_url, add each
pattern to client.allowlist to ensure the allow rules are durably stored and
properly included in status output. Apply the same fix to any other location
where allow_url patterns are processed (such as the similar code block around
line 193-207).

In `@src/commands/executor.rs`:
- Around line 412-457: The executor uses inconsistent default values for the
duration parameter compared to the CLI. In both the "console" and "network"
command handlers, change the unwrap_or(3000) calls to unwrap_or(0) to match the
CLI defaults defined in src/lib.rs, ensuring that direct daemon callers sending
raw JSON requests without a duration field get 0ms (instant drain mode) instead
of 3000ms, which aligns with the documented behavior that omitting the duration
field means "drain instantly".

In `@src/commands/sw_logs.rs`:
- Around line 68-79: The code processes Runtime events for all sessionIds
without filtering out events that don't belong to attached service-worker
sessions. Add a validation check immediately after determining the source
variable (after the find operation on the sessions iterator) to skip processing
events where the sessionId is not found in the attached sessions. Specifically,
if source resolves to "unknown" (indicating the sessionId was not matched),
continue to the next event iteration to prevent unrelated page/session logs from
being included in the sw-logs output.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: af8ddc19-cdd3-4738-88ef-c3cb09704232

📥 Commits

Reviewing files that changed from the base of the PR and between 5a5136e and be9776e.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (17)
  • Cargo.toml
  • skill/chrome-devtools/SKILL.md
  • src/cdp.rs
  • src/commands/console.rs
  • src/commands/emulation.rs
  • src/commands/evaluate.rs
  • src/commands/executor.rs
  • src/commands/mod.rs
  • src/commands/network.rs
  • src/commands/pages.rs
  • src/commands/snapshot.rs
  • src/commands/sw_logs.rs
  • src/commands/third_party.rs
  • src/format.rs
  • src/lib.rs
  • src/protocol.rs
  • tests/executor_tests.rs

Comment thread src/cdp.rs
Comment thread src/cdp.rs Outdated
Comment thread src/cdp.rs Outdated
Comment thread src/cdp.rs
Comment thread src/commands/emulation.rs Outdated
Comment thread src/commands/executor.rs
Comment thread src/commands/sw_logs.rs
Correctness
- cdp::push_event now gates persistent-buffer routing on the event's
  sessionId matching the persistent page session, so sw-logs and ad-hoc
  live sessions no longer leak into the page's console_events /
  network_events buffers.
- sw_logs now filters out events that don't match an attached service
  worker session, preventing page/other-session events from appearing
  as SW logs.

Cleanup (URL blocking)
- Removed the dead `allowlist` field on CdpClient, the `--clear-allows`
  flag, and the unreachable "Allowed URLs:" display branch. The doc
  comments claimed allowlist semantics that were never implemented;
  --allow-url already just removed entries from the blocklist.
- Renamed --allow-url to --unblock-url to match its actual semantics
  (and reword --block-url's help to no longer reference --allow-url).

Robustness
- sw-logs / console / network now capture read_events_for's result, run
  session detach / Runtime.disable / Network.disable cleanup, and only
  then `?`-propagate the error. read_events_for is currently infallible,
  so this is dead-code hygiene — but removes a latent trap the moment
  it gains a fallible path.
- kill-daemon now uses libc::kill(SIGTERM) directly instead of shelling
  out to /usr/bin/kill, and distinguishes ESRCH (stale PID file) from
  real signalling failures.

Tests (19 → 31 tests)
- format::from_flags precedence (toon wins over json)
- DaemonRequest::format() precedence (output_format wins over legacy
  json_output bool)
- format_structured round-trips Json / Toon / Text
- process_console_events: arg joining, description fallback, exception
  mapping, type-filter include/exclude, `error` filter includes
  exceptions, ignores unknown methods
- process_network_events: request+response merge by requestId,
  loadingFailed status, type filter, URL sort, ignores unknown methods,
  orphan response dropped
- extract_extension_id: with path, no path, trailing slash, non-extension
  URL, empty string, prefix-only edge case

Misc
- Executor duration fallback for console/network changed 3000 → 0 so
  hand-crafted / malformed requests default to drain mode consistent
  with the CLI's documented contract.
- Console/Network --duration help clarified: events collected in live
  mode remain available to a later drain.
- skill/chrome-devtools/SKILL.md updated for --unblock-url rename.
@aeroxy

aeroxy commented Jun 14, 2026

Copy link
Copy Markdown
Owner Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces significant enhancements to the Chrome DevTools CLI, including a persistent CDP session for continuous Network and Console event collection, new commands (console, network, sw-logs, and kill-daemon), network URL blocking capabilities, and support for the compact TOON output format. The review feedback highlights critical issues regarding duplicate event delivery in live mode, a failure of URL blocking in direct/fallback mode, and opportunities to make the code more idiomatic and efficient by avoiding unnecessary cloning of session variables.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/commands/emulation.rs
Comment thread src/commands/console.rs Outdated
Comment thread src/commands/network.rs Outdated
Comment thread src/cdp.rs Outdated
Comment thread src/cdp.rs
Comment thread src/cdp.rs Outdated
@aeroxy

aeroxy commented Jun 14, 2026

Copy link
Copy Markdown
Owner Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request enhances the Chrome DevTools CLI by introducing persistent CDP sessions for continuous network and console event collection, adding new commands (console, network, sw-logs, and kill-daemon), implementing URL blocking, and supporting a compact TOON output format. The code review identified several important issues to address: redundant subcommand arguments shadowing global flags, a potential CDP session leak if initialization fails, fragile parsing of non-string primitive values in console and service worker logs, event buffer pollution from service worker logs, and premature deletion of socket/PID files when daemon termination fails due to permission errors.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/lib.rs Outdated
Comment thread src/cdp.rs Outdated
Comment thread src/commands/console.rs Outdated
Comment thread src/commands/sw_logs.rs Outdated
Comment thread src/commands/sw_logs.rs
Comment thread src/lib.rs Outdated
aeroxy added 3 commits June 14, 2026 14:54
…k-url flags

Page-level commands previously attached a throwaway per-command CDP session
while blocklist/emulation state lived on the long-lived persistent session, so
that state never governed the commands that actually ran. Unify on the
persistent session (falling back to a per-command attach only when it is
unavailable), and never detach the persistent session during cleanup.

This fixes `emulate --clear-viewport` / `--clear-geolocation` being silent
no-ops: the override was set on one short-lived session and the clear ran on a
different one. Set and clear now run on the same session, so clearing works.
It also lets `--block-url` govern the page's subresource requests during
navigation.

Also dedupe the network flags. `--block-url` / `--unblock-url` were declared
both as global flags and as `emulate` subcommand flags, which shadowed each
other and forced a workaround in the executor. They are now defined once
(global) and inherited by `emulate` via clap; the emulate handler still applies
them itself, ordered before `--clear-blocks` (clear, then add), which is why the
generic merge keeps skipping "emulate".

cdp: store the persistent session id before enabling Network/Runtime so events
arriving during enable are routed to the persistent buffers; reset the session
id and detach if either enable fails.

docs:
- Document that `--block-url` blocks subresources only (images, scripts,
  fetch/XHR, CDN, trackers) and not top-level navigations — a Chrome
  `Network.setBlockedURLs` limitation, not a CLI bug.
- Add README reference for console/network/sw-logs/kill-daemon.
- Correct the live-mode description: `--duration` consumes events, so they do
  not reappear on a later drain.

Verified against live (headless) Chrome on google.com: navigate, evaluate,
snapshot, network, console, fill, screenshot, dialog handling, subresource
blocking, and the `--clear-viewport` fix (756 -> 800 -> 756). cargo build clean,
cargo test 31 passed.
@aeroxy

aeroxy commented Jun 14, 2026

Copy link
Copy Markdown
Owner Author

/gemini review

@aeroxy

aeroxy commented Jun 14, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jun 14, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces persistent CDP sessions to continuously collect network and console events, adds new commands (console, network, sw-logs, and kill-daemon), and implements URL blocking capabilities along with a compact TOON output format for LLM agents. The reviewer feedback highlights critical issues with URL blocking in direct/fallback mode, where the blocklist is silently ignored when a persistent session is unavailable. To resolve this, the reviewer suggests refactoring apply_network_rules to accept an optional session ID and applying it during fallback session attachment. Additionally, the reviewer recommends preserving the chronological order of network requests instead of sorting them alphabetically by URL to improve sequence analysis.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/cdp.rs Outdated
Comment thread src/commands/emulation.rs
Comment thread src/commands/executor.rs Outdated
Comment thread src/commands/executor.rs
Comment thread src/commands/network.rs Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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 (1)
src/cdp.rs (1)

591-601: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Don’t treat WebSocket read failures as normal timeout completion.

At Line 600, Ok(Err(_)) | Err(_) => break masks transport errors and returns partial results as success.

Proposed fix
-                Ok(Err(_)) | Err(_) => break,
+                Ok(Err(e)) => return Err(e),
+                Err(_) => break,
🤖 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 `@src/cdp.rs` around lines 591 - 601, The current match statement at the
timeout call site is masking transport errors by treating both timeout
expiration (Err(_)) and read failures (Ok(Err(_))) identically by just breaking
out of the loop. Refactor the match statement to distinguish between these two
cases: when the timeout expires (Err(_)), you can safely break to indicate
normal timeout completion; however, when read_text() actually fails
(Ok(Err(_))), this represents a real transport error that should be propagated
or logged as an error rather than silently returning partial results as success.
This ensures that legitimate WebSocket failures are not hidden from the caller.
🤖 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 `@src/cdp.rs`:
- Around line 203-211: The `apply_network_rules_internal` method is currently
discarding the result of the `send_to_target` call using `let _ = `, which means
failures to apply the Network.setBlockedURLs command to Chrome are silently
ignored and the caller cannot detect failures. Remove the `let _ = ` discard
pattern and instead propagate or handle the error result appropriately, either
by returning the Result type or checking and logging failures. Apply this same
fix to the other similar location mentioned at lines 189-193 where network rule
application also discards results.

In `@src/lib.rs`:
- Around line 685-689: The direct fallback mode for page navigation is
hardcoding empty vectors for block_url and unblock_url instead of using the
global blocklist configuration, causing command-line flags like --block-url and
--unblock-url to be silently ignored. Replace the Vec::new() calls with the
appropriate values from the global blocklist configuration so that the direct
fallback mode respects the same URL filtering rules as daemon mode. This issue
occurs at two locations: around line 685 (for new-page fallback) and around line
787 (for navigate fallback), both of which need to be updated consistently to
use the actual blocklist values instead of empty vectors.
- Around line 556-567: The PID is parsed as u32 but then cast to libc::pid_t (a
signed integer type) before being passed to the libc::kill function. On systems
where pid_t is i32, u32 values exceeding i32::MAX will wrap to negative numbers,
causing unexpected behavior. Add a validation check after parsing the PID string
into the pid variable to ensure the parsed value does not exceed the maximum
value representable by libc::pid_t (typically i32::MAX). If the PID is out of
range, return an error similar to the existing invalid PID error handling. This
validation should occur before the unsafe call to libc::kill to prevent
incorrect signal delivery.

---

Duplicate comments:
In `@src/cdp.rs`:
- Around line 591-601: The current match statement at the timeout call site is
masking transport errors by treating both timeout expiration (Err(_)) and read
failures (Ok(Err(_))) identically by just breaking out of the loop. Refactor the
match statement to distinguish between these two cases: when the timeout expires
(Err(_)), you can safely break to indicate normal timeout completion; however,
when read_text() actually fails (Ok(Err(_))), this represents a real transport
error that should be propagated or logged as an error rather than silently
returning partial results as success. This ensures that legitimate WebSocket
failures are not hidden from the caller.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 7f330c19-8245-4c64-a916-c502a65b96fd

📥 Commits

Reviewing files that changed from the base of the PR and between 5a5136e and bbb25c9.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (21)
  • Cargo.toml
  • README.md
  • skill/chrome-devtools/SKILL.md
  • src/cdp.rs
  • src/commands/console.rs
  • src/commands/emulation.rs
  • src/commands/evaluate.rs
  • src/commands/executor.rs
  • src/commands/input.rs
  • src/commands/mod.rs
  • src/commands/navigate.rs
  • src/commands/network.rs
  • src/commands/pages.rs
  • src/commands/snapshot.rs
  • src/commands/sw_logs.rs
  • src/commands/third_party.rs
  • src/format.rs
  • src/lib.rs
  • src/protocol.rs
  • tests/executor_tests.rs
  • tests/telemetry_tests.rs

Comment thread src/cdp.rs Outdated
Comment thread src/lib.rs
Comment thread src/lib.rs Outdated
aeroxy added 2 commits June 14, 2026 17:12
…onologically

Executor
- When the persistent CDP session is unavailable (failed to attach or
  lost), the fallback fresh session now re-applies `Network.setBlockedURLs`
  using the daemon's blocklist. Without this, `--block-url` was silently
  ignored on the degraded path because ensure_persistent_session is what
  normally calls setBlockedURLs.
- `apply_network_rules_internal` promoted to pub(crate) so executor.rs can
  call it on the fresh session.

Network command
- Drop the alphabetical-by-URL sort on `network` output. Events now
  appear in first-seen (chronological) order, with redirects reusing the
  existing requestId in place rather than being repositioned.
- Test `test_process_network_events_sorts_by_url` renamed to
  `test_process_network_events_preserves_chronological_order` and
  expectations flipped (z.example.com before a.example.com).
…ndling

Network rule application used to swallow failures. `apply_network_rules` and
`apply_network_rules_internal` now return `Result` and propagate
`Network.setBlockedURLs` errors; the callers (`emulate`, the executor's global
block-flag handler, and the fallback-session apply) propagate with `?` instead
of discarding the result, so a failed blocklist update surfaces to the user.

`read_events_for` no longer treats a real WebSocket read error the same as the
collection-window timeout. A timeout is the normal completion path; an
`Ok(Err(_))` from `read_text()` is a transport failure and is now logged as a
warning before stopping, so a partial result isn't silently presented as a clean
end-of-window.

`kill-daemon` now validates that the PID from the PID file fits in
`libc::pid_t` (i32) before signaling. A corrupted PID file could otherwise wrap
to a negative value via `as`, and `kill(-pid)` signals an entire process group —
potentially hitting unrelated processes. The guard lives inside `#[cfg(unix)]`
so non-unix builds stay warning-clean.

Also document, via comments, that direct-mode `new-page` / `navigate`
intentionally do not carry the URL blocklist: blocking is daemon-only state and
there is no persistent session to apply it to in the one-shot direct path.
@aeroxy

aeroxy commented Jun 14, 2026

Copy link
Copy Markdown
Owner Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request significantly expands the Chrome DevTools CLI by introducing a persistent CDP session in the background daemon for continuous event tracking. It adds new commands to drain and live-monitor console logs (console), network requests (network), and extension service worker logs (sw-logs), alongside a kill-daemon command. It also implements URL blocking capabilities and introduces a compact, LLM-friendly TOON output format. The review feedback identifies that while the documentation states that running emulate with no flags displays all active overrides, the current implementation only shows blocked URLs. The reviewer provides actionable suggestions to store and display active viewport and geolocation overrides within the persistent CdpClient session.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/cdp.rs
Comment thread src/cdp.rs
Comment thread src/commands/emulation.rs
Comment thread src/commands/emulation.rs
Comment thread src/commands/emulation.rs
…tion per tab

`emulate` with no flags is documented to show all active overrides, but only the
blocklist was tracked — viewport and geolocation weren't stored, so they could
never be displayed. Store them as structured overrides (`ViewportOverride`,
`GeolocationOverride`) on the client: set on apply, reset on
`--clear-viewport` / `--clear-geolocation` / `--clear-all`, and render alongside
the blocklist in the no-flags output.

Make all emulation (viewport, geolocation, URL blocklist) **per-tab** instead of
a single daemon-wide value. The active tab's state lives in the
`blocklist`/`viewport`/`geolocation` fields; `ensure_persistent_session` saves
that state under the outgoing target id and restores the incoming target's saved
state (or empty) on every target switch, then applies it to the new session.
Each tab keeps its own overrides — they persist across navigation within a tab
and don't leak to other tabs, so e.g. a mobile viewport with images blocked on
one tab and a desktop baseline on another can be held at the same time. State is
kept in exactly one place per tab (active fields when current, the saved map
otherwise); restore removes from the map and save writes the leaving tab's own
state, so there's no duplication.

- Re-apply viewport/geolocation on target switch via `apply_emulation_internal`,
  mirroring the existing blocklist re-apply, so overrides survive switches.
- `close-page` calls `forget_target` to drop a closed tab's saved state (and
  reset the active fields + invalid persistent session if it was the active tab).
- Only save tabs that actually have overrides, so the saved-state map doesn't
  accumulate an empty entry for every tab visited.

Docs (README, SKILL) updated from daemon-wide to per-tab semantics.

Verified on live Chrome: tab A held 375px + `*.png` blocked (fetch blocked) while
tab B held 1440px + no block (fetch OK), concurrently, while interleaving
commands; `--clear-*` removes the right override; target_id is stable across
cross-origin navigation so a tab's state stays attached to it. cargo build clean,
cargo test 31 passed.
@aeroxy

aeroxy commented Jun 14, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jun 14, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.

@aeroxy

aeroxy commented Jun 14, 2026

Copy link
Copy Markdown
Owner Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces persistent CDP sessions to continuously collect network and console events, adding new commands (console, network, sw-logs, and kill-daemon) and per-tab emulation state isolation (viewport, geolocation, and URL blocking). It also adds support for the compact TOON output format. Feedback focuses on a security vulnerability in kill-daemon where a PID of 0 could terminate the entire process group, and performance optimizations in src/cdp.rs to replace Vec with VecDeque for more efficient event buffer capping.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/lib.rs
Comment thread src/cdp.rs Outdated
Comment thread src/cdp.rs Outdated
Comment thread src/cdp.rs
Comment thread src/cdp.rs Outdated

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request significantly enhances the Chrome DevTools CLI by introducing persistent CDP sessions in the daemon for continuous event collection, adding new commands (console, network, sw-logs, and kill-daemon), implementing per-tab emulation and URL blocking isolation, and adding a compact --toon output format for LLM agents. The review feedback correctly identifies a critical inconsistency in direct mode (run_direct), where global URL blocking flags are not applied to all page-level commands (like Click or Fill), potentially allowing triggered network requests to bypass the blocklist. Implementing the suggested fix to apply the blocklist across all non-emulation page-level commands in direct mode will ensure behavioral consistency with daemon mode.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/lib.rs
@aeroxy

aeroxy commented Jun 16, 2026

Copy link
Copy Markdown
Owner Author

/gemini review

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

Gemini encountered an error creating the review. You can try again by commenting /gemini review.

@aeroxy

aeroxy commented Jun 16, 2026

Copy link
Copy Markdown
Owner Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a persistent CDP session to continuously collect network and console events, enabling per-tab emulation isolation (viewport, geolocation, and URL blocking) and new inspection commands (console, network, sw-logs, and kill-daemon). It also adds support for TOON, a compact output format designed for LLM agents. The review feedback highlights two important issues in the fallback/direct modes: first, event duplication occurs during subsequent drains because Network and Runtime events are incorrectly pushed to the generic event buffer; second, active viewport and geolocation overrides are lost in the degraded executor path because only the network blocklist is re-applied.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/cdp.rs
Comment thread src/commands/executor.rs
@aeroxy

aeroxy commented Jun 16, 2026

Copy link
Copy Markdown
Owner Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces persistent CDP sessions to enable continuous background collection of network and console events, per-tab emulation isolation, and URL blocking. It adds new commands (console, network, sw-logs, and kill-daemon) and supports a new compact output format (TOON) tailored for LLM agents. Feedback on the changes highlights two issues in src/cdp.rs: first, in direct mode, the Network domain must be explicitly enabled before applying URL blocking rules; second, in read_events_for, ad-hoc session events can leak into the general events buffer when a persistent session is active, requiring stricter filtering based on the session ID.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/cdp.rs
Comment thread src/cdp.rs Outdated
@aeroxy

aeroxy commented Jun 16, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai full review

@aeroxy

aeroxy commented Jun 16, 2026

Copy link
Copy Markdown
Owner Author

/gemini review

@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

Gemini encountered an error creating the review. You can try again by commenting /gemini review.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/commands/evaluate.rs (1)

54-77: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Keep non-text evaluate output machine-parseable.

The DOM-traversal hint is appended even in Json/Toon modes, which turns structured output into mixed text and breaks downstream parsers.

💡 Suggested fix
-    if expression.contains("querySelector")
-        || expression.contains("document.body")
-        || expression.contains("getElementById")
-        || expression.contains("getElementsBy")
-    {
+    if format.is_text()
+        && (expression.contains("querySelector")
+            || expression.contains("document.body")
+            || expression.contains("getElementById")
+            || expression.contains("getElementsBy"))
+    {
         output_hint.push_str("\n\n[HINT: Avoid using `evaluate` for DOM traversal. Use the `snapshot` command to get a clean accessibility tree of the page, then use `click` or `fill`.]");
     }
🤖 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 `@src/commands/evaluate.rs` around lines 54 - 77, The DOM-traversal hint is
being unconditionally appended to output_hint after the format check block,
which causes text hints to be added to structured JSON and Toon output, breaking
machine-parseable formats. Move the entire hint-appending block (the condition
checking for "querySelector", "document.body", "getElementById", "getElementsBy"
and the output_hint.push_str call) inside the `if format.is_text()` block so the
hint is only appended for text-format output.
♻️ Duplicate comments (1)
skill/chrome-devtools/SKILL.md (1)

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

Add language tag to unlabeled fenced code block (MD040).

The output example block is missing a language identifier on the opening fence.

🔧 Proposed fix
 **Step 1: Run `list-pages` to see what's open and get target names**
 ```bash
 chrome-devtools list-pages

Output:
- +text
[0] (warm-squid) Your Repositories — https://github.com/aeroxy
[1] (pink-hen) Gmail — https://mail.google.com
[2] (hazy-vole) Example — https://example.com

🤖 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 `@skill/chrome-devtools/SKILL.md` around lines 35 - 40, The output example
block in the SKILL.md file has a fenced code block that is missing a language
identifier, which violates markdown linting rule MD040. Locate the output
example section showing the three repository links (warm-squid, pink-hen,
hazy-vole) and add the language tag "text" to the opening fence of that code
block by changing the opening ``` to ```text.

Source: Linters/SAST tools

🤖 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.

Outside diff comments:
In `@src/commands/evaluate.rs`:
- Around line 54-77: The DOM-traversal hint is being unconditionally appended to
output_hint after the format check block, which causes text hints to be added to
structured JSON and Toon output, breaking machine-parseable formats. Move the
entire hint-appending block (the condition checking for "querySelector",
"document.body", "getElementById", "getElementsBy" and the output_hint.push_str
call) inside the `if format.is_text()` block so the hint is only appended for
text-format output.

---

Duplicate comments:
In `@skill/chrome-devtools/SKILL.md`:
- Around line 35-40: The output example block in the SKILL.md file has a fenced
code block that is missing a language identifier, which violates markdown
linting rule MD040. Locate the output example section showing the three
repository links (warm-squid, pink-hen, hazy-vole) and add the language tag
"text" to the opening fence of that code block by changing the opening ``` to
```text.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 4210a06d-a6af-4b94-99da-57b2b9958eda

📥 Commits

Reviewing files that changed from the base of the PR and between 5a5136e and 0bb2660.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (21)
  • Cargo.toml
  • README.md
  • skill/chrome-devtools/SKILL.md
  • src/cdp.rs
  • src/commands/console.rs
  • src/commands/emulation.rs
  • src/commands/evaluate.rs
  • src/commands/executor.rs
  • src/commands/input.rs
  • src/commands/mod.rs
  • src/commands/navigate.rs
  • src/commands/network.rs
  • src/commands/pages.rs
  • src/commands/snapshot.rs
  • src/commands/sw_logs.rs
  • src/commands/third_party.rs
  • src/format.rs
  • src/lib.rs
  • src/protocol.rs
  • tests/executor_tests.rs
  • tests/telemetry_tests.rs

@aeroxy

aeroxy commented Jun 17, 2026

Copy link
Copy Markdown
Owner Author

/gemini review

@aeroxy

aeroxy commented Jun 17, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request enhances the Chrome DevTools CLI by introducing persistent CDP sessions for continuous console and network event collection, per-tab emulation and URL blocking isolation, extension service worker log collection (sw-logs), a kill-daemon command, and a compact TOON output format. The reviewer pointed out an issue in src/cdp.rs where setup results are evaluated within an array literal, which prevents proper short-circuiting on failure. Handling these sequentially was recommended to avoid executing subsequent setup steps if an earlier one fails.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/cdp.rs Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 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 `@src/cdp.rs`:
- Around line 272-284: The network and emulation rules are being applied
concurrently via array evaluation, which means if the network rules fail, the
emulation is still applied, leaving the target partially configured. Replace the
array literal containing both await calls with sequential if let Err blocks.
First, await the result of apply_network_rules_internal and check for errors
with an if let Err block that performs the cleanup and returns. Then, await
apply_emulation_internal and perform the same error handling in a separate if
let Err block. This ensures that if network rules fail, emulation rules are
never applied, preventing partial configuration state.

In `@src/commands/executor.rs`:
- Around line 228-240: The block/unblock URL logic currently applies to the
navigate command through the generic merge before emulation, but navigate
emulation can clear these rules before navigation because empty blocklist fields
are passed to EmulateParams. Modify the code to skip the generic block/unblock
merge (the conditional block checking cmd != "emulate" && cmd != "close-page" &&
cmd != "select-page") for the navigate command as well, and instead pass
req.block_url and req.unblock_url into the navigate EmulateParams structure.
This ensures block/unblock rules are applied during the navigate emulation phase
with the correct clear/apply ordering, matching the behavior of the emulate
command.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: bc4cec51-0b19-44a9-9a53-714bdd6c5aeb

📥 Commits

Reviewing files that changed from the base of the PR and between 5a5136e and e6fe38d.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (21)
  • Cargo.toml
  • README.md
  • skill/chrome-devtools/SKILL.md
  • src/cdp.rs
  • src/commands/console.rs
  • src/commands/emulation.rs
  • src/commands/evaluate.rs
  • src/commands/executor.rs
  • src/commands/input.rs
  • src/commands/mod.rs
  • src/commands/navigate.rs
  • src/commands/network.rs
  • src/commands/pages.rs
  • src/commands/snapshot.rs
  • src/commands/sw_logs.rs
  • src/commands/third_party.rs
  • src/format.rs
  • src/lib.rs
  • src/protocol.rs
  • tests/executor_tests.rs
  • tests/telemetry_tests.rs

Comment thread src/cdp.rs Outdated
Comment thread src/commands/executor.rs
@aeroxy

aeroxy commented Jun 17, 2026

Copy link
Copy Markdown
Owner Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a persistent CDP session architecture to the background daemon, enabling continuous background collection of network and console events. It adds several new inspection commands (console, network, sw-logs) to drain or live-monitor these events, alongside a kill-daemon command for clean daemon shutdown. Additionally, it implements per-tab emulation isolation (viewport, geolocation, and URL blocking via --block-url/--unblock-url) and introduces structured output formatting options, including JSON and TOON (Token-Oriented Object Notation). No review comments were provided, so there is no additional feedback to address.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

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