Skip to content

Conversation

NaccOll
Copy link
Contributor

@NaccOll NaccOll commented Oct 9, 2025

Context

Use native tool calls instead of XML

Implementation

Without major refactoring of the existing workflow, the tool call based on XML-formatted text prompts was converted to tool call based on json.

  • Added a toggle in the Provider settings page, allowing users to enable/disable tool call
  • Designed a compatible tool call interface and migrated tools from text+XML prompts to tool call format objects
  • When tool call is enabled, converted tools will remove their original descriptions and examples during prompt generation
  • Designed unified post-call processing to transform the returned standard JSON into XML, seamlessly integrating with the existing function

Tools

  • apply_diff
  • insert_contnet
  • list_code_definition_names
  • list_files
  • read_file( The file read limit may fail. )
  • search_and_replace
  • search_files
  • write_to_file
  • access_mcp_resource
  • ask_followup_question
  • attempt_completion
  • browser_action
  • codebase_search
  • execute_command
  • fetch_instructions
  • new_task
  • switch_mode
  • update_todo_list
  • use_mcp_tool
  • generate_image
  • edit_file

Provider

  • KiloCode
  • OpenRouter
  • OpenAI Compatible
  • DeepSeek
  • LmStudio

Screenshots

image

How to Test

Configure the model in the supported provider and enable native tool calls for testing based on the screenshots.

Get in Touch

NaccOll

- Implemented tool call support across various tools, enabling the use of tool calls instead of XML-based prompts.
- Updated `attemptCompletionTool` to handle tool results with `toolUseId`.
- Enhanced `applyDiffTool` to process diffs with tool calls, including handling search and replace scenarios.
- Modified `listFilesTool`, `searchFilesTool`, and `writeToFileTool` to accommodate tool call configurations.
- Introduced `ToolCallSettingsControl` in the UI for enabling/disabling tool calls.
- Added localization for tool call settings in multiple languages.
- Updated tests to cover new tool call functionalities and ensure proper behavior when tool calls are enabled.
Copy link

changeset-bot bot commented Oct 9, 2025

⚠️ No Changeset found

Latest commit: 87ea8e2

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@chrarnoldus chrarnoldus self-requested a review October 14, 2025 20:23
# Conflicts:
#	src/api/providers/openai.ts
@chrarnoldus
Copy link
Collaborator

The alternative PR #2833 is merged, but we can keep this one open a while for improvement ideas.

@NaccOll
Copy link
Contributor Author

NaccOll commented Oct 16, 2025

I'm happy to see Kilo introduce experimental native tool calls. I think my pull request can be closed, but the current draft still needs the following enhancements:

  1. Support for apply_diff
  2. A mutable tool schema. The current implementation renders many configurations ineffective, making the tool less flexible. There's no way to control the number of files read, limit the number of lines read, and enable or disable some tools in the settings.
  3. Streaming tool result responses
  4. More provider support. I hope to first add native call support for various OpenAI-compatible provider to facilitate testing.

Hope with the continuous feedback from the community, this function will become more and more perfect.

@NaccOll NaccOll closed this Oct 16, 2025
@chrarnoldus
Copy link
Collaborator

Absolutely, thanks for your support @NaccOll

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