Skip to content

Conversation

@waleedlatif1
Copy link
Collaborator

@waleedlatif1 waleedlatif1 commented Jan 25, 2026

…2986)

* fix(llm): update router and llm_chat tool to call providers routes

* updated failing tests
@vercel
Copy link

vercel bot commented Jan 25, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
docs Ready Ready Preview, Comment Jan 25, 2026 4:33am

Request Review

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 25, 2026

Greptile Overview

Greptile Summary

This PR refactors authentication header handling in executor handlers by replacing hardcoded Content-Type headers with the centralized buildAuthHeaders() utility function.

  • Updated evaluator-handler.ts and router-handler.ts to use buildAuthHeaders() instead of manually setting headers
  • The buildAuthHeaders() utility provides both Content-Type and Authorization headers with internal tokens when running server-side
  • Added mock implementations for the http utils in testing package to support unit tests
  • This change ensures consistent authentication across all provider API calls and aligns with the pattern already used in agent-handler.ts and workflow-handler.ts

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The changes are straightforward refactoring that improves consistency by using an established utility function. The buildAuthHeaders() utility already exists and is used in other handlers (agent, workflow). The mock implementation properly mirrors the actual implementation behavior. No breaking changes or risky logic alterations.
  • No files require special attention

Important Files Changed

Filename Overview
apps/sim/executor/handlers/evaluator/evaluator-handler.ts replaced hardcoded headers with buildAuthHeaders() utility for consistent authentication
apps/sim/executor/handlers/router/router-handler.ts replaced hardcoded headers with buildAuthHeaders() utility in two fetch calls for consistent authentication
packages/testing/src/mocks/executor.mock.ts added mock implementations for buildAuthHeaders, buildAPIUrl, and extractAPIErrorMessage utilities

Sequence Diagram

sequenceDiagram
    participant Handler as Evaluator/Router Handler
    participant Utils as buildAuthHeaders()
    participant API as /api/providers

    Handler->>Utils: Call buildAuthHeaders()
    Utils->>Utils: Create headers with Content-Type
    alt Running on server
        Utils->>Utils: Add authentication to headers
    end
    Utils-->>Handler: Return headers object
    Handler->>API: POST with headers and provider config
    API-->>Handler: Return model response with tokens and cost
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No files reviewed, no comments

Edit Code Review Agent Settings | Greptile

…emas to anthropic format (#2988)

* fix(anthropic): use anthropic sdk to transform malformed response schemas to anthropic format

* copy internal transformJSONSchema from anthropic

* remove dep update

* use built-in func from anthropic
@waleedlatif1 waleedlatif1 merged commit 8bd5d41 into main Jan 25, 2026
25 checks passed
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.

2 participants