Skip to content

[ENHANCEMENT] Run consecutive safe read-only command tools in parallel#903

Draft
taltas wants to merge 3 commits into
mainfrom
taltas/parallel-safe-commands
Draft

[ENHANCEMENT] Run consecutive safe read-only command tools in parallel#903
taltas wants to merge 3 commits into
mainfrom
taltas/parallel-safe-commands

Conversation

@taltas

@taltas taltas commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Important

Maintainer takeover / replacement for #136

This draft PR republishes the validated contribution from @allquixotic in #136 from a branch in Zoo-Code-Org/Zoo-Code because the original fork branch was not writable by the maintainer. The original contribution, description, and attribution are retained below. PR #136 is intentionally being left open and unchanged.

Takeover validation

Validated commit: abd50908678f7da46070b985f726c5324d7476ab

  • Focused parallel command test file: 3/3 passed.
  • Related focused assistant-message tests: 24/24 passed.
  • Targeted ESLint: passed.
  • Targeted Prettier: passed.
  • Package typecheck was blocked only by unrelated, pre-existing missing-dotenv diagnostics outside the PR files.

Original PR description and attribution (#136)

Related GitHub Issue

Closes: #131

Description

This PR runs bounded batches of consecutive safe read-only execute_command tool calls in parallel.

Key changes:

  • Adds a conservative read-only shell command classifier for simple file-inspection commands and read-only git subcommands.
  • Defers safe command execution until the stream is complete enough to identify consecutive batch members.
  • Runs up to four consecutive read-only commands concurrently while preserving model-visible tool-result order.
  • Serializes approval prompts even when the approved command executions run concurrently.
  • Keeps unsafe, mutating, or complex shell forms on the existing serial path.
  • Adds focused tests for parallel execution, stream-completion deferral, preserved result order, and unsafe-command fallback.

Reviewer focus:

Test Procedure

From the Zoo Code worktree:

pnpm lint
pnpm check-types
pnpm --filter zoo-code test -- core/assistant-message/__tests__/presentAssistantMessage-parallel-commands.spec.ts

Manual verification recommended:

  • Ask Zoo to inspect several independent files or run several read-only commands.
  • Confirm safe command output appears without unnecessary serial delay.
  • Confirm a write/mutating command still follows the normal approval path.

Pre-Submission Checklist

  • Issue Linked: This PR is linked to an approved GitHub Issue.
  • Scope: My changes are focused on the linked issue.
  • 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.
  • Documentation Impact: I have considered if my changes require documentation updates.
  • Contribution Guidelines: I have read and agree to the Contributor Guidelines.

Screenshots / Videos

Not required; this is a core behavior/performance change.

Documentation Updates

No user-facing documentation update appears required unless Zoo documents command execution ordering.

Additional Notes

Related but not duplicate:

Get in Touch

Discord: coorbin

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

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

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ff28469d-4261-40c1-9217-e709eda3801a

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

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch taltas/parallel-safe-commands

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.

@codecov

codecov Bot commented Jul 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 42.19653% with 100 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
.../core/assistant-message/presentAssistantMessage.ts 42.19% 70 Missing and 30 partials ⚠️

📢 Thoughts on this report? Let us know!

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.

[ENHANCEMENT] Run consecutive safe read-only command tools in parallel

2 participants