Skip to content

fix(ai): handle forced tool arguments in workspace inventory - #973

Merged
antonreshetov merged 1 commit into
mainfrom
fix/ai-workspace-inventory-filters
Oct 7, 2026
Merged

antonreshetov merged 1 commit into
mainfrom
fix/ai-workspace-inventory-filters

Conversation

@antonreshetov

Copy link
Copy Markdown
Member

Found while testing OpenRouter support (#971). Through OpenRouter, OpenAI models fill every tool parameter, so list_workspace_items received filters nobody asked for (taskType: "task", taskStatus: "todo", isFavorites: false, folderId: null) and returned empty or partial results. A per-folder request also produced 10 parallel tool calls in one response, which exceeded the 8-call limit and failed with invalidResponse.

  • isFavorites, taskType and taskStatus filters are nullable: null or omitted means no filter.
  • taskType/taskStatus outside Notes return TASK_FILTER_NOTES_ONLY with a hint instead of an empty list.
  • folderId accepts a folder ID, "inbox" for items without a folder, or null/omitted for all folders. Other tools keep null as root/Inbox.
  • Tool call limit per response raised from 8 to 16 (AI_LIMITS.toolCalls) in the SDK, Responses and chat completions paths and in the message schema.
  • invalidResponse in the SDK path now carries a short diagnostic code (finish reason, tool call count, empty response, etc.) in the trace and under the chat error. The trace logs the final error code.
  • Tests for nullable filters, folder filtering, the task filter scope, the 16-call limit and diagnostics.

@antonreshetov antonreshetov self-assigned this Oct 7, 2026
@antonreshetov
antonreshetov merged commit 39e296f into main Oct 7, 2026
@antonreshetov
antonreshetov deleted the fix/ai-workspace-inventory-filters branch October 7, 2026 10:59
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