Skip to content

feat(cli): Add proper display for deleteFile tool#4977

Merged
marius-kilocode merged 1 commit intomainfrom
feat/cli-delete-file-display
Jan 13, 2026
Merged

feat(cli): Add proper display for deleteFile tool#4977
marius-kilocode merged 1 commit intomainfrom
feat/cli-delete-file-display

Conversation

@marius-kilocode
Copy link
Collaborator

@marius-kilocode marius-kilocode commented Jan 13, 2026

Summary

Fixes the CLI displaying "⚙ Unknown tool: deleteFile" when the deleteFile tool is used. Now properly displays file/directory deletion with a dedicated component.

Changes

New Component

  • ToolDeleteFileMessage.tsx - Displays delete operations with:
    • 🗑️ Delete(filename) for single files
    • 🗑️ Delete(dirname) ⎿ 5 files, 2 dirs for directories
    • warning indicator for paths outside workspace
    • "scanning..." indicator during directory scan

Supporting Changes

  • ToolRouter.tsx - Added case handler for deleteFile tool
  • utils.ts - Added 🗑️ icon mapping for deleteFile
  • types.ts - Added DeleteFileStats interface and stats property to ToolData
  • index.ts - Export new component

Tests

  • 18 comprehensive tests for the new component
  • Tests for getToolIcon("deleteFile")
  • Integration tests for deleteFile routing in ExtensionMessageRow

Before

image

After

image

or for directories:

image

@changeset-bot
Copy link

changeset-bot bot commented Jan 13, 2026

🦋 Changeset detected

Latest commit: eeb6c03

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@kilocode/cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@kiloconnect
Copy link
Contributor

kiloconnect bot commented Jan 13, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Overview

This PR adds proper display support for the deleteFile tool in the CLI, replacing the previous "Unknown tool: deleteFile" message with a well-designed component that shows:

  • File/directory path being deleted
  • Stats for directory deletions (file count, directory count)
  • Scanning indicator while stats are being gathered
  • Warning indicator for paths outside the workspace

The implementation follows existing patterns in the codebase and includes comprehensive test coverage.

Files Reviewed (9 files)
  • .changeset/delete-file-cli-display.md - Proper changeset for CLI patch
  • cli/src/ui/messages/extension/__tests__/ExtensionMessageRow.test.tsx - Added integration tests for deleteFile routing
  • cli/src/ui/messages/extension/__tests__/utils.test.ts - Added unit tests for getToolIcon
  • cli/src/ui/messages/extension/tools/ToolDeleteFileMessage.tsx - New component with clean implementation
  • cli/src/ui/messages/extension/tools/ToolRouter.tsx - Proper routing integration
  • cli/src/ui/messages/extension/tools/__tests__/ToolDeleteFileMessage.test.tsx - Comprehensive component tests
  • cli/src/ui/messages/extension/tools/index.ts - Export added
  • cli/src/ui/messages/extension/types.ts - Type definitions added
  • cli/src/ui/messages/extension/utils.ts - Icon mapping added

Highlights

Good test coverage - Tests cover single file deletion, directory deletion with stats, edge cases (empty/undefined path, zero stats), and warning indicators

Follows existing patterns - Component structure matches other tool message components (ToolReadFileMessage, ToolNewFileCreatedMessage, etc.)

Proper TypeScript types - Added DeleteFileStats interface and extended ToolData appropriately

User-friendly display - Shows relevant information in a compact format with proper pluralization ("1 file" vs "5 files")

@marius-kilocode marius-kilocode requested a review from a team January 13, 2026 11:12
Copy link
Contributor

@RSO RSO left a comment

Choose a reason for hiding this comment

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

Feels like we need a space in between the icon and the text

@marius-kilocode
Copy link
Collaborator Author

@RSO this is just a bug in my own terminal emulation :) . Not a CLI issue.

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.

2 participants