Skip to content

Commit f32a242

Browse files
committed
fix: allow user headers to override default headers and clean up formatting
- Reorder header spread in router-provider.ts so user-provided openAiHeaders can override DEFAULT_HEADERS - Remove unnecessary blank lines after imports for consistency - This matches the pattern used in openai.ts where DEFAULT_HEADERS come first
1 parent 744de4a commit f32a242

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

src/api/providers/fetchers/litellm.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ import { LITELLM_COMPUTER_USE_MODELS } from "@roo-code/types"
55
import type { ModelRecord } from "../../../shared/api"
66

77
import { DEFAULT_HEADERS } from "../constants"
8-
9-
108
/**
119
* Fetches available models from a LiteLLM server
1210
*
@@ -19,7 +17,7 @@ export async function getLiteLLMModels(apiKey: string, baseUrl: string): Promise
1917
try {
2018
const headers: Record<string, string> = {
2119
"Content-Type": "application/json",
22-
...DEFAULT_HEADERS
20+
...DEFAULT_HEADERS,
2321
}
2422

2523
if (apiKey) {

src/api/providers/router-provider.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { getModels } from "./fetchers/modelCache"
99

1010
import { DEFAULT_HEADERS } from "./constants"
1111

12-
1312
type RouterProviderOptions = {
1413
name: RouterName
1514
baseURL: string
@@ -50,9 +49,9 @@ export abstract class RouterProvider extends BaseProvider {
5049
baseURL,
5150
apiKey,
5251
defaultHeaders: {
52+
...DEFAULT_HEADERS,
5353
...(options.openAiHeaders || {}),
54-
...DEFAULT_HEADERS
55-
}
54+
},
5655
})
5756
}
5857

0 commit comments

Comments
 (0)