Skip to content

Profile short Dart file runs - #4

Merged
kingwill101 merged 6 commits into
mainfrom
fix/run-single-file-fast-exit
Apr 30, 2026
Merged

kingwill101 merged 6 commits into
mainfrom
fix/run-single-file-fast-exit

Conversation

@kingwill101

@kingwill101 kingwill101 commented Apr 28, 2026

Copy link
Copy Markdown
Owner

Summary

  • Allow devtools-profiler run <file>.dart by expanding bare Dart files to dart run <file>.
  • Hold Dart isolates at exit so short-lived scripts can still produce final whole-session CPU and memory artifacts.
  • Add regression coverage with a quick-exit Dart fixture, update CLI help/docs, and move changed packages to 0.2.1-wip after the 0.2.0 publish.

Validation

  • dart pub get
  • dart analyze .
  • dart test packages/devtools_profiler_protocol
  • dart test packages/devtools_region_profiler
  • dart test packages/devtools_profiler_core
  • dart test packages/devtools_profiler_cli
  • dart run devtools_profiler_cli:devtools_profiler run --hide-sdk --hide-runtime-helpers --method-table t.dart
  • git diff --staged --check

Summary by CodeRabbit

  • New Features

    • Run a bare Dart file directly as a shorthand (e.g., devtools-profiler run <file.dart>) for profiling.
  • Improvements

    • Keep Dart launches paused at isolate exit to capture final CPU and memory snapshots, improving short-lived script profiling.
  • Documentation

    • Clarified CLI usage: profiler options go before the target; -- is only needed when the target has its own args; updated examples and help text.
  • Tests / Changelog

    • Added integration tests, unreleased changelog entries, and bumped package versions to 0.2.1-wip.

@coderabbitai

coderabbitai Bot commented Apr 28, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

CLI and core profiler accept bare Dart file targets (auto-expanded to dart run <file>). ProfileRunner and launch code now normalize commands and, for Dart launches, monitor isolate exit-pause to capture final CPU/memory snapshots; new APIs coordinate detecting paused isolates and resuming them to complete profiling.

Changes

