Skip to content

Improve tool calling response handling#38

Closed
MichaelAnders wants to merge 1 commit intoFast-Editor:mainfrom
MichaelAnders:feature/improve-tool-calling
Closed

Improve tool calling response handling#38
MichaelAnders wants to merge 1 commit intoFast-Editor:mainfrom
MichaelAnders:feature/improve-tool-calling

Conversation

@MichaelAnders
Copy link
Contributor

@MichaelAnders MichaelAnders commented Feb 5, 2026

Summary

  • Add fallback parsing for Ollama models that return tool calls as JSON text in message content instead of using the structured tool_calls field
  • Return tool results directly to CLI instead of making a follow-up LLM call, reducing latency and preventing hallucinated rewrites of output
  • Add dedicated Glob tool returning plain text (one path per line) instead of JSON, with workspace_list accepting both pattern and patterns
  • Clarify why Glob is not aliased to workspace_list (format mismatch)

Files Changed

File Change
src/clients/ollama-utils.js +69 lines — fallback JSON parsing for tool calls in message content
src/orchestrator/index.js +47/-1 lines — return tool results directly, skip follow-up LLM call
src/tools/index.js +4 lines — register new Glob tool
src/tools/indexer.js +50/-3 lines — Glob tool impl, dual-param workspace_list

Test plan

  • Verify Ollama models that return tool calls as JSON text are correctly parsed
  • Verify tool results are returned directly without a follow-up LLM call
  • Verify Glob tool returns one file path per line (plain text)
  • Verify workspace_list accepts both pattern and patterns parameters

Found some issues, removing for now

- Add fallback parsing for Ollama models that return tool calls as JSON
  text in message content instead of using the structured tool_calls field
- Return tool results directly to CLI instead of making a follow-up LLM
  call, reducing latency and preventing hallucinated rewrites of output
- Add dedicated Glob tool returning plain text (one path per line) instead
  of JSON, with workspace_list accepting both 'pattern' and 'patterns'
- Clarify why Glob is not aliased to workspace_list (format mismatch)
@MichaelAnders MichaelAnders deleted the feature/improve-tool-calling branch February 5, 2026 21:04
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.

1 participant