Skip to content

feat(experiments): register PARALLEL_TOOL_EXECUTION flag (internal-only)#678

Merged
navedmerchant merged 2 commits into
mainfrom
issue/363
Jun 22, 2026
Merged

feat(experiments): register PARALLEL_TOOL_EXECUTION flag (internal-only)#678
navedmerchant merged 2 commits into
mainfrom
issue/363

Conversation

@edelauna

@edelauna edelauna commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Related GitHub Issue

Closes: #363

Description

Registers the PARALLEL_TOOL_EXECUTION experiment flag as an internal-only, preloaded flag (default false, showInSettings: false).

  • Added "parallelToolExecution" to experimentIds and experimentsSchema in packages/types/src/experiment.ts
  • Added PARALLEL_TOOL_EXECUTION: "parallelToolExecution" to EXPERIMENT_IDS and { enabled: false, showInSettings: false } to experimentConfigsMap in src/shared/experiments.ts
  • Added showInSettings?: boolean to ExperimentConfig interface; ExperimentalSettings.tsx filters out configs where showInSettings === false, so the flag is wired up but invisible in the Settings UI until Epic 4 is ready
  • Added unit tests asserting default-off behavior and that the flag does not render in the Settings panel

Test Procedure

nvm use 20.20.2
pnpm --filter zoo-code exec vitest run shared/__tests__/experiments.spec.ts
pnpm --filter @roo-code/vscode-webview exec vitest run src/components/settings/__tests__/ExperimentalSettings.spec.tsx

Both pass with no failures.

Pre-Submission Checklist

  • Issue Linked: This PR is linked to an approved GitHub Issue (see "Related GitHub Issue" above).
  • Scope: My changes are focused on the linked issue (one major feature/fix per PR).
  • Self-Review: I have performed a thorough self-review of my code.
  • Testing: New and/or updated tests have been added to cover my changes (if applicable).
  • Documentation Impact: No documentation updates required — flag is internal-only and not visible in Settings.
  • Contribution Guidelines: I have read and agree to the Contributor Guidelines.

Summary by CodeRabbit

  • New Features

    • Introduced a new experimental flag (parallelToolExecution) and updated the experiment definitions and validation.
    • Added settings visibility control so certain experiments can be hidden from the UI by default.
  • Bug Fixes

    • Improved experimental settings rendering to show only flags meant to appear in settings.
  • Tests

    • Extended experiment-related unit tests to cover the new flag, default behavior, and settings visibility.

@coderabbitai

coderabbitai Bot commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 20bfc856-e821-41cc-b0c0-056109242b79

📥 Commits

Reviewing files that changed from the base of the PR and between eb2089a and 4367bf3.

📒 Files selected for processing (2)
  • src/shared/experiments.ts
  • webview-ui/src/components/settings/__tests__/ExperimentalSettings.spec.tsx
🚧 Files skipped from review as they are similar to previous changes (2)
  • webview-ui/src/components/settings/tests/ExperimentalSettings.spec.tsx
  • src/shared/experiments.ts

📝 Walkthrough

Walkthrough

Adds a new parallelToolExecution experiment flag to the Zod type schema, registers it in experimentConfigsMap with enabled: false and showInSettings: false, introduces a showInSettings optional field on ExperimentConfig, filters out configs with showInSettings === false from the settings UI, and adds corresponding tests.

Changes

PARALLEL_TOOL_EXECUTION Experiment Flag

