feat: update role-tier structure to include prefixes for models and enhance related configurations
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
*/
|
||||
import fs from "node:fs/promises";
|
||||
import path from "node:path";
|
||||
import { DEV_TIERS, QA_TIERS, type Tier } from "../tiers.js";
|
||||
import { DEV_TIERS, QA_TIERS, tierName, type Tier } from "../tiers.js";
|
||||
import { HEARTBEAT_DEFAULTS } from "../services/heartbeat.js";
|
||||
|
||||
function openclawConfigPath(): string {
|
||||
@@ -20,10 +20,10 @@ function buildRoleTierModels(models: Record<Tier, string>): { dev: Record<string
|
||||
const qa: Record<string, string> = {};
|
||||
|
||||
for (const tier of DEV_TIERS) {
|
||||
dev[tier] = models[tier];
|
||||
dev[tierName(tier)] = models[tier];
|
||||
}
|
||||
for (const tier of QA_TIERS) {
|
||||
qa[tier] = models[tier];
|
||||
qa[tierName(tier)] = models[tier];
|
||||
}
|
||||
|
||||
return { dev, qa };
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* Coordinates: agent creation → model config → workspace scaffolding.
|
||||
* Used by both the `setup` tool and the `openclaw devclaw setup` CLI command.
|
||||
*/
|
||||
import { ALL_TIERS, DEFAULT_MODELS, type Tier } from "../tiers.js";
|
||||
import { ALL_TIERS, allDefaultModels, type Tier } from "../tiers.js";
|
||||
import { migrateChannelBinding } from "../binding-manager.js";
|
||||
import { createAgent, resolveWorkspacePath } from "./agent.js";
|
||||
import { writePluginConfig } from "./config.js";
|
||||
@@ -108,7 +108,7 @@ async function tryMigrateBinding(
|
||||
}
|
||||
|
||||
function buildModelConfig(overrides?: Partial<Record<Tier, string>>): Record<Tier, string> {
|
||||
const models = { ...DEFAULT_MODELS };
|
||||
const models = allDefaultModels();
|
||||
if (overrides) {
|
||||
for (const [tier, model] of Object.entries(overrides)) {
|
||||
if (model && (ALL_TIERS as readonly string[]).includes(tier)) {
|
||||
|
||||
Reference in New Issue
Block a user