Skip to content

fix: populate tools_used when execute_tools is False#35

Draft
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/justllms-repository-improvements-8604
Draft

fix: populate tools_used when execute_tools is False#35
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/justllms-repository-improvements-8604

Conversation

@cursor
Copy link
Copy Markdown

@cursor cursor Bot commented May 29, 2026

Summary

When the model returns tool calls but automatic execution is disabled (execute_tools=False), CompletionResponse.tools_used was left unset (None). Callers that inspect tools_used to see which tools the model requested could not rely on that field unless tools were actually executed.

Changes

  • Set tools_used from the extracted tool call names when returning early without execution.

Testing

Local CI checks passed:

  • ruff check justllms/
  • black --check justllms/
  • mypy justllms/ --ignore-missing-imports
  • python -m build

Note

The same fix is also on branch darshan/fix-tools-used-without-execution per repo automation conventions.

Open in Web View Automation 

When the model returns tool calls but automatic execution is disabled,
tools_used was left unset. Populate it from the requested tool call names
so callers can inspect which tools the model intended to invoke.

Co-authored-by: Darshan Harihar <DarshanHarihar1@users.noreply.github.com>
@github-actions github-actions Bot added core bug Something isn't working llm size/XS labels May 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working core llm size/XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant