Skip to content

optimize: rsdoctor agent-cli#1650

Merged
yifancong merged 4 commits intomainfrom
fix/agent-cli
May 8, 2026
Merged

optimize: rsdoctor agent-cli#1650
yifancong merged 4 commits intomainfrom
fix/agent-cli

Conversation

@yifancong
Copy link
Copy Markdown
Contributor

@yifancong yifancong commented May 8, 2026

Summary

This pull request introduces several improvements and fixes to the agent CLI, focusing on version reporting and the consistent omission of the modules field from chunk-related outputs. The changes also update tests to reflect the new behavior and clarify tree-shaking guidance messaging.

New Features and Enhancements:

  • CLI Version Reporting:
    • Added support for --version and -v flags to print the package version, along with corresponding tests for both options.

Data Output Consistency:

  • Omit modules Field from Chunk Outputs:
    • Introduced a reusable omitModulesFields utility function in multiple files to remove the modules property from chunk data structures and all related outputs. This affects handlers for assets, build, and chunks, ensuring that any API or CLI output no longer includes the modules field.

Documentation and Messaging:

  • Clarified Tree-Shaking Guidance Message:
    • Updated the tree-shaking summary message to reference the correct commands for detailed per-module bailout reasons.

Related Links

Copilot AI review requested due to automatic review settings May 8, 2026 08:09
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

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: 06c76c2da7

ℹ️ 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 thread packages/agent-cli/tests/cli.test.ts Outdated
Comment thread packages/agent-cli/src/commands/handlers/chunks.ts Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds output-size optimizations and basic CLI metadata support to @rsdoctor/agent-cli, primarily by stripping heavy modules arrays from several tool responses and exposing a --version/-v flag.

Changes:

  • Add --version / -v handling to the agent CLI and corresponding tests.
  • Omit modules fields from chunk-related outputs (including bundle optimize step data and media assets) and adjust tests accordingly.
  • Update tree-shaking summary description to reference the correct detailed subcommands.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
packages/agent-cli/tests/rsdoctor-cli.test.ts Updates expected chunk outputs to no longer include modules.
packages/agent-cli/tests/cli.test.ts Adds coverage for --version and -v CLI output.
packages/agent-cli/src/commands/handlers/tree-shaking.ts Updates summary description text to reference current detailed commands.
packages/agent-cli/src/commands/handlers/chunks.ts Strips modules from chunk list/large-chunk responses via a new omit helper.
packages/agent-cli/src/commands/handlers/build.ts Strips modules from bundle optimize step-1 payloads.
packages/agent-cli/src/commands/handlers/assets.ts Strips modules from media-assets chunk data.
packages/agent-cli/src/cli.ts Implements --version/-v by printing the package version.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/agent-cli/src/commands/handlers/chunks.ts Outdated
Comment thread packages/agent-cli/src/commands/handlers/chunks.ts Outdated
Comment thread packages/agent-cli/src/commands/handlers/build.ts Outdated
Comment thread packages/agent-cli/src/commands/handlers/assets.ts Outdated
Comment thread packages/agent-cli/tests/cli.test.ts
Comment thread packages/agent-cli/tests/cli.test.ts
yifancong and others added 3 commits May 8, 2026 17:09
@yifancong yifancong requested a review from fansenze May 8, 2026 09:28
@yifancong yifancong merged commit d90f684 into main May 8, 2026
4 checks passed
@yifancong yifancong deleted the fix/agent-cli branch May 8, 2026 10:05
@yifancong yifancong mentioned this pull request May 8, 2026
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.

3 participants