mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 14:38:25 +00:00
refactor(gateway): split server runtime
This commit is contained in:
19
src/gateway/server-model-catalog.ts
Normal file
19
src/gateway/server-model-catalog.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import {
|
||||
loadModelCatalog,
|
||||
type ModelCatalogEntry,
|
||||
resetModelCatalogCacheForTest,
|
||||
} from "../agents/model-catalog.js";
|
||||
import { loadConfig } from "../config/config.js";
|
||||
|
||||
export type GatewayModelChoice = ModelCatalogEntry;
|
||||
|
||||
// Test-only escape hatch: model catalog is cached at module scope for the
|
||||
// process lifetime, which is fine for the real gateway daemon, but makes
|
||||
// isolated unit tests harder. Keep this intentionally obscure.
|
||||
export function __resetModelCatalogCacheForTest() {
|
||||
resetModelCatalogCacheForTest();
|
||||
}
|
||||
|
||||
export async function loadGatewayModelCatalog(): Promise<GatewayModelChoice[]> {
|
||||
return await loadModelCatalog({ config: loadConfig() });
|
||||
}
|
||||
Reference in New Issue
Block a user