Layer / File(s) Summary
Zod schema and experimentIds type contract
packages/types/src/experiment.ts
experimentIds array and experimentsSchema are extended with parallelToolExecution, updating the inferred ExperimentId and Experiments types.
Experiment config entry, showInSettings field, and UI filter
src/shared/experiments.ts, webview-ui/src/components/settings/ExperimentalSettings.tsx
PARALLEL_TOOL_EXECUTION is added to EXPERIMENT_IDS and experimentConfigsMap with enabled: false and showInSettings: false. ExperimentConfig gains an optional showInSettings field. The settings component filter is extended to exclude entries where showInSettings === false.
Experiment and settings component tests
src/shared/__tests__/experiments.spec.ts, webview-ui/src/components/settings/__tests__/ExperimentalSettings.spec.tsx
Existing mock objects are updated to include parallelToolExecution: false. A new describe("PARALLEL_TOOL_EXECUTION") block validates ID wiring, config shape, and isEnabled behavior. A new ExperimentalSettings component test asserts that internal-only flags are absent from the rendered DOM.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A new flag hops into the map,
parallelToolExecution fills the gap.
Hidden from settings, a quiet internal guest,
showInSettings: false keeps it under arrest.
The schema expands, the tests all agree —
this rabbit's experiment runs silently! 🌿

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: registering the PARALLEL_TOOL_EXECUTION flag as an internal-only feature.
Description check ✅ Passed The description fully follows the template with linked issue, clear explanation of implementation details, test procedures with commands, and completed pre-submission checklist.
Linked Issues check ✅ Passed The PR meets all acceptance criteria from #363: defaults to false, extends experimentsSchema and experimentConfigsMap, adds showInSettings property, includes tests verifying default-off behavior, and filters Settings UI appropriately.
Out of Scope Changes check ✅ Passed All changes are directly scoped to #363 requirements: registering the flag infrastructure, adding type safety, filtering Settings UI, and adding comprehensive unit tests. No extraneous modifications detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch issue/363

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.

@codecov

codecov Bot commented Jun 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@edelauna edelauna marked this pull request as ready for review June 21, 2026 02:32

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

Looks good! couple of comments below

Comment thread src/shared/experiments.ts
@@ -13,13 +14,15 @@ type ExperimentKey = Keys<typeof EXPERIMENT_IDS>

interface ExperimentConfig {
enabled: boolean

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.

[Low] Document the showInSettings contract

The showInSettings !== false filter in ExperimentalSettings.tsx relies on undefined !== false being true, so all pre-existing configs (which omit the field) remain visible. This is correct and backward-compatible, but the implicit "undefined = visible" contract isn't documented here.

Impact: Maintainability — a future contributor could misread the optional field and assume omission hides the flag.

Suggestion: Add a one-line JSDoc, e.g. /** Defaults to true; set to false to hide from the Settings panel. */, so the convention is self-documenting.

Comment thread src/shared/experiments.ts
RUN_SLASH_COMMAND: { enabled: false },
CUSTOM_TOOLS: { enabled: false },
PARALLEL_TOOL_EXECUTION: { enabled: false, showInSettings: false },
}

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.

[Low] Translation key TODO for when visibility is enabled

No translation key (settings:experimental.PARALLEL_TOOL_EXECUTION.name / .description) was added to en/settings.json. This is harmless now because the flag is filtered out before render, so the key is never looked up.

Impact: None today. When "Epic 4" flips showInSettings to true (or removes the filter), the UI will render the raw key string instead of a human-readable label until translations are added. The repo's scripts/find-missing-i18n-key.js scans for referenced keys, and since the key is never referenced while hidden, it won't catch this gap at that transition.

Suggestion: Leave a TODO anchored to this flag (or note in issue #363) that translation entries must be added in the same PR that enables showInSettings: true.

vi.clearAllMocks()
})

it("does not render internal-only experiment flags", () => {

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.

[Low] Optional: assert special-cased entries still render

The test asserts PREVENT_FOCUS_DISRUPTION and RUN_SLASH_COMMAND render and PARALLEL_TOOL_EXECUTION does not, but doesn't assert that the special-cased IMAGE_GENERATION and CUSTOM_TOOLS entries still render. Those branches are exercised by the same .filter pipeline, so a regression that accidentally hid them wouldn't be caught here.

Impact: Low — test coverage gap. The test's stated intent ("does not render internal-only experiment flags") implicitly promises that non-internal flags do render, but only the generic-path flags are checked.

Suggestion: Optionally add assertions that the IMAGE_GENERATION and CUSTOM_TOOLS labels (or their rendered wrappers) are present, so the test guards the full filter behavior rather than a subset.

@github-actions github-actions Bot added the awaiting-author PR is waiting for the author to address requested changes label Jun 21, 2026
@edelauna edelauna requested a review from navedmerchant June 22, 2026 02:43
@navedmerchant navedmerchant added this pull request to the merge queue Jun 22, 2026
Merged via the queue into main with commit 0f1054e Jun 22, 2026
10 checks passed
@navedmerchant navedmerchant deleted the issue/363 branch June 22, 2026 03:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-author PR is waiting for the author to address requested changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Story 1.3] Register PARALLEL_TOOL_EXECUTION experiment flag

2 participants