Conversation
- Add guard to detect and skip re-registering proxy-dispatch on LLM instances - Mark LLMs as registered and preserve a bare _llmNoTools snapshot to avoid duplicate attachments - Add fallbacks for extracting `answer` and `params` from `arguments` and adjust streaming/tool invocation logic for tool-calling compatibility Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ions
- Add _extractToolCallActions() to recursively extract tool calls from
nested payloads with deduplication and allowed-tools filtering
- Add _resolveDebugChannelName() and _snapshotDebugChannel() for debug
channel handling
- Improve _runChatbotMode() to extract tool actions from responses when
no explicit actions are present
- Add fallback logic when model requests tool calling but no execution
completes, switching to action-based mode
- Track extracted response text and tool call detection for better
interaction flow
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes missing incremental streamed output when usestream=true by handling providers that emit plain text deltas (non-JSON), ensuring SSE stream events are emitted as text arrives.
Changes:
- Added a plain passthrough streaming delta handler and updated streaming handler selection to support non-JSON delta streams.
- Adjusted streaming/prompt selection logic in both agent mode (
_startInternal) and chatbot mode (_runChatbotMode). - Introduced additional tool-calling/MCP-related robustness changes (tool-call extraction helpers, MCP proxy registration de-dupe, and recovery fallbacks).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+12110
to
+12114
| // When function calling is active (_useToolsActual), skip format:json constraint — | ||
| // sending both "tools" and "format:json" simultaneously breaks Ollama thinking models | ||
| // (e.g. qwen3.x) which return {"error":"..."} when these modes conflict. | ||
| var skipJsonFormat = this._useToolsActual === true | ||
| if (canStreamJson && !noJsonPromptFlag && !skipJsonFormat) { |
200418b to
77c875e
Compare
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.
Motivation
"answer"field and could suppress visible output when the provider emitted plain text deltas (e.g., viapromptStreamWithStats), causingusestream=truesessions (notablychatbotmode=true) to show no streamed content.streamevents to be emitted incrementally, so backend suppression produced an answered-but-not-displayed symptom in the frontend.Description
MiniA.prototype._createPlainStreamDeltaHandlerthat emits raw text deltas immediately and inserts a leading newline on first output._createStreamDeltaHandler) and the plain handler depending on whetherpromptStreamJSONWithStats(JSON stream) orpromptStreamWithStats(plain stream) is being used and thenoJsonPromptflags._startInternal) and the chatbot loop (_runChatbotMode) sochatbotmode=truebenefits from the fix.Testing
node --check mini-a.jsto verify the modified file passes a Node syntax check and it succeeded.ojob tests/miniAUtils.yaml, but theojobcommand is not available in this environment so the test job could not be executed here.