feat(core): full end-to-end integration of customReasoningFields across serialization and provider layers#12509
Open
Yash-200608 wants to merge 3 commits into
Open
feat(core): full end-to-end integration of customReasoningFields across serialization and provider layers#12509Yash-200608 wants to merge 3 commits into
Yash-200608 wants to merge 3 commits into
Conversation
…gFields Signed-off-by: Yash <228875170+Yash-200608@users.noreply.github.com>
…oningFields across serialization layers
Contributor
|
All contributors have signed the CLA ✍️ ✅ |
Contributor
There was a problem hiding this comment.
1 issue found across 14 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Author
|
I have read the CLA Document and I hereby sign the CLA |
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.
Description
This PR delivers a comprehensive architectural solution for issue #10292. Local LLM gateways, private enterprise proxies, and custom endpoints (like vLLM, Ollama, or WatsonX) often stream reasoning tokens inside arbitrary, non-standard JSON keys. Without explicit tracking, these tokens are dropped by standard parsers or leak unformatted into the main chat block.
Instead of a shallow string-matching workaround, this change introduces
customReasoningFieldsas a core architectural property across Continue's configuration, validation, and stream-parsing layers. It maps non-standard payload delta keys natively into Continue's internal reasoning streams, routing them perfectly to the collapsible UI "Thinking" container.Related Issues
Closes #10292
Changes Made
core/index.d.ts, JSON/YAML/control-plane schemas): Added and fully integratedcustomReasoningFields?: string[]across model configurations, ensuring fields pass dynamically through model-add flows and browser serialization layers.BaseLLM,OpenAI,WatsonX): Exposed the publicoptionsaccessor on the parentBaseLLMclass. Replaced strict subclasses reading private internal state variables (_llmOptions), fully resolving strict TypeScript compilation and compiler isolation constraints.core/llm/openaiTypeConverters.ts): Integrated multi-field validation inside streaming and non-streaming event-loop blocks to match, separate, and tag custom thinking deltas cleanly asrole: "thinking".How to Test
"my_custom_thinking_key").{ "model": "reasoning-model", "provider": "openai", "customReasoningFields": ["my_custom_thinking_key"] }Summary by cubic
Adds end-to-end support for
customReasoningFieldsto capture reasoning tokens from non-standard provider payloads and render them in the Thinking panel. Works in both streaming and non-streaming paths, with options preserved across config, schemas, serialization, and providers.New Features
customReasoningFields?: string[]in model config andILLMoptions; preserved through JSON/YAML (packages/config-yaml,packages/config-types), control-plane schema, and serialization; accessible viaBaseLLM.options.role: "thinking"for streaming (fromChatCompletionChunk) and non-streaming (fromChatResponse), with tests.Bug Fixes
thinking-role chunks during FIM/autocomplete streaming to prevent polluted completions.Written for commit 81de517. Summary will update on new commits.
Review in cubic