Cohort / File(s) Summary
Top-level Docs & Changelogs
README.md, packages/devtools_profiler_cli/README.md, packages/devtools_profiler_cli/CHANGELOG.md, packages/devtools_profiler_core/README.md, packages/devtools_profiler_core/CHANGELOG.md, skills/devtools-profiler-local/SKILL.md
Documented bare-Dart-file shorthand (`run [--] <dart-file
CLI Surface & Tests
packages/devtools_profiler_cli/lib/src/cli/commands/capture_commands.dart, packages/devtools_profiler_cli/test/cli_test.dart
Help/usage text, examples, and error messages updated to reflect new run signature and examples (devtools-profiler run bin/main.dart); tests adjusted accordingly.
Package Manifests
packages/devtools_profiler_cli/pubspec.yaml, packages/devtools_profiler_core/pubspec.yaml
Bumped package versions to 0.2.1-wip; CLI dependency constraint on devtools_profiler_core updated to ^0.2.1-wip.
Command Normalization & Launch API
packages/devtools_profiler_core/lib/src/capture/runner/process_launch.dart, packages/devtools_profiler_core/lib/src/capture/profile_run_request.dart
Added normalizeProfileCommand() and isBareDartFileCommand(); launchProfiledProcess now requires explicit command param; validation/error messages accept Dart-file-first shorthand.
ProfileRunner Flow
packages/devtools_profiler_core/lib/src/capture/profile_runner.dart
Normalizes command early, classifies command kind, and splits completion flow: Dart commands use exit-pause monitoring and coordinated resume/retry to capture final snapshots; non-Dart commands retain prior flow. Cleanup now awaits process.exitCode with a 2s bounded wait.
Exit-Pause Monitoring (Controller & Hookup)
packages/devtools_profiler_core/lib/src/capture/runner/profile_session_controller.dart, packages/devtools_profiler_core/lib/src/capture/runner/profile_session_vm_hookup.dart
Added monitorExitPause flag on attach, exitPauseSignal, tracking of paused isolates, reconciliation against VM isolate list, resumePausedExitIsolates() API, debug-event subscription handling, and related helpers.
Tests & Fixtures
packages/devtools_profiler_core/test/fixtures/profiled_app/bin/quick_exit.dart, packages/devtools_profiler_core/test/fixtures/profiled_app/bin/quick_worker_isolate.dart, packages/devtools_profiler_core/test/profile_runner_test.dart
Added quick-exit and worker-isolate fixture scripts and integration tests validating bare-Dart rewrite, exit-pause capture for short-lived scripts, artifact emission, and worker-isolate inclusion.
Minor Doc Comments
packages/devtools_profiler_core/lib/src/capture/profile_run_request.dart
Doc comments updated to allow a Dart file path as first command element (explained as expanded to dart run <file>).

Sequence Diagram

sequenceDiagram
    participant CLI as CLI User
    participant PR as ProfileRunner
    participant PL as ProcessLaunch
    participant PP as ProfiledProcess
    participant VSC as ProfileSessionController
    participant VMH as VMServiceHookup

    CLI->>PR: run(request with bare.dart)
    PR->>PL: normalize command (bare.dart → dart run bare.dart)
    PL->>PP: launch normalized command
    PR->>VSC: attachToVmService(monitorExitPause=true)
    VSC->>VMH: attachToVmService(monitorExitPause=true)
    VMH->>VMH: subscribe to debug stream (watch for EventKind.kPauseExit)

    par Profiling activity
        PP->>VMH: emit pause-exit events
        VMH->>VMH: record paused isolates & reconcile with VM
    and Waiting for completion
        PR->>VSC: await exitPauseSignal or process.exitCode
        VSC->>VMH: confirm all app isolates paused
    end

    VMH-->>VSC: all isolates paused ✓
    PR->>VSC: capture final CPU/memory snapshots
    PR->>VSC: resumePausedExitIsolates()
    VSC->>VMH: resumePausedExitIsolates()
    VMH->>PP: resume isolates
    PP->>PR: process exits
    PR-->>CLI: return profile artifact
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Poem

A rabbit hops through lines of Dart, 🐇
Expands a file into a running start,
Watches isolates pause at exit’s gate,
Resumes them gently to capture their state,
Short scripts now return profiles great.

🚥 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 'Profile short Dart file runs' directly captures the main feature: enabling profiling of short-lived Dart file invocations via bare-file shorthand and extended isolate lifetime.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/run-single-file-fast-exit

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
Review rate limit: 0/1 reviews remaining, refill in 60 minutes.

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

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9e02b33a36

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +316 to +318
final kind = completion.kind;
if (kind != null) {
return (kind: kind, exitCode: completion.exitCode);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Wait for root isolate exit before ending Dart profile run

With --pause-isolates-on-exit enabled, a pause-at-exit can happen when any non-system isolate finishes, not just when the whole process is done. This branch returns as soon as the first pause is observed, so runs that spawn short-lived worker isolates can be finalized early (handleProcessExit runs while the app is still active) and then force-killed about 10 seconds later in _resumeExitPausedProcess if the main isolate is still running. That can corrupt whole-session results and terminate valid long-running workloads that use background isolates.

Useful? React with 👍 / 👎.

@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 the current code and only fix it if needed.

Inline comments:
In `@packages/devtools_profiler_core/lib/src/capture/profile_runner.dart`:
- Around line 346-351: The fallback path in run() currently calls process.kill()
and returns the raw exitCodeFuture which can hang if the kill fails; modify the
recovery to attempt killing the process then await the process exit with a
bounded timeout (e.g., await the exitCodeFuture with Future.timeout), and if the
timeout elapses log a clear warning via sessionController.addWarning and return
a forced non-zero exit (or throw) instead of the unbounded exitCodeFuture.
Target the block that calls sessionController.addWarning(...), process.kill(),
and returns exitCodeFuture so you add the timed wait and fallback return there.
- Around line 290-352: Add concise doc comments for the new exit-pause helpers
to document the shutdown contract, retry semantics, and VM-service/protocol
assumptions encoded by the code. Specifically, add /// comments above
_waitForDartProcessCompletion describing that it waits for either process exit
or all app isolates reaching an exit pause, explains the polling loop with
Future.any and why recordCurrentlyPausedExitIsolates and
haveAllAppIsolatesPausedAtExit are used, and notes the semantic meaning of the
returned _ProfiledProcessCompletionKind. Also add /// comments above
_resumeExitPausedProcess describing the retry loop (up to 5 attempts), the 2s
timeout on exitCodeFuture, the reason for repeated resume calls via
sessionController.resumePausedExitIsolates, and the final fallback behavior
(warning, kill, and returning exitCodeFuture). Reference the sessionController
methods (allAppIsolatesPausedAtExit, recordCurrentlyPausedExitIsolates,
haveAllAppIsolatesPausedAtExit, resumePausedExitIsolates, addWarning) in the
comments so future maintainers understand the contract.

In
`@packages/devtools_profiler_core/lib/src/capture/runner/profile_session_vm_hookup.dart`:
- Around line 67-73: The catch blocks that cancel the debug stream
(_debugSubscription) currently only log a warning via context.warnings and can
leave callers of allAppIsolatesPausedAtExit blocked; update those catch handlers
to also resolve/terminate the exit-pause coordination so waiters are not left
hanging (e.g., complete the completer or emit a terminal event used by
allAppIsolatesPausedAtExit), and likewise update the reconciliation path around
the code that expects at least one live app isolate (the reconciliation logic
that checks for live app isolates) to treat an empty/no-visible-isolates case as
a finished/no-op so it doesn't wait indefinitely. Apply the same change to the
other similar catch sites (the ones around lines 76-78 and the reconciliation at
127-130) so every monitor startup failure both logs the error and explicitly
completes/fails the coordination primitive used by allAppIsolatesPausedAtExit.

In
`@packages/devtools_profiler_core/test/fixtures/profiled_app/bin/quick_exit.dart`:
- Around line 5-6: Replace the large numeric literals in the hot loop that
updates `state` with digit-separated forms to improve readability: change the
loop limit `10000` to `10_000`, the multiplier `1664525` to `1_664_525`, and the
mask `0x7fffffff` to `0x7fff_ffff` in the assignment expression inside the for
loop that uses `i` and `state`.

In
`@packages/devtools_profiler_core/test/fixtures/profiled_app/bin/quick_worker_isolate.dart`:
- Around line 13-14: The numeric literals in the PRNG loop (the for-loop using
variable i and the state update in quick_worker_isolate.dart) are hard to read;
replace 10000 with 10_000, 1664525 with 1_664_525, and format the hex mask
0x7fffffff as 0x7fff_ffff to use digit separators and improve readability in the
expression "state = ((state * 1664525) + i) & 0x7fffffff;" inside that loop.

In `@packages/devtools_profiler_core/test/profile_runner_test.dart`:
- Line 234: Replace the numeric literal used as the threshold in the assertion
so it's easier to read: update the call to greaterThan(...) that checks
result.overallProfile!.durationMicros to use a digit-separated literal (300_000)
instead of 300000 so the test reads and follows the project's numeric formatting
guidelines.

In `@README.md`:
- Around line 66-70: The README currently says bare .dart files are supported
earlier but the "Current Limits" section still requires launched commands to
start with `dart` or `flutter`; update the "Current Limits" section text to
reflect that bare `.dart` files are allowed (i.e., launched commands may be
either `dart <file>`, `flutter <command>`, or simply `<file>.dart`), removing or
rewording the line that enforces commands must start with `dart` or `flutter` so
the two sections are consistent. Make sure any examples or bullet points in the
"Current Limits" block mention using profiler options before the target command
and using `--` when the target has its own options, matching the earlier
paragraph.
🪄 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: ASSERTIVE

Plan: Pro

Run ID: 90b17dbc-1e68-4348-8577-5f6989f0575a

📥 Commits

Reviewing files that changed from the base of the PR and between a231848 and d13baa2.

📒 Files selected for processing (17)
  • README.md
  • packages/devtools_profiler_cli/CHANGELOG.md
  • packages/devtools_profiler_cli/README.md
  • packages/devtools_profiler_cli/lib/src/cli/commands/capture_commands.dart
  • packages/devtools_profiler_cli/pubspec.yaml
  • packages/devtools_profiler_cli/test/cli_test.dart
  • packages/devtools_profiler_core/CHANGELOG.md
  • packages/devtools_profiler_core/README.md
  • packages/devtools_profiler_core/lib/src/capture/profile_run_request.dart
  • packages/devtools_profiler_core/lib/src/capture/profile_runner.dart
  • packages/devtools_profiler_core/lib/src/capture/runner/process_launch.dart
  • packages/devtools_profiler_core/lib/src/capture/runner/profile_session_controller.dart
  • packages/devtools_profiler_core/lib/src/capture/runner/profile_session_vm_hookup.dart
  • packages/devtools_profiler_core/pubspec.yaml
  • packages/devtools_profiler_core/test/fixtures/profiled_app/bin/quick_exit.dart
  • packages/devtools_profiler_core/test/fixtures/profiled_app/bin/quick_worker_isolate.dart
  • packages/devtools_profiler_core/test/profile_runner_test.dart
📜 Review details
🧰 Additional context used
📓 Path-based instructions (7)
packages/devtools_profiler_**/pubspec.yaml

📄 CodeRabbit inference engine (AGENTS.md)

packages/devtools_profiler_**/pubspec.yaml: Do not add Flutter UI, web UI, or browser-only runtime dependencies to the profiler packages
Use hosted devtools_shared for shared VM and memory models; do not vendor package trees into this workspace

Files:

  • packages/devtools_profiler_core/pubspec.yaml
  • packages/devtools_profiler_cli/pubspec.yaml
packages/devtools_profiler_core/pubspec.yaml

📄 CodeRabbit inference engine (AGENTS.md)

devtools_profiler_core may depend on vm_service, dtd, and devtools_shared

Files:

  • packages/devtools_profiler_core/pubspec.yaml
**/*.dart

📄 CodeRabbit inference engine (AGENTS.md)

**/*.dart: Follow idiomatic Dart and keep code easy to scan in split-screen views
Prefer multi-line strings over string concatenation for large text blocks, command output fixtures, JSON examples, and terminal snapshots
Keep lines near 80 characters where practical. Long identifiers and URLs may exceed that when wrapping would make the code harder to read
Use records for short-lived grouped return values instead of introducing one-off classes
Use patterns, if-case, and switch expressions when they make parsing or dispatch logic clearer
Use class modifiers such as sealed, final, base, and interface when they describe the intended inheritance boundary
Use digit separators for large numeric literals, for example timeouts, sample counts, and byte sizes
Use wildcard variables for intentionally unused callback parameters
Use null-aware collection elements when conditionally including nullable values in list or map literals
Use dot shorthands only when the inferred type is obvious from context
Use /// documentation comments for public APIs
Start doc comments with a short, single-sentence summary
Put a blank line after the first sentence when adding more detail in doc comments
Avoid repeating information that is already obvious from the declaration in documentation comments
Start method comments with third-person verbs, such as 'Returns', 'Starts', or 'Captures'
Start non-boolean property comments with a noun phrase
Start boolean property comments with 'Whether'
Use square brackets for in-scope identifiers, such as [ProfileRunRequest], [Duration], and [StateError]
Explain parameters, return values, and exceptions in prose rather than using tag-style documentation
Prefer fenced Markdown code blocks for examples in documentation comments
Keep Markdown simple; avoid HTML in documentation comments

Files:

  • packages/devtools_profiler_core/test/fixtures/profiled_app/bin/quick_worker_isolate.dart
  • packages/devtools_profiler_core/test/profile_runner_test.dart
  • packages/devtools_profiler_core/test/fixtures/profiled_app/bin/quick_exit.dart
  • packages/devtools_profiler_core/lib/src/capture/profile_run_request.dart
  • packages/devtools_profiler_cli/test/cli_test.dart
  • packages/devtools_profiler_cli/lib/src/cli/commands/capture_commands.dart
  • packages/devtools_profiler_core/lib/src/capture/runner/profile_session_controller.dart
  • packages/devtools_profiler_core/lib/src/capture/runner/process_launch.dart
  • packages/devtools_profiler_core/lib/src/capture/runner/profile_session_vm_hookup.dart
  • packages/devtools_profiler_core/lib/src/capture/profile_runner.dart
packages/devtools_profiler_*/**/*.dart

📄 CodeRabbit inference engine (AGENTS.md)

Consider documenting private helpers when they encode profiler behavior, artifact contracts, protocol semantics, or VM-service assumptions

Files:

  • packages/devtools_profiler_core/test/fixtures/profiled_app/bin/quick_worker_isolate.dart
  • packages/devtools_profiler_core/test/profile_runner_test.dart
  • packages/devtools_profiler_core/test/fixtures/profiled_app/bin/quick_exit.dart
  • packages/devtools_profiler_core/lib/src/capture/profile_run_request.dart
  • packages/devtools_profiler_cli/test/cli_test.dart
  • packages/devtools_profiler_cli/lib/src/cli/commands/capture_commands.dart
  • packages/devtools_profiler_core/lib/src/capture/runner/profile_session_controller.dart
  • packages/devtools_profiler_core/lib/src/capture/runner/process_launch.dart
  • packages/devtools_profiler_core/lib/src/capture/runner/profile_session_vm_hookup.dart
  • packages/devtools_profiler_core/lib/src/capture/profile_runner.dart
packages/devtools_profiler_cli/pubspec.yaml

📄 CodeRabbit inference engine (AGENTS.md)

packages/devtools_profiler_cli/pubspec.yaml: Keep dart_mcp on the supported ^0.5.0 line unless the user asks for an upgrade
devtools_profiler_cli may depend on terminal/MCP/presentation packages such as artisanal and dart_mcp

Files:

  • packages/devtools_profiler_cli/pubspec.yaml
packages/*/README.md

📄 CodeRabbit inference engine (AGENTS.md)

Package READMEs should explain how that package is used and how it fits into the profiler system. Prefer examples that agents can execute directly from the CLI

Files:

  • packages/devtools_profiler_core/README.md
  • packages/devtools_profiler_cli/README.md
README.md

📄 CodeRabbit inference engine (AGENTS.md)

Keep the root README.md end-user focused

Files:

  • README.md
🧠 Learnings (19)
📓 Common learnings
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to packages/devtools_profiler_cli/lib/**/command*.dart : Split large CLI commands into focused files instead of growing a monolithic command file
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Run formatting, analysis, and tests before handing work back using: dart format ., dart analyze ., and dart test on all profiler packages
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: `devtools_region_profiler` should stay small and safe to add to Dart or Flutter applications being profiled
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: For Flutter targets, remember that release mode, AOT builds, and browser/web targets do not expose the Dart VM service needed by this profiler
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to packages/devtools_profiler_cli/pubspec.yaml : `devtools_profiler_cli` may depend on terminal/MCP/presentation packages such as `artisanal` and `dart_mcp`
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to packages/devtools_profiler_cli/pubspec.yaml : Keep `dart_mcp` on the supported `^0.5.0` line unless the user asks for an upgrade
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to packages/devtools_profiler_**/pubspec.yaml : Do not add Flutter UI, web UI, or browser-only runtime dependencies to the profiler packages
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to packages/devtools_profiler_*/**/*.dart : Consider documenting private helpers when they encode profiler behavior, artifact contracts, protocol semantics, or VM-service assumptions
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to packages/devtools_profiler_core/pubspec.yaml : `devtools_profiler_core` may depend on `vm_service`, `dtd`, and `devtools_shared`
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to packages/devtools_profiler_**/pubspec.yaml : Use hosted `devtools_shared` for shared VM and memory models; do not vendor package trees into this workspace
📚 Learning: 2026-04-26T17:03:32.425Z
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to packages/devtools_profiler_*/**/*.dart : Consider documenting private helpers when they encode profiler behavior, artifact contracts, protocol semantics, or VM-service assumptions

Applied to files:

  • packages/devtools_profiler_cli/CHANGELOG.md
  • packages/devtools_profiler_core/pubspec.yaml
  • packages/devtools_profiler_core/CHANGELOG.md
  • packages/devtools_profiler_core/test/fixtures/profiled_app/bin/quick_worker_isolate.dart
  • packages/devtools_profiler_core/test/profile_runner_test.dart
  • packages/devtools_profiler_core/test/fixtures/profiled_app/bin/quick_exit.dart
  • packages/devtools_profiler_cli/pubspec.yaml
  • packages/devtools_profiler_core/README.md
  • packages/devtools_profiler_core/lib/src/capture/profile_run_request.dart
  • packages/devtools_profiler_cli/test/cli_test.dart
  • packages/devtools_profiler_cli/lib/src/cli/commands/capture_commands.dart
  • packages/devtools_profiler_core/lib/src/capture/runner/profile_session_controller.dart
  • packages/devtools_profiler_cli/README.md
  • packages/devtools_profiler_core/lib/src/capture/runner/process_launch.dart
  • packages/devtools_profiler_core/lib/src/capture/runner/profile_session_vm_hookup.dart
  • packages/devtools_profiler_core/lib/src/capture/profile_runner.dart
  • README.md
📚 Learning: 2026-04-26T17:03:32.425Z
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to packages/devtools_profiler_cli/lib/**/command*.dart : Split large CLI commands into focused files instead of growing a monolithic command file

Applied to files:

  • packages/devtools_profiler_cli/CHANGELOG.md
  • packages/devtools_profiler_core/pubspec.yaml
  • packages/devtools_profiler_core/CHANGELOG.md
  • packages/devtools_profiler_core/test/fixtures/profiled_app/bin/quick_worker_isolate.dart
  • packages/devtools_profiler_core/test/fixtures/profiled_app/bin/quick_exit.dart
  • packages/devtools_profiler_cli/pubspec.yaml
  • packages/devtools_profiler_core/README.md
  • packages/devtools_profiler_core/lib/src/capture/profile_run_request.dart
  • packages/devtools_profiler_cli/test/cli_test.dart
  • packages/devtools_profiler_cli/lib/src/cli/commands/capture_commands.dart
  • packages/devtools_profiler_cli/README.md
  • packages/devtools_profiler_core/lib/src/capture/runner/process_launch.dart
  • packages/devtools_profiler_core/lib/src/capture/profile_runner.dart
  • README.md
📚 Learning: 2026-04-26T17:03:32.425Z
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to packages/devtools_profiler_cli/pubspec.yaml : `devtools_profiler_cli` may depend on terminal/MCP/presentation packages such as `artisanal` and `dart_mcp`

Applied to files:

  • packages/devtools_profiler_cli/CHANGELOG.md
  • packages/devtools_profiler_core/pubspec.yaml
  • packages/devtools_profiler_core/CHANGELOG.md
  • packages/devtools_profiler_core/test/fixtures/profiled_app/bin/quick_exit.dart
  • packages/devtools_profiler_cli/pubspec.yaml
  • packages/devtools_profiler_core/README.md
  • packages/devtools_profiler_core/lib/src/capture/profile_run_request.dart
  • packages/devtools_profiler_cli/test/cli_test.dart
  • packages/devtools_profiler_cli/lib/src/cli/commands/capture_commands.dart
  • packages/devtools_profiler_cli/README.md
  • packages/devtools_profiler_core/lib/src/capture/runner/process_launch.dart
  • README.md
📚 Learning: 2026-04-26T17:03:32.425Z
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to packages/devtools_profiler_cli/pubspec.yaml : Keep `dart_mcp` on the supported `^0.5.0` line unless the user asks for an upgrade

Applied to files:

  • packages/devtools_profiler_cli/CHANGELOG.md
  • packages/devtools_profiler_core/pubspec.yaml
  • packages/devtools_profiler_core/CHANGELOG.md
  • packages/devtools_profiler_cli/pubspec.yaml
  • packages/devtools_profiler_core/README.md
  • packages/devtools_profiler_core/lib/src/capture/profile_run_request.dart
  • packages/devtools_profiler_cli/test/cli_test.dart
  • packages/devtools_profiler_cli/lib/src/cli/commands/capture_commands.dart
  • packages/devtools_profiler_cli/README.md
  • packages/devtools_profiler_core/lib/src/capture/runner/process_launch.dart
  • packages/devtools_profiler_core/lib/src/capture/profile_runner.dart
  • README.md
📚 Learning: 2026-04-26T17:03:32.425Z
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: `devtools_region_profiler` should stay small and safe to add to Dart or Flutter applications being profiled

Applied to files:

  • packages/devtools_profiler_cli/CHANGELOG.md
  • packages/devtools_profiler_core/pubspec.yaml
  • packages/devtools_profiler_core/CHANGELOG.md
  • packages/devtools_profiler_core/test/fixtures/profiled_app/bin/quick_worker_isolate.dart
  • packages/devtools_profiler_core/test/profile_runner_test.dart
  • packages/devtools_profiler_core/test/fixtures/profiled_app/bin/quick_exit.dart
  • packages/devtools_profiler_cli/pubspec.yaml
  • packages/devtools_profiler_core/README.md
  • packages/devtools_profiler_cli/README.md
  • packages/devtools_profiler_core/lib/src/capture/runner/profile_session_vm_hookup.dart
  • packages/devtools_profiler_core/lib/src/capture/profile_runner.dart
  • README.md
📚 Learning: 2026-04-26T17:03:32.425Z
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to packages/devtools_profiler_**/pubspec.yaml : Do not add Flutter UI, web UI, or browser-only runtime dependencies to the profiler packages

Applied to files:

  • packages/devtools_profiler_cli/CHANGELOG.md
  • packages/devtools_profiler_core/pubspec.yaml
  • packages/devtools_profiler_core/CHANGELOG.md
  • packages/devtools_profiler_core/test/profile_runner_test.dart
  • packages/devtools_profiler_core/test/fixtures/profiled_app/bin/quick_exit.dart
  • packages/devtools_profiler_cli/pubspec.yaml
  • packages/devtools_profiler_core/README.md
  • packages/devtools_profiler_core/lib/src/capture/profile_run_request.dart
  • packages/devtools_profiler_cli/test/cli_test.dart
  • packages/devtools_profiler_cli/lib/src/cli/commands/capture_commands.dart
  • packages/devtools_profiler_cli/README.md
  • packages/devtools_profiler_core/lib/src/capture/runner/process_launch.dart
  • packages/devtools_profiler_core/lib/src/capture/profile_runner.dart
  • README.md
📚 Learning: 2026-04-26T17:03:32.425Z
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to packages/devtools_profiler_core/pubspec.yaml : `devtools_profiler_core` may depend on `vm_service`, `dtd`, and `devtools_shared`

Applied to files:

  • packages/devtools_profiler_cli/CHANGELOG.md
  • packages/devtools_profiler_core/pubspec.yaml
  • packages/devtools_profiler_core/CHANGELOG.md
  • packages/devtools_profiler_cli/pubspec.yaml
  • packages/devtools_profiler_core/README.md
  • packages/devtools_profiler_core/lib/src/capture/runner/profile_session_controller.dart
  • packages/devtools_profiler_cli/README.md
  • packages/devtools_profiler_core/lib/src/capture/runner/profile_session_vm_hookup.dart
  • packages/devtools_profiler_core/lib/src/capture/profile_runner.dart
📚 Learning: 2026-04-26T17:03:32.425Z
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to packages/devtools_profiler_**/pubspec.yaml : Use hosted `devtools_shared` for shared VM and memory models; do not vendor package trees into this workspace

Applied to files:

  • packages/devtools_profiler_cli/CHANGELOG.md
  • packages/devtools_profiler_core/pubspec.yaml
  • packages/devtools_profiler_core/CHANGELOG.md
  • packages/devtools_profiler_core/test/fixtures/profiled_app/bin/quick_worker_isolate.dart
  • packages/devtools_profiler_cli/pubspec.yaml
  • packages/devtools_profiler_core/README.md
  • packages/devtools_profiler_cli/README.md
  • packages/devtools_profiler_core/lib/src/capture/runner/profile_session_vm_hookup.dart
📚 Learning: 2026-04-26T17:03:32.425Z
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: For Flutter targets, remember that release mode, AOT builds, and browser/web targets do not expose the Dart VM service needed by this profiler

Applied to files:

  • packages/devtools_profiler_cli/CHANGELOG.md
  • packages/devtools_profiler_core/pubspec.yaml
  • packages/devtools_profiler_core/test/profile_runner_test.dart
  • packages/devtools_profiler_cli/pubspec.yaml
  • packages/devtools_profiler_core/README.md
  • packages/devtools_profiler_core/lib/src/capture/runner/profile_session_controller.dart
  • packages/devtools_profiler_cli/README.md
  • packages/devtools_profiler_core/lib/src/capture/runner/profile_session_vm_hookup.dart
  • packages/devtools_profiler_core/lib/src/capture/profile_runner.dart
  • README.md
📚 Learning: 2026-04-26T17:03:32.425Z
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Run formatting, analysis, and tests before handing work back using: dart format ., dart analyze ., and dart test on all profiler packages

Applied to files:

  • packages/devtools_profiler_cli/CHANGELOG.md
  • packages/devtools_profiler_core/pubspec.yaml
  • packages/devtools_profiler_core/test/fixtures/profiled_app/bin/quick_worker_isolate.dart
  • packages/devtools_profiler_core/test/profile_runner_test.dart
  • packages/devtools_profiler_core/test/fixtures/profiled_app/bin/quick_exit.dart
  • packages/devtools_profiler_cli/pubspec.yaml
  • packages/devtools_profiler_core/README.md
  • packages/devtools_profiler_cli/test/cli_test.dart
  • packages/devtools_profiler_cli/lib/src/cli/commands/capture_commands.dart
  • packages/devtools_profiler_cli/README.md
  • packages/devtools_profiler_core/lib/src/capture/runner/process_launch.dart
  • packages/devtools_profiler_core/lib/src/capture/profile_runner.dart
  • README.md
📚 Learning: 2026-04-26T17:03:32.425Z
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to **/*.dart : Start doc comments with a short, single-sentence summary

Applied to files:

  • packages/devtools_profiler_core/README.md
  • packages/devtools_profiler_core/lib/src/capture/profile_run_request.dart
  • packages/devtools_profiler_cli/README.md
  • README.md
📚 Learning: 2026-04-26T17:03:32.425Z
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to **/*.dart : Use square brackets for in-scope identifiers, such as [ProfileRunRequest], [Duration], and [StateError]

Applied to files:

  • packages/devtools_profiler_core/lib/src/capture/profile_run_request.dart
  • packages/devtools_profiler_cli/lib/src/cli/commands/capture_commands.dart
  • packages/devtools_profiler_core/lib/src/capture/runner/process_launch.dart
  • packages/devtools_profiler_core/lib/src/capture/profile_runner.dart
📚 Learning: 2026-04-26T17:03:32.425Z
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to **/*.dart : Explain parameters, return values, and exceptions in prose rather than using tag-style documentation

Applied to files:

  • packages/devtools_profiler_core/lib/src/capture/profile_run_request.dart
  • packages/devtools_profiler_cli/lib/src/cli/commands/capture_commands.dart
  • packages/devtools_profiler_cli/README.md
  • README.md
📚 Learning: 2026-04-26T17:03:32.425Z
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to **/*.dart : Avoid repeating information that is already obvious from the declaration in documentation comments

Applied to files:

  • packages/devtools_profiler_core/lib/src/capture/profile_run_request.dart
📚 Learning: 2026-04-26T17:03:32.425Z
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to **/*.dart : Use `///` documentation comments for public APIs

Applied to files:

  • packages/devtools_profiler_core/lib/src/capture/profile_run_request.dart
📚 Learning: 2026-04-26T17:03:32.425Z
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to **/*.dart : Prefer multi-line strings over string concatenation for large text blocks, command output fixtures, JSON examples, and terminal snapshots

Applied to files:

  • packages/devtools_profiler_cli/test/cli_test.dart
  • packages/devtools_profiler_cli/lib/src/cli/commands/capture_commands.dart
  • packages/devtools_profiler_cli/README.md
  • README.md
📚 Learning: 2026-04-26T17:03:32.425Z
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to **/*.dart : Start method comments with third-person verbs, such as 'Returns', 'Starts', or 'Captures'

Applied to files:

  • packages/devtools_profiler_cli/lib/src/cli/commands/capture_commands.dart
📚 Learning: 2026-04-26T17:03:32.425Z
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to packages/*/README.md : Package READMEs should explain how that package is used and how it fits into the profiler system. Prefer examples that agents can execute directly from the CLI

Applied to files:

  • packages/devtools_profiler_cli/README.md
  • README.md
🔇 Additional comments (12)
packages/devtools_profiler_core/pubspec.yaml (1)

5-5: Version bump looks consistent.

0.2.1-wip aligns with the rest of this PR’s unreleased package updates.

packages/devtools_profiler_cli/CHANGELOG.md (1)

3-9: Changelog entry is clear and aligned with behavior changes.

The new 0.2.1-wip bullets accurately describe both the Dart file shorthand and exit-pause capture improvement.

packages/devtools_profiler_core/CHANGELOG.md (1)

3-9: Core changelog update looks good.

The release note succinctly captures both command normalization and short-lived isolate finalization behavior.

packages/devtools_profiler_cli/test/cli_test.dart (1)

31-33: Help-output expectations were updated correctly.

These assertions now validate both the [--] separator form and the new run <file>.dart shorthand example.

Also applies to: 36-36

packages/devtools_profiler_cli/pubspec.yaml (1)

5-5: Package version and core dependency bump are consistent.

This keeps CLI and core on the same 0.2.1-wip track without violating the supported dependency constraints.

Also applies to: 20-20

packages/devtools_profiler_core/lib/src/capture/profile_run_request.dart (1)

4-5: Documentation update is accurate and helpful.

The new wording for command now reflects the supported bare Dart file input and its expansion behavior.

Also applies to: 23-23

packages/devtools_profiler_core/test/profile_runner_test.dart (1)

187-214: Strong regression coverage for quick-exit bare Dart runs.

This test validates both command normalization and the absence of the previous disposed-service warning path.

packages/devtools_profiler_cli/lib/src/cli/commands/capture_commands.dart (1)

53-75: Help text now matches the new shorthand cleanly.

The updated invocation, examples, and missing-target error all line up with bare-file expansion and the -- disambiguation rules.

packages/devtools_profiler_core/lib/src/capture/runner/profile_session_controller.dart (1)

86-102: Nice controller-level façade for exit-pause handling.

Keeping ProfileRunner on controller APIs instead of reaching into ProfileSessionVmHookup directly preserves the session boundary and makes the shutdown flow easier to test.

packages/devtools_profiler_core/lib/src/capture/runner/process_launch.dart (1)

107-128: Centralizing bare-file normalization here is a good move.

Rewriting the shorthand once and then reusing the normalized command for validation and launch keeps the CLI and core behavior aligned.

packages/devtools_profiler_core/lib/src/capture/runner/profile_session_vm_hookup.dart (2)

145-158: Resuming paused isolates is fault-tolerant

Snapshotting IDs before iteration and handling per-isolate resume failures avoids partial-progress loss when isolates disappear during shutdown.


186-186: Good lifecycle cleanup for debug monitoring

Canceling _debugSubscription in dispose() prevents dangling debug-stream listeners.

Comment thread packages/devtools_profiler_core/lib/src/capture/profile_runner.dart
Comment thread packages/devtools_profiler_core/lib/src/capture/profile_runner.dart Outdated
Comment thread packages/devtools_profiler_core/test/fixtures/profiled_app/bin/quick_exit.dart Outdated
Comment thread packages/devtools_profiler_core/test/profile_runner_test.dart Outdated
Comment thread README.md

@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 the current code and only fix it if needed.

Inline comments:
In `@packages/devtools_profiler_core/lib/src/capture/profile_runner.dart`:
- Around line 129-142: The code incorrectly sets processExited = true even when
_resumeExitPausedProcess() may return a synthetic exit (e.g., timeout fallback),
which prevents cleanup; update _resumeExitPausedProcess (or its call contract)
to return a sentinel or boolean indicating whether the real process exit was
observed (for example return null or a tuple/flag when fallback used), then in
the paused-at-exit branch use that returned signal to set processExited only
when the real exit was observed; keep processExited false when the fallback path
produced the synthetic exitCode so the finally block will perform cleanup and
not leave the child running; ensure callers still capture exitCode via
exitCodeFuture and that sessionController.handleProcessExit() is still awaited
as before.

In
`@packages/devtools_profiler_core/test/fixtures/profiled_app/bin/quick_worker_isolate.dart`:
- Around line 5-8: The worker isolate currently sends one message and exits
immediately (ReceivePort workerDone / Isolate.spawn(_worker,
workerDone.sendPort)), so the test doesn't exercise the "wait for all isolates
paused at exit" path; modify the worker/_worker logic to hold the spawned
isolate open by keeping a dedicated control ReceivePort/SendPort (e.g.,
workerControlPort) that the main isolate closes/signals only when main is
finishing, and change the main test to spawn the isolate, wait for the initial
ready message as now, but do not close workerControlPort or send the shutdown
signal until after main signals completion (apply the same change to the other
occurrence on lines 23-24) so the worker stays alive until process shutdown.
🪄 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: ASSERTIVE

Plan: Pro

Run ID: ef917738-17d5-4b76-b84f-96c5ca26b505

📥 Commits

Reviewing files that changed from the base of the PR and between d13baa2 and cea9239.

📒 Files selected for processing (7)
  • README.md
  • packages/devtools_profiler_core/lib/src/capture/profile_runner.dart
  • packages/devtools_profiler_core/lib/src/capture/runner/profile_session_controller.dart
  • packages/devtools_profiler_core/lib/src/capture/runner/profile_session_vm_hookup.dart
  • packages/devtools_profiler_core/test/fixtures/profiled_app/bin/quick_exit.dart
  • packages/devtools_profiler_core/test/fixtures/profiled_app/bin/quick_worker_isolate.dart
  • packages/devtools_profiler_core/test/profile_runner_test.dart
📜 Review details
🧰 Additional context used
📓 Path-based instructions (3)
**/*.dart

📄 CodeRabbit inference engine (AGENTS.md)

**/*.dart: Follow idiomatic Dart and keep code easy to scan in split-screen views
Prefer multi-line strings over string concatenation for large text blocks, command output fixtures, JSON examples, and terminal snapshots
Keep lines near 80 characters where practical. Long identifiers and URLs may exceed that when wrapping would make the code harder to read
Use records for short-lived grouped return values instead of introducing one-off classes
Use patterns, if-case, and switch expressions when they make parsing or dispatch logic clearer
Use class modifiers such as sealed, final, base, and interface when they describe the intended inheritance boundary
Use digit separators for large numeric literals, for example timeouts, sample counts, and byte sizes
Use wildcard variables for intentionally unused callback parameters
Use null-aware collection elements when conditionally including nullable values in list or map literals
Use dot shorthands only when the inferred type is obvious from context
Use /// documentation comments for public APIs
Start doc comments with a short, single-sentence summary
Put a blank line after the first sentence when adding more detail in doc comments
Avoid repeating information that is already obvious from the declaration in documentation comments
Start method comments with third-person verbs, such as 'Returns', 'Starts', or 'Captures'
Start non-boolean property comments with a noun phrase
Start boolean property comments with 'Whether'
Use square brackets for in-scope identifiers, such as [ProfileRunRequest], [Duration], and [StateError]
Explain parameters, return values, and exceptions in prose rather than using tag-style documentation
Prefer fenced Markdown code blocks for examples in documentation comments
Keep Markdown simple; avoid HTML in documentation comments

Files:

  • packages/devtools_profiler_core/test/fixtures/profiled_app/bin/quick_exit.dart
  • packages/devtools_profiler_core/test/fixtures/profiled_app/bin/quick_worker_isolate.dart
  • packages/devtools_profiler_core/test/profile_runner_test.dart
  • packages/devtools_profiler_core/lib/src/capture/runner/profile_session_controller.dart
  • packages/devtools_profiler_core/lib/src/capture/profile_runner.dart
  • packages/devtools_profiler_core/lib/src/capture/runner/profile_session_vm_hookup.dart
packages/devtools_profiler_*/**/*.dart

📄 CodeRabbit inference engine (AGENTS.md)

Consider documenting private helpers when they encode profiler behavior, artifact contracts, protocol semantics, or VM-service assumptions

Files:

  • packages/devtools_profiler_core/test/fixtures/profiled_app/bin/quick_exit.dart
  • packages/devtools_profiler_core/test/fixtures/profiled_app/bin/quick_worker_isolate.dart
  • packages/devtools_profiler_core/test/profile_runner_test.dart
  • packages/devtools_profiler_core/lib/src/capture/runner/profile_session_controller.dart
  • packages/devtools_profiler_core/lib/src/capture/profile_runner.dart
  • packages/devtools_profiler_core/lib/src/capture/runner/profile_session_vm_hookup.dart
README.md

📄 CodeRabbit inference engine (AGENTS.md)

Keep the root README.md end-user focused

Files:

  • README.md
🧠 Learnings (22)
📓 Common learnings
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to packages/devtools_profiler_cli/lib/**/command*.dart : Split large CLI commands into focused files instead of growing a monolithic command file
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Run formatting, analysis, and tests before handing work back using: dart format ., dart analyze ., and dart test on all profiler packages
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: `devtools_region_profiler` should stay small and safe to add to Dart or Flutter applications being profiled
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: For Flutter targets, remember that release mode, AOT builds, and browser/web targets do not expose the Dart VM service needed by this profiler
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to packages/devtools_profiler_cli/pubspec.yaml : `devtools_profiler_cli` may depend on terminal/MCP/presentation packages such as `artisanal` and `dart_mcp`
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to packages/devtools_profiler_*/**/*.dart : Consider documenting private helpers when they encode profiler behavior, artifact contracts, protocol semantics, or VM-service assumptions
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to packages/devtools_profiler_**/pubspec.yaml : Do not add Flutter UI, web UI, or browser-only runtime dependencies to the profiler packages
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to packages/devtools_profiler_core/pubspec.yaml : `devtools_profiler_core` may depend on `vm_service`, `dtd`, and `devtools_shared`
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to packages/devtools_profiler_cli/pubspec.yaml : Keep `dart_mcp` on the supported `^0.5.0` line unless the user asks for an upgrade
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to packages/devtools_profiler_**/pubspec.yaml : Use hosted `devtools_shared` for shared VM and memory models; do not vendor package trees into this workspace
📚 Learning: 2026-04-26T17:03:32.425Z
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: `devtools_region_profiler` should stay small and safe to add to Dart or Flutter applications being profiled

Applied to files:

  • packages/devtools_profiler_core/test/fixtures/profiled_app/bin/quick_exit.dart
  • packages/devtools_profiler_core/test/profile_runner_test.dart
  • README.md
📚 Learning: 2026-04-26T17:03:32.425Z
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to packages/devtools_profiler_*/**/*.dart : Consider documenting private helpers when they encode profiler behavior, artifact contracts, protocol semantics, or VM-service assumptions

Applied to files:

  • packages/devtools_profiler_core/test/fixtures/profiled_app/bin/quick_exit.dart
  • packages/devtools_profiler_core/test/fixtures/profiled_app/bin/quick_worker_isolate.dart
  • packages/devtools_profiler_core/test/profile_runner_test.dart
  • packages/devtools_profiler_core/lib/src/capture/runner/profile_session_controller.dart
  • packages/devtools_profiler_core/lib/src/capture/profile_runner.dart
  • packages/devtools_profiler_core/lib/src/capture/runner/profile_session_vm_hookup.dart
  • README.md
📚 Learning: 2026-04-26T17:03:32.425Z
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to **/*.dart : Use digit separators for large numeric literals, for example timeouts, sample counts, and byte sizes

Applied to files:

  • packages/devtools_profiler_core/test/fixtures/profiled_app/bin/quick_exit.dart
  • packages/devtools_profiler_core/test/fixtures/profiled_app/bin/quick_worker_isolate.dart
  • packages/devtools_profiler_core/test/profile_runner_test.dart
📚 Learning: 2026-04-26T17:03:32.425Z
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to **/*.dart : Prefer multi-line strings over string concatenation for large text blocks, command output fixtures, JSON examples, and terminal snapshots

Applied to files:

  • packages/devtools_profiler_core/test/fixtures/profiled_app/bin/quick_exit.dart
  • packages/devtools_profiler_core/test/fixtures/profiled_app/bin/quick_worker_isolate.dart
  • packages/devtools_profiler_core/test/profile_runner_test.dart
  • README.md
📚 Learning: 2026-04-26T17:03:32.425Z
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to **/*.dart : Use square brackets for in-scope identifiers, such as [ProfileRunRequest], [Duration], and [StateError]

Applied to files:

  • packages/devtools_profiler_core/test/fixtures/profiled_app/bin/quick_exit.dart
  • packages/devtools_profiler_core/test/profile_runner_test.dart
  • packages/devtools_profiler_core/lib/src/capture/profile_runner.dart
📚 Learning: 2026-04-26T17:03:32.425Z
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Run formatting, analysis, and tests before handing work back using: dart format ., dart analyze ., and dart test on all profiler packages

Applied to files:

  • packages/devtools_profiler_core/test/fixtures/profiled_app/bin/quick_worker_isolate.dart
  • packages/devtools_profiler_core/test/profile_runner_test.dart
  • README.md
📚 Learning: 2026-04-26T17:03:32.425Z
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to packages/devtools_profiler_**/pubspec.yaml : Do not add Flutter UI, web UI, or browser-only runtime dependencies to the profiler packages

Applied to files:

  • packages/devtools_profiler_core/test/profile_runner_test.dart
  • README.md
📚 Learning: 2026-04-26T17:03:32.425Z
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to packages/devtools_profiler_cli/lib/**/command*.dart : Split large CLI commands into focused files instead of growing a monolithic command file

Applied to files:

  • packages/devtools_profiler_core/test/profile_runner_test.dart
  • packages/devtools_profiler_core/lib/src/capture/profile_runner.dart
  • README.md
📚 Learning: 2026-04-26T17:03:32.425Z
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to **/*.dart : Keep lines near 80 characters where practical. Long identifiers and URLs may exceed that when wrapping would make the code harder to read

Applied to files:

  • packages/devtools_profiler_core/test/profile_runner_test.dart
  • README.md
📚 Learning: 2026-04-26T17:03:32.425Z
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: For Flutter targets, remember that release mode, AOT builds, and browser/web targets do not expose the Dart VM service needed by this profiler

Applied to files:

  • packages/devtools_profiler_core/test/profile_runner_test.dart
  • packages/devtools_profiler_core/lib/src/capture/profile_runner.dart
  • packages/devtools_profiler_core/lib/src/capture/runner/profile_session_vm_hookup.dart
  • README.md
📚 Learning: 2026-04-26T17:03:32.425Z
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to packages/devtools_profiler_core/pubspec.yaml : `devtools_profiler_core` may depend on `vm_service`, `dtd`, and `devtools_shared`

Applied to files:

  • packages/devtools_profiler_core/lib/src/capture/runner/profile_session_controller.dart
  • packages/devtools_profiler_core/lib/src/capture/runner/profile_session_vm_hookup.dart
📚 Learning: 2026-04-26T17:03:32.425Z
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to **/*.dart : Use `///` documentation comments for public APIs

Applied to files:

  • packages/devtools_profiler_core/lib/src/capture/profile_runner.dart
  • README.md
📚 Learning: 2026-04-26T17:03:32.425Z
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to **/*.dart : Start doc comments with a short, single-sentence summary

Applied to files:

  • packages/devtools_profiler_core/lib/src/capture/profile_runner.dart
  • README.md
📚 Learning: 2026-04-26T17:03:32.425Z
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to **/*.dart : Explain parameters, return values, and exceptions in prose rather than using tag-style documentation

Applied to files:

  • packages/devtools_profiler_core/lib/src/capture/profile_runner.dart
  • README.md
📚 Learning: 2026-04-26T17:03:32.425Z
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to **/*.dart : Put a blank line after the first sentence when adding more detail in doc comments

Applied to files:

  • packages/devtools_profiler_core/lib/src/capture/profile_runner.dart
  • README.md
📚 Learning: 2026-04-26T17:03:32.425Z
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to **/*.dart : Avoid repeating information that is already obvious from the declaration in documentation comments

Applied to files:

  • packages/devtools_profiler_core/lib/src/capture/profile_runner.dart
  • README.md
📚 Learning: 2026-04-26T17:03:32.425Z
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to **/*.dart : Start method comments with third-person verbs, such as 'Returns', 'Starts', or 'Captures'

Applied to files:

  • packages/devtools_profiler_core/lib/src/capture/profile_runner.dart
  • README.md
📚 Learning: 2026-04-26T17:03:32.425Z
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to packages/devtools_profiler_cli/pubspec.yaml : Keep `dart_mcp` on the supported `^0.5.0` line unless the user asks for an upgrade

Applied to files:

  • README.md
📚 Learning: 2026-04-26T17:03:32.425Z
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to **/*.dart : Follow idiomatic Dart and keep code easy to scan in split-screen views

Applied to files:

  • README.md
📚 Learning: 2026-04-26T17:03:32.425Z
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to **/*.dart : Keep Markdown simple; avoid HTML in documentation comments

Applied to files:

  • README.md
📚 Learning: 2026-04-26T17:03:32.425Z
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to packages/devtools_profiler_cli/pubspec.yaml : `devtools_profiler_cli` may depend on terminal/MCP/presentation packages such as `artisanal` and `dart_mcp`

Applied to files:

  • README.md

Comment thread packages/devtools_profiler_core/lib/src/capture/profile_runner.dart 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: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/devtools_profiler_core/lib/src/capture/profile_runner.dart`:
- Around line 331-359: The loop currently polls every 50ms and calls
sessionController.recordCurrentlyPausedExitIsolates() on every tick, causing
profiler-side work for the entire run; change the loop so the tight 50ms poll is
not always active: only enable frequent polling when listenForExitPauseSignal is
true or when the runner is in the shutdown path (e.g., after exitCompletion
completes), otherwise either remove the small fixed delay from the Future.any
set or replace it with an exponential/backoff timer (starting at 50ms and
growing to a few seconds) before calling
sessionController.recordCurrentlyPausedExitIsolates(); adjust the logic around
exitPause, exitCompletion and _ProfiledProcessCompletionKind so that
pausedAtExit is still detected but the frequent
sessionController.recordCurrentlyPausedExitIsolates() calls are gated/backed
off.
🪄 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: ASSERTIVE

Plan: Pro

Run ID: 01861799-091c-41e2-811a-382c8f206995

📥 Commits

Reviewing files that changed from the base of the PR and between cea9239 and a442cba.

📒 Files selected for processing (3)
  • packages/devtools_profiler_core/lib/src/capture/profile_runner.dart
  • packages/devtools_profiler_core/test/fixtures/profiled_app/bin/quick_worker_isolate.dart
  • skills/devtools-profiler-local/SKILL.md
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Test packages/devtools_profiler_core
🧰 Additional context used
📓 Path-based instructions (2)
**/*.dart

📄 CodeRabbit inference engine (AGENTS.md)

**/*.dart: Follow idiomatic Dart and keep code easy to scan in split-screen views
Prefer multi-line strings over string concatenation for large text blocks, command output fixtures, JSON examples, and terminal snapshots
Keep lines near 80 characters where practical. Long identifiers and URLs may exceed that when wrapping would make the code harder to read
Use records for short-lived grouped return values instead of introducing one-off classes
Use patterns, if-case, and switch expressions when they make parsing or dispatch logic clearer
Use class modifiers such as sealed, final, base, and interface when they describe the intended inheritance boundary
Use digit separators for large numeric literals, for example timeouts, sample counts, and byte sizes
Use wildcard variables for intentionally unused callback parameters
Use null-aware collection elements when conditionally including nullable values in list or map literals
Use dot shorthands only when the inferred type is obvious from context
Use /// documentation comments for public APIs
Start doc comments with a short, single-sentence summary
Put a blank line after the first sentence when adding more detail in doc comments
Avoid repeating information that is already obvious from the declaration in documentation comments
Start method comments with third-person verbs, such as 'Returns', 'Starts', or 'Captures'
Start non-boolean property comments with a noun phrase
Start boolean property comments with 'Whether'
Use square brackets for in-scope identifiers, such as [ProfileRunRequest], [Duration], and [StateError]
Explain parameters, return values, and exceptions in prose rather than using tag-style documentation
Prefer fenced Markdown code blocks for examples in documentation comments
Keep Markdown simple; avoid HTML in documentation comments

Files:

  • packages/devtools_profiler_core/test/fixtures/profiled_app/bin/quick_worker_isolate.dart
  • packages/devtools_profiler_core/lib/src/capture/profile_runner.dart
packages/devtools_profiler_*/**/*.dart

📄 CodeRabbit inference engine (AGENTS.md)

Consider documenting private helpers when they encode profiler behavior, artifact contracts, protocol semantics, or VM-service assumptions

Files:

  • packages/devtools_profiler_core/test/fixtures/profiled_app/bin/quick_worker_isolate.dart
  • packages/devtools_profiler_core/lib/src/capture/profile_runner.dart
🧠 Learnings (21)
📓 Common learnings
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to packages/devtools_profiler_cli/lib/**/command*.dart : Split large CLI commands into focused files instead of growing a monolithic command file
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Run formatting, analysis, and tests before handing work back using: dart format ., dart analyze ., and dart test on all profiler packages
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to packages/devtools_profiler_*/**/*.dart : Consider documenting private helpers when they encode profiler behavior, artifact contracts, protocol semantics, or VM-service assumptions
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: `devtools_region_profiler` should stay small and safe to add to Dart or Flutter applications being profiled
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: For Flutter targets, remember that release mode, AOT builds, and browser/web targets do not expose the Dart VM service needed by this profiler
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to packages/devtools_profiler_core/pubspec.yaml : `devtools_profiler_core` may depend on `vm_service`, `dtd`, and `devtools_shared`
📚 Learning: 2026-04-26T17:03:32.425Z
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to packages/devtools_profiler_*/**/*.dart : Consider documenting private helpers when they encode profiler behavior, artifact contracts, protocol semantics, or VM-service assumptions

Applied to files:

  • packages/devtools_profiler_core/test/fixtures/profiled_app/bin/quick_worker_isolate.dart
  • skills/devtools-profiler-local/SKILL.md
  • packages/devtools_profiler_core/lib/src/capture/profile_runner.dart
📚 Learning: 2026-04-26T17:03:32.425Z
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Run formatting, analysis, and tests before handing work back using: dart format ., dart analyze ., and dart test on all profiler packages

Applied to files:

  • packages/devtools_profiler_core/test/fixtures/profiled_app/bin/quick_worker_isolate.dart
  • skills/devtools-profiler-local/SKILL.md
  • packages/devtools_profiler_core/lib/src/capture/profile_runner.dart
📚 Learning: 2026-04-26T17:03:32.425Z
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to **/*.dart : Use digit separators for large numeric literals, for example timeouts, sample counts, and byte sizes

Applied to files:

  • packages/devtools_profiler_core/test/fixtures/profiled_app/bin/quick_worker_isolate.dart
📚 Learning: 2026-04-26T17:03:32.425Z
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to **/*.dart : Prefer multi-line strings over string concatenation for large text blocks, command output fixtures, JSON examples, and terminal snapshots

Applied to files:

  • packages/devtools_profiler_core/test/fixtures/profiled_app/bin/quick_worker_isolate.dart
📚 Learning: 2026-04-26T17:03:32.425Z
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to packages/devtools_profiler_cli/lib/**/command*.dart : Split large CLI commands into focused files instead of growing a monolithic command file

Applied to files:

  • skills/devtools-profiler-local/SKILL.md
  • packages/devtools_profiler_core/lib/src/capture/profile_runner.dart
📚 Learning: 2026-04-26T17:03:32.425Z
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to **/*.dart : Start doc comments with a short, single-sentence summary

Applied to files:

  • skills/devtools-profiler-local/SKILL.md
  • packages/devtools_profiler_core/lib/src/capture/profile_runner.dart
📚 Learning: 2026-04-26T17:03:32.425Z
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to **/*.dart : Explain parameters, return values, and exceptions in prose rather than using tag-style documentation

Applied to files:

  • skills/devtools-profiler-local/SKILL.md
  • packages/devtools_profiler_core/lib/src/capture/profile_runner.dart
📚 Learning: 2026-04-26T17:03:32.425Z
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to packages/devtools_profiler_**/pubspec.yaml : Do not add Flutter UI, web UI, or browser-only runtime dependencies to the profiler packages

Applied to files:

  • skills/devtools-profiler-local/SKILL.md
📚 Learning: 2026-04-26T17:03:32.425Z
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: `devtools_region_profiler` should stay small and safe to add to Dart or Flutter applications being profiled

Applied to files:

  • skills/devtools-profiler-local/SKILL.md
📚 Learning: 2026-04-26T17:03:32.425Z
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to **/*.dart : Use square brackets for in-scope identifiers, such as [ProfileRunRequest], [Duration], and [StateError]

Applied to files:

  • skills/devtools-profiler-local/SKILL.md
  • packages/devtools_profiler_core/lib/src/capture/profile_runner.dart
📚 Learning: 2026-04-26T17:03:32.425Z
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to **/*.dart : Avoid repeating information that is already obvious from the declaration in documentation comments

Applied to files:

  • skills/devtools-profiler-local/SKILL.md
  • packages/devtools_profiler_core/lib/src/capture/profile_runner.dart
📚 Learning: 2026-04-26T17:03:32.425Z
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: For Flutter targets, remember that release mode, AOT builds, and browser/web targets do not expose the Dart VM service needed by this profiler

Applied to files:

  • skills/devtools-profiler-local/SKILL.md
📚 Learning: 2026-04-26T17:03:32.425Z
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to **/*.dart : Start method comments with third-person verbs, such as 'Returns', 'Starts', or 'Captures'

Applied to files:

  • skills/devtools-profiler-local/SKILL.md
📚 Learning: 2026-04-26T17:03:32.425Z
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to **/*.dart : Follow idiomatic Dart and keep code easy to scan in split-screen views

Applied to files:

  • skills/devtools-profiler-local/SKILL.md
📚 Learning: 2026-04-26T17:03:32.425Z
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to packages/devtools_profiler_**/pubspec.yaml : Use hosted `devtools_shared` for shared VM and memory models; do not vendor package trees into this workspace

Applied to files:

  • skills/devtools-profiler-local/SKILL.md
📚 Learning: 2026-04-26T17:03:32.425Z
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to packages/devtools_profiler_cli/pubspec.yaml : `devtools_profiler_cli` may depend on terminal/MCP/presentation packages such as `artisanal` and `dart_mcp`

Applied to files:

  • skills/devtools-profiler-local/SKILL.md
📚 Learning: 2026-04-26T17:03:32.425Z
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to **/*.dart : Use dot shorthands only when the inferred type is obvious from context

Applied to files:

  • skills/devtools-profiler-local/SKILL.md
📚 Learning: 2026-04-26T17:03:32.425Z
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to packages/devtools_profiler_cli/pubspec.yaml : Keep `dart_mcp` on the supported `^0.5.0` line unless the user asks for an upgrade

Applied to files:

  • skills/devtools-profiler-local/SKILL.md
📚 Learning: 2026-04-26T17:03:32.425Z
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to **/*.dart : Use `///` documentation comments for public APIs

Applied to files:

  • packages/devtools_profiler_core/lib/src/capture/profile_runner.dart
📚 Learning: 2026-04-26T17:03:32.425Z
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to **/*.dart : Put a blank line after the first sentence when adding more detail in doc comments

Applied to files:

  • packages/devtools_profiler_core/lib/src/capture/profile_runner.dart
🔇 Additional comments (2)
packages/devtools_profiler_core/test/fixtures/profiled_app/bin/quick_worker_isolate.dart (1)

4-44: This fixture now exercises the multi-isolate exit path.

The control-port handshake keeps the worker alive until main() is ready to stop it, so this regression meaningfully covers the "all isolates paused at exit" flow.

skills/devtools-profiler-local/SKILL.md (1)

59-93: Nice clarification of bare-file vs explicit dart run usage.

This matches the CLI contract in packages/devtools_profiler_cli/lib/src/cli/commands/capture_commands.dart:52-76 and should make -- usage much easier for users to get right.

Comment thread packages/devtools_profiler_core/lib/src/capture/profile_runner.dart

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

♻️ Duplicate comments (1)
packages/devtools_profiler_core/lib/src/capture/profile_runner.dart (1)

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

Don't let the final cleanup timeout degrade to a warning.

If the target ignores process.kill() or exits after the 2-second wait, this branch still disposes the session and returns control while the child may keep running. That can leave an orphaned profiled process behind.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 6aa52065-15b0-442e-bb8a-76c7f6cfd9ac

📥 Commits

Reviewing files that changed from the base of the PR and between a442cba and 85a6afc.

📒 Files selected for processing (1)
  • packages/devtools_profiler_core/lib/src/capture/profile_runner.dart
📜 Review details
🧰 Additional context used
📓 Path-based instructions (2)
**/*.dart

📄 CodeRabbit inference engine (AGENTS.md)

**/*.dart: Follow idiomatic Dart and keep code easy to scan in split-screen views
Prefer multi-line strings over string concatenation for large text blocks, command output fixtures, JSON examples, and terminal snapshots
Keep lines near 80 characters where practical. Long identifiers and URLs may exceed that when wrapping would make the code harder to read
Use records for short-lived grouped return values instead of introducing one-off classes
Use patterns, if-case, and switch expressions when they make parsing or dispatch logic clearer
Use class modifiers such as sealed, final, base, and interface when they describe the intended inheritance boundary
Use digit separators for large numeric literals, for example timeouts, sample counts, and byte sizes
Use wildcard variables for intentionally unused callback parameters
Use null-aware collection elements when conditionally including nullable values in list or map literals
Use dot shorthands only when the inferred type is obvious from context
Use /// documentation comments for public APIs
Start doc comments with a short, single-sentence summary
Put a blank line after the first sentence when adding more detail in doc comments
Avoid repeating information that is already obvious from the declaration in documentation comments
Start method comments with third-person verbs, such as 'Returns', 'Starts', or 'Captures'
Start non-boolean property comments with a noun phrase
Start boolean property comments with 'Whether'
Use square brackets for in-scope identifiers, such as [ProfileRunRequest], [Duration], and [StateError]
Explain parameters, return values, and exceptions in prose rather than using tag-style documentation
Prefer fenced Markdown code blocks for examples in documentation comments
Keep Markdown simple; avoid HTML in documentation comments

Files:

  • packages/devtools_profiler_core/lib/src/capture/profile_runner.dart
packages/devtools_profiler_*/**/*.dart

📄 CodeRabbit inference engine (AGENTS.md)

Consider documenting private helpers when they encode profiler behavior, artifact contracts, protocol semantics, or VM-service assumptions

Files:

  • packages/devtools_profiler_core/lib/src/capture/profile_runner.dart
🧠 Learnings (10)
📓 Common learnings
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to packages/devtools_profiler_cli/lib/**/command*.dart : Split large CLI commands into focused files instead of growing a monolithic command file
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Run formatting, analysis, and tests before handing work back using: dart format ., dart analyze ., and dart test on all profiler packages
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: `devtools_region_profiler` should stay small and safe to add to Dart or Flutter applications being profiled
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to packages/devtools_profiler_*/**/*.dart : Consider documenting private helpers when they encode profiler behavior, artifact contracts, protocol semantics, or VM-service assumptions
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: For Flutter targets, remember that release mode, AOT builds, and browser/web targets do not expose the Dart VM service needed by this profiler
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to **/*.dart : Use square brackets for in-scope identifiers, such as [ProfileRunRequest], [Duration], and [StateError]
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to packages/devtools_profiler_**/pubspec.yaml : Do not add Flutter UI, web UI, or browser-only runtime dependencies to the profiler packages
📚 Learning: 2026-04-26T17:03:32.425Z
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to packages/devtools_profiler_cli/lib/**/command*.dart : Split large CLI commands into focused files instead of growing a monolithic command file

Applied to files:

  • packages/devtools_profiler_core/lib/src/capture/profile_runner.dart
📚 Learning: 2026-04-26T17:03:32.425Z
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to packages/devtools_profiler_*/**/*.dart : Consider documenting private helpers when they encode profiler behavior, artifact contracts, protocol semantics, or VM-service assumptions

Applied to files:

  • packages/devtools_profiler_core/lib/src/capture/profile_runner.dart
📚 Learning: 2026-04-26T17:03:32.425Z
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to **/*.dart : Use square brackets for in-scope identifiers, such as [ProfileRunRequest], [Duration], and [StateError]

Applied to files:

  • packages/devtools_profiler_core/lib/src/capture/profile_runner.dart
📚 Learning: 2026-04-26T17:03:32.425Z
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Run formatting, analysis, and tests before handing work back using: dart format ., dart analyze ., and dart test on all profiler packages

Applied to files:

  • packages/devtools_profiler_core/lib/src/capture/profile_runner.dart
📚 Learning: 2026-04-26T17:03:32.425Z
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to **/*.dart : Use `///` documentation comments for public APIs

Applied to files:

  • packages/devtools_profiler_core/lib/src/capture/profile_runner.dart
📚 Learning: 2026-04-26T17:03:32.425Z
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to **/*.dart : Start doc comments with a short, single-sentence summary

Applied to files:

  • packages/devtools_profiler_core/lib/src/capture/profile_runner.dart
📚 Learning: 2026-04-26T17:03:32.425Z
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to **/*.dart : Explain parameters, return values, and exceptions in prose rather than using tag-style documentation

Applied to files:

  • packages/devtools_profiler_core/lib/src/capture/profile_runner.dart
📚 Learning: 2026-04-26T17:03:32.425Z
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to **/*.dart : Put a blank line after the first sentence when adding more detail in doc comments

Applied to files:

  • packages/devtools_profiler_core/lib/src/capture/profile_runner.dart
📚 Learning: 2026-04-26T17:03:32.425Z
Learnt from: CR
Repo: kingwill101/devtools-profiler PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T17:03:32.425Z
Learning: Applies to **/*.dart : Avoid repeating information that is already obvious from the declaration in documentation comments

Applied to files:

  • packages/devtools_profiler_core/lib/src/capture/profile_runner.dart
🔇 Additional comments (4)
packages/devtools_profiler_core/lib/src/capture/profile_runner.dart (4)

36-42: Normalization is wired through the launch path correctly.

Expanding bare Dart files before validation and threading the normalized [command] into launch + VM-service setup keeps the new dart run <file> behavior consistent end-to-end.

Also applies to: 74-101


304-364: The exit-pause poller is much more bounded now.

Using recordCurrentlyPausedExitIsolates() on the timer tick and backing off to 3 seconds after exitPauseUnavailable avoids the previous hot loop while still detecting late-pausing isolates.


373-418: The resume fallback is now well-bounded.

Five resume attempts, a 2-second wait per attempt, and a synthetic non-zero exit after termination keep the shutdown path from hanging forever.


130-142: No action needed. The original concern is unfounded. handleProcessExit() only finalizes active profiling regions and does not dispose the VM service connection. The connection remains available for _resumeExitPausedProcess() to call resumePausedExitIsolates(), and is only disposed in the finally block after resume completes.

			> Likely an incorrect or invalid review comment.

@kingwill101
kingwill101 merged commit 7260398 into main Apr 30, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant