feat(router): expose reasoning output in router v2 block#2945
Merged
waleedlatif1 merged 1 commit intostagingfrom Jan 22, 2026
Merged
feat(router): expose reasoning output in router v2 block#2945waleedlatif1 merged 1 commit intostagingfrom
waleedlatif1 merged 1 commit intostagingfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
Greptile SummaryThis PR adds a Key changes:
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Client as Router Handler
participant API as Provider API
participant LLM as Language Model
Client->>Client: Build responseFormat with JSON schema<br/>(route, reasoning fields)
Client->>API: POST /api/providers<br/>with responseFormat
API->>LLM: Request with structured output schema
alt LLM returns valid JSON
LLM-->>API: {"route": "route-id", "reasoning": "..."}
API-->>Client: JSON response in content field
Client->>Client: Parse JSON from result.content
Client->>Client: Extract route and reasoning
else LLM returns plain text
LLM-->>API: "route-id" (plain text)
API-->>Client: Plain text response
Client->>Client: JSON.parse fails
Client->>Client: Fallback: use content as route<br/>reasoning = ""
end
alt Route is NO_MATCH
Client->>Client: Throw error with reasoning
else Route is valid
Client->>Client: Find route in routes array
Client->>Client: Return output with reasoning
end
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
539ab5a to
7d741e0
Compare
waleedlatif1
added a commit
that referenced
this pull request
Jan 22, 2026
…lution consolidation, helm updates (#2946) * improvement(workflow-item): stabilize avatar layout and fix name truncation (#2939) * improvement(workflow-item): stabilize avatar layout and fix name truncation * fix(avatars): revert overflow bg to hardcoded color for contrast * fix(executor): stop parallel execution when block errors (#2940) * improvement(helm): add per-deployment extraVolumes support (#2942) * fix(gmail): expose messageId field in read email block (#2943) * fix(resolver): consolidate reference resolution (#2941) * fix(resolver): consolidate code to resolve references * fix edge cases * use already formatted error * fix multi index * fix backwards compat reachability * handle backwards compatibility accurately * use shared constant correctly * feat(router): expose reasoning output in router v2 block (#2945) * fix(copilot): always allow, credential masking (#2947) * Fix always allow, credential validation * Credential masking * Autoload * fix(executor): handle condition dead-end branches in loops (#2944) --------- Co-authored-by: Vikhyath Mondreti <vikhyathvikku@gmail.com> Co-authored-by: Siddharth Ganesan <33737564+Sg312@users.noreply.github.com>
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.
Summary
reasoningoutput to Router V2 block that explains why a route was chosenresponseFormatto enforce structured JSON responses from LLMType of Change
Testing
Checklist