Skip to content

refactor(core): add tool_use instructions only when needed#1405

Closed
deathbeam wants to merge 1 commit into
CopilotC-Nvim:mainfrom
deathbeam:optimize-tool-use
Closed

refactor(core): add tool_use instructions only when needed#1405
deathbeam wants to merge 1 commit into
CopilotC-Nvim:mainfrom
deathbeam:optimize-tool-use

Conversation

@deathbeam
Copy link
Copy Markdown
Collaborator

Previously, tool_use instructions were always appended to the system prompt, even when no tools were selected. This change moves the logic to add tool_use instructions to the ask function, ensuring they are included only when selected_tools is not empty. This optimizes prompt construction and prevents unnecessary instructions from being sent to the model.

@deathbeam deathbeam added enhancement New feature or request refactor labels Sep 12, 2025
@deathbeam deathbeam marked this pull request as draft September 12, 2025 18:56
Previously, tool_use instructions were always appended to the system prompt,
even when no tools were selected. This change moves the logic to add
tool_use instructions to the ask function, ensuring they are included only
when selected_tools is not empty. This optimizes prompt construction and
prevents unnecessary instructions from being sent to the model.

Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request refactor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant