Skip to content

Conversation

@chezsmithy
Copy link
Contributor

@chezsmithy chezsmithy commented Oct 21, 2025

Description

Noticed the CLI and Core "Tool" type had a misaslignment around how a function was defined. This change aligns the function defintion making it easier to share tools between core and the cli. Also eliminates potential issues in the OpenAPI adapters when using tools between core and the cli.

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

  • I've read the contributing guide
  • The relevant docs, if any, have been updated or created
  • 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

Updated tests as needed.


Summary by cubic

Refactors the CLI Tool type to use a function schema (type: "function" with function {name, description, parameters}), aligning with core and preventing mismatches. This makes tools shareable between core and CLI and avoids OpenAPI adapter issues.

  • Refactors

    • Tool type now: type "function" with a function object holding name, description, and parameters.
    • Updated all built-in tools and MCP tool mapping to the new shape.
    • Switched lookups and validation to function.name and function.parameters.
    • Updated permission checks, tool discovery/handling, and tests to the new API.
  • Migration

    • Update custom CLI tools to include type: "function" and move name/description/parameters into tool.function.
    • Replace references to tool.name/description/parameters with tool.function.name/description/parameters.
    • Ensure allowlists/filters use function.name.

@chezsmithy chezsmithy requested a review from a team as a code owner October 21, 2025 19:11
@chezsmithy chezsmithy requested review from tingwai and removed request for a team October 21, 2025 19:11
@dosubot dosubot bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Oct 21, 2025
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 21 files

Prompt for AI agents (all 1 issues)

Understand the root cause of the following 1 issues and fix them.


<file name="extensions/cli/src/tools/index.tsx">

<violation number="1" location="extensions/cli/src/tools/index.tsx:253">
Iterating over the schema object means you only ever see keys like &quot;type&quot; and &quot;properties&quot;, so required argument names are never checked. Please iterate over `tool.function.parameters.properties` instead.</violation>
</file>

React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.

chezsmithy and others added 2 commits October 25, 2025 10:45
- Fixed validateToolCallArgsPresent to iterate over tool.function.parameters.properties
- Previously iterated over schema object keys like 'type' and 'properties'
- Now correctly validates actual parameter names against required arguments
- Added null safety with ?? {} fallback for undefined properties

Generated with [Continue](https://continue.dev)

Co-Authored-By: Continue <noreply@continue.dev>
- Resolved conflicts in tools/index.tsx preserving both refactor and validation fix
- Fixed permission checker to use ALL_BUILT_IN_TOOLS consistently
- Updated stream handlers to use new getAllAvailableTools API
- Removed deleted test file and cleaned up merge artifacts
- Preserved the tool parameter validation fix (properties iteration)

Generated with [Continue](https://continue.dev)

Co-Authored-By: Continue <noreply@continue.dev>
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:XL This PR changes 500-999 lines, ignoring generated files. labels Oct 25, 2025
- Fixed formatting in searchCode.ts and writeChecklist.test.ts
- Ensures code style compliance with project standards

Generated with [Continue](https://continue.dev)

Co-Authored-By: Continue <noreply@continue.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files.

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

1 participant