Skip to content

feat(platform): consolidate excel tool and remove resource_check#471

Merged
larryro merged 3 commits into
mainfrom
feat/consolidate-excel-tool
Feb 15, 2026
Merged

feat(platform): consolidate excel tool and remove resource_check#471
larryro merged 3 commits into
mainfrom
feat/consolidate-excel-tool

Conversation

@larryro
Copy link
Copy Markdown
Collaborator

@larryro larryro commented Feb 15, 2026

Summary

  • Consolidated generate_excel tool into a unified excel tool that supports both generating and parsing .xlsx files
  • Added parse operation to read uploaded Excel files and extract structured sheet data (headers + rows)
  • Removed the unused resource_check tool and its helper (check_resource_accessible)
  • Moved the excel tool from the "Data" category to "Documents" in the tool selector UI

Test plan

  • Verify Excel generation still works (agent creates .xlsx from tabular data)
  • Test Excel parsing: upload a .xlsx file and confirm the agent extracts sheet data correctly
  • Confirm resource_check tool is fully removed with no remaining references
  • Verify tool selector UI shows excel under Documents and no longer shows resource_check or generate_excel

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added unified Excel tool supporting both file generation and parsing capabilities.
  • Bug Fixes

    • Removed resource check tool and consolidated Excel functionality into a single, streamlined tool.
  • Chores

    • Updated tool registry and categorization across agents and components for improved organization.

Rename generate_excel to excel, add parseExcel support for reading
uploaded .xlsx files, and remove the unused resource_check tool.
@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Feb 15, 2026

Greptile Summary

This PR consolidates Excel file handling by merging generate_excel tool into a unified excel tool that supports both generating and parsing .xlsx files. The new tool uses an operation parameter to distinguish between "generate" (creating Excel files from data) and "parse" (extracting data from uploaded files).

Key changes:

  • Added new excel_tool.ts with dual operation support (generate/parse)
  • Implemented parseExcel internal action to read Excel files and extract structured sheet data
  • Removed unused resource_check tool and its helper (check_resource_accessible)
  • Moved excel tool from "Data" category to "Documents" in UI
  • Updated all references across agents, tool registry, and UI components

The refactor maintains backward compatibility for the generate operation while adding new parse capabilities. All tool references have been updated consistently across the codebase.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • Well-structured refactor with comprehensive changes: clean consolidation of Excel functionality into a single tool, proper error handling in both operations, consistent updates across all tool references (registry, agents, UI), complete removal of unused code with no dangling references, and clear documentation in the new tool
  • No files require special attention

Important Files Changed

Filename Overview
services/platform/convex/agent_tools/files/excel_tool.ts New consolidated Excel tool with generate and parse operations; comprehensive error handling and clear documentation
services/platform/convex/node_only/documents/internal_actions.ts Added parseExcel action to read Excel files from storage and extract sheet data
services/platform/convex/agent_tools/tool_registry.ts Updated imports and registry to replace generate_excel with excel, removed resource_check
services/platform/app/features/custom-agents/components/tool-selector.tsx Moved excel from Data category to Documents, removed resource_check from UI

Flowchart

flowchart TD
    A[Agent calls excel tool] --> B{operation type?}
    B -->|generate default| C[Validate fileName & sheets]
    B -->|parse| D[Validate fileId]
    
    C --> E[Call generateExcel action]
    E --> F[Build XLSX workbook with xlsx library]
    F --> G[Return base64 encoded file]
    G --> H[Decode to Uint8Array]
    H --> I[Store blob in Convex storage]
    I --> J[Return fileId, URL, metadata]
    
    D --> K[Call parseExcel action]
    K --> L[Fetch file from storage]
    L --> M[Parse with xlsx library]
    M --> N[Extract sheets with headers & rows]
    N --> O[Return structured sheet data]
Loading

Last reviewed commit: 3ff05df

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Feb 15, 2026

📝 Walkthrough

Walkthrough

This PR consolidates Excel file handling and eliminates resource checking functionality. It replaces two separate tools (generate_excel and resource_check) with a unified excel tool that supports both generation and parsing of Excel files via a dual-operation handler. Supporting changes cascade across tool registries, agent configurations, UI component mappings, i18n translations, and internal action handlers to reflect the new tool structure.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~40 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 3 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main changes: consolidating the generate_excel tool into a unified excel tool and removing the resource_check tool, which align with the primary objectives of this changeset.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/consolidate-excel-tool

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@services/platform/convex/agent_tools/files/excel_tool.ts`:
- Around line 221-229: The current return block sets success: true even if
ctx.storage.getUrl(fileId) returns null (url becomes ''), which can mislead the
agent; update the logic in the generate flow that uses
ctx.storage.getUrl(fileId) to check for a null/undefined url and either throw an
Error or return success: false with an error message instead of returning an
empty url string — specifically guard around ctx.storage.getUrl(fileId) and
modify the returned object (operation:'generate', fileId, url, fileName:
result.fileName, rowCount: result.rowCount, sheetCount: result.sheetCount) to
only set success: true when url is present, otherwise set success:false and
include an explanatory error field or throw so callers (and the agent) do not
receive an empty URL.
- Around line 161-177: The parse branch returns a failure object while generate
currently throws; make them consistent by catching exceptions in the generate
operation and returning a GenerateExcelResult with success: false and an error
string (mirror the fields used in the parse return such as
fileName/operation/sheets/totalRows/sheetCount), and update the
GenerateExcelResult type to include an optional error?: string field; also
ensure you log the error (console.error) with contextual fields like args.fileId
or args.filename before returning.

Comment thread services/platform/convex/agent_tools/files/excel_tool.ts
Comment thread services/platform/convex/agent_tools/files/excel_tool.ts
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.

1 participant