Repository navigation
Say in the chat when a tool is left out because the server refused its schema - #1221
Closed
sosidudku1 wants to merge 2 commits into
Closed
sosidudku1 wants to merge 2 commits into
sosidudku1 wants to merge 2 commits into
Conversation
…sed its schema The provider now records the tool it resent the request without on CompletionResult.droppedTools. The agent loop turns that into one tool_disabled event per tool per turn; the TUI shows it as a system line and the HTTP stream sends a tool_disabled frame (extensions only) with the chat sentence.
Collaborator
Author
sheepdogs
pushed a commit
to sheepdogs/atomic-agent
that referenced
this pull request
Nov 12, 2026
sheepdogs
pushed a commit
to sheepdogs/atomic-agent
that referenced
this pull request
Nov 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #1148, retarget to main after it merges.
Fixes ATO-1417 (follow-up of ATO-1399).
What was wrong
#1148 resends a request without a tool whose JSON schema LM Studio or llama.cpp refused, but only writes a log line about it. In the terminal or the desktop the person sees a model that never uses their MCP tool, with no reason given.
What changes
openai-provider.ts): the tool the request was resent without is recorded on the completion asCompletionResult.droppedTools({ name, reason: "schema_rejected" }, registry name, not wire name). Both the unary and the streamed path set it.llm_completed, every dropped tool the turn has not announced yet becomes a newAgentLoopEventtool_disabled(stepIndex,tool,reason). Once per tool per turn: every step sends the same tool list and is refused the same way, so a per-request line would repeat on every step.tool_disabledframe (object: atomic.tool_disabled,session_id,step_index,tool,reason,notice= the same sentence), extensions opt-in only, likeprovider_switched. The plain OpenAI stream is unchanged. README notes the frame.Why a field on the result and not a new callback or a direct event
The provider has no session and no event sink, and should not get one. Provider-side facts already reach the UI this way:
rateLimitsandservedTransportrideCompletionResult, and the runtime/loop lift them into events. The result passes through the fallback seam untouched (it spreads the result), so nothing new has to be threaded throughLlmStreamParams/llm-link-attempt, which a request callback likeonPromptProgresswould need. The loop then owns the per-turn dedupe, the same way it ownshistory_trimmedandprofile_clipped.Old clients
kind: <name>andonChatEventignores a kind it does not know, so an older desktop just drops it. The desktop rendering is a separate PR on rel/xp-build.AgentLoopEvent.Tests (written, not run)
src/llm/provider/openai/openai-tool-schema-retry.test.ts:droppedToolsset on the unary and streamed resend, absent when nothing was dropped.src/agent/tool-disabled-notice.test.ts: sentence and per-turn dedupe.src/agent/agent-loop-tool-disabled.test.ts: once per turn across two completions of a turn (parse retry), again on the next turn, nothing without drops.src/tui/agent-event-reducer.test.ts: system line, not painted for a background session.src/http/tool-disabled-stream.test.ts: frame shape, nothing on the plain stream.Checked on the second Mac on 12.11.2026 in the combined run with the other open PRs: build, lint, test types, vitest, desktop unit tests, desktop smoke and live smoke all green.