continue icon indicating copy to clipboard operation
continue copied to clipboard

refactor: :recycle: Refactor the cli tool type to align with core

Open chezsmithy opened this issue 2 months ago • 1 comments

Description

Refactor the cli tool type to have the function wrapper to align it with the core tool type. Avoid type issues in OpenAPI adapters due to misalignment.

AI Code Review

  • Team members only: AI review runs automatically when PR is opened or marked ready for review
  • Team members can also trigger a review by commenting @continue-review

Checklist

  • [X] I've read the contributing guide
  • [X] The relevant docs, if any, have been updated or created
  • [X] The relevant tests, if any, have been updated or created

Screen recording or screenshot

[ When applicable, please include a short screen recording or screenshot - this makes it much easier for us as contributors to review and understand your changes. See this PR as a good example. ]

Tests

Tests were refactored as needed.


Summary by cubic

Refactored the CLI Tool type to the core-aligned, function-based shape and migrated all built-in tools. This removes type mismatches and stabilizes OpenAPI adapter behavior.

  • Refactors

    • Switched Tool to { type: "function", function: { name, description, parameters } } with displayTitle, group, and readonly.
    • Migrated Edit, MultiEdit, Read, Write, Bash, Search, List, Diff, Status, Checklist, Fetch, Exit to the new structure.
    • Updated helpers and execution flow: permission checks, display name lookup, chat-completion conversion, MCP tool conversion, and argument validation.
    • Adjusted messages and docs to reference readFileTool.function.name consistently.
  • Bug Fixes

    • Eliminates type misalignment causing issues in OpenAPI adapters.
    • Adds safe defaults when parameter schemas are missing to prevent validation errors.

Written for commit c078b37bc45d1fb61214a8eab039a0b6f5305445. Summary will update automatically on new commits.

chezsmithy avatar Nov 02 '25 05:11 chezsmithy

Edit, I see your comment about Avoid type issues in OpenAPI adapters due to misalignment 👍

RomneyDa avatar Nov 11 '25 20:11 RomneyDa

Taking another pass through PRs, note merge conflict and test failures

RomneyDa avatar Nov 26 '25 04:11 RomneyDa