Skip to content

Commit 947e59c

Browse files
committed
Cleanup and fixes
1 parent f347485 commit 947e59c

2 files changed

Lines changed: 19 additions & 12 deletions

File tree

agent-server/nodejs/src/api-server.js

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -593,26 +593,33 @@ class APIServer {
593593
// 1. Try tier-specific endpoint (e.g., main_model.endpoint)
594594
// 2. Fall back to top-level endpoint (e.g., model.endpoint)
595595
// 3. Fall back to LITELLM_ENDPOINT env var (for litellm provider)
596-
const getEndpoint = (tierConfig) => {
597-
const explicitEndpoint = tierConfig?.endpoint || requestBody.model.endpoint;
596+
// @param {Object} resolvedConfig - Config after extractModelTierConfig (has defaults applied)
597+
// @param {Object} rawTierConfig - Original tier config from request (may be undefined)
598+
const getEndpoint = (resolvedConfig, rawTierConfig) => {
599+
const explicitEndpoint = rawTierConfig?.endpoint || requestBody.model.endpoint;
598600
if (explicitEndpoint) return explicitEndpoint;
599-
// Use env var default for litellm provider
600-
if (tierConfig?.provider === 'litellm') return defaultLiteLLMEndpoint;
601+
// Use env var default for litellm provider (check resolved config for provider)
602+
if (resolvedConfig?.provider === 'litellm') return defaultLiteLLMEndpoint;
601603
return undefined;
602604
};
603605

606+
// Extract tier configs first so getEndpoint can use resolved provider
607+
const mainConfig = this.extractModelTierConfig('main', requestBody.model.main_model, defaults);
608+
const miniConfig = this.extractModelTierConfig('mini', requestBody.model.mini_model, defaults);
609+
const nanoConfig = this.extractModelTierConfig('nano', requestBody.model.nano_model, defaults);
610+
604611
return {
605612
main_model: {
606-
...this.extractModelTierConfig('main', requestBody.model.main_model, defaults),
607-
endpoint: getEndpoint(requestBody.model.main_model)
613+
...mainConfig,
614+
endpoint: getEndpoint(mainConfig, requestBody.model.main_model)
608615
},
609616
mini_model: {
610-
...this.extractModelTierConfig('mini', requestBody.model.mini_model, defaults),
611-
endpoint: getEndpoint(requestBody.model.mini_model)
617+
...miniConfig,
618+
endpoint: getEndpoint(miniConfig, requestBody.model.mini_model)
612619
},
613620
nano_model: {
614-
...this.extractModelTierConfig('nano', requestBody.model.nano_model, defaults),
615-
endpoint: getEndpoint(requestBody.model.nano_model)
621+
...nanoConfig,
622+
endpoint: getEndpoint(nanoConfig, requestBody.model.nano_model)
616623
}
617624
};
618625
}

docker/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
This directory contains Docker configuration files for building and running the Browser Operator DevTools Frontend with integrated Agent Server in a containerized environment.
44

55
> **Deployment Types:** This directory supports **Type 1** (DevTools only) and **Type 2** (DevTools + Agent Server).
6-
> For **Type 3** (full dockerized browser), see the [web-agent](https://github.com/anthropics/web-agent) repository.
7-
> Quick reference: [../CLAUDE.md](../CLAUDE.md)
6+
> For **Type 3** (full dockerized browser), see the [web-agent](https://github.com/BrowserOperator/web-agent) repository.
7+
> Quick reference: [CLAUDE.md](../CLAUDE.md)
88
99
## Overview
1010

0 commit comments

Comments
 (0)