Skip to content

test(acp): add missing coverage for extensions command error paths #22934

@samar-703

Description

@samar-703

Summary

ACP extension command behavior is implemented in packages/cli/src/acp/commands/extensions.ts, but test coverage was missing for important error paths in the disable/uninstall flows.

Problem

Two failure scenarios were not explicitly covered:

  1. DisableExtensionCommand when extensionManager.disableExtension(...) throws.
  2. UninstallExtensionCommand when extensionManager.uninstallExtension(...) throws for a non-existent extension.

Without explicit tests for these branches, regressions in user-facing error reporting can slip through.

Proposed Solution

Add and maintain test coverage in:

  • packages/cli/src/acp/commands/extensions.test.ts

New test cases:

  • returns error when disabling fails
  • returns error when uninstalling a non-existent extension

Each test should assert the exact command output format to ensure stable, user-facing error messages.

Acceptance Criteria

  • The ACP extensions test suite includes explicit coverage for both error paths above.
  • Error output includes the extension name and propagated error message.
  • Targeted test command passes:

npm run test --workspace @google/gemini-cli -- src/acp/commands/extensions.test.ts

Related PR

Related to #22798

Metadata

Metadata

Assignees

Labels

1.0/eng-excellencearea/extensionsIssues related to Gemini CLI extensions capabilityeffort/small1 day or less: trivial logic, UI adjustments, docshelp wantedWe will accept PRs from all issues marked as "help wanted". Thanks for your support!kind/customer-issueIssues that were reported by customerspriority/p3Backlog - a good idea but not currently a priority.status/bot-triaged

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions