refactor(config): drop agent.provider

This commit is contained in:
Peter Steinberger
2025-12-26 00:43:44 +01:00
parent 8b815bce94
commit 1ef888ca23
14 changed files with 98 additions and 61 deletions

View File

@@ -102,8 +102,7 @@ describe("directive parsing", () => {
{},
{
agent: {
provider: "anthropic",
model: "claude-opus-4-5",
model: "anthropic/claude-opus-4-5",
workspace: path.join(home, "clawd"),
},
routing: {
@@ -130,8 +129,7 @@ describe("directive parsing", () => {
{},
{
agent: {
provider: "anthropic",
model: "claude-opus-4-5",
model: "anthropic/claude-opus-4-5",
workspace: path.join(home, "clawd"),
},
session: { store: path.join(home, "sessions.json") },
@@ -183,8 +181,7 @@ describe("directive parsing", () => {
{},
{
agent: {
provider: "anthropic",
model: "claude-opus-4-5",
model: "anthropic/claude-opus-4-5",
workspace: path.join(home, "clawd"),
},
routing: {
@@ -245,8 +242,7 @@ describe("directive parsing", () => {
{},
{
agent: {
provider: "anthropic",
model: "claude-opus-4-5",
model: "anthropic/claude-opus-4-5",
workspace: path.join(home, "clawd"),
},
routing: {
@@ -274,8 +270,7 @@ describe("directive parsing", () => {
{},
{
agent: {
provider: "anthropic",
model: "claude-opus-4-5",
model: "anthropic/claude-opus-4-5",
workspace: path.join(home, "clawd"),
allowedModels: ["anthropic/claude-opus-4-5", "openai/gpt-4.1-mini"],
},
@@ -301,8 +296,7 @@ describe("directive parsing", () => {
{},
{
agent: {
provider: "anthropic",
model: "claude-opus-4-5",
model: "anthropic/claude-opus-4-5",
workspace: path.join(home, "clawd"),
allowedModels: ["openai/gpt-4.1-mini"],
},
@@ -340,8 +334,7 @@ describe("directive parsing", () => {
{},
{
agent: {
provider: "anthropic",
model: "claude-opus-4-5",
model: "anthropic/claude-opus-4-5",
workspace: path.join(home, "clawd"),
allowedModels: ["openai/gpt-4.1-mini"],
},

View File

@@ -35,8 +35,7 @@ async function withTempHome<T>(fn: (home: string) => Promise<T>): Promise<T> {
function makeCfg(home: string) {
return {
agent: {
provider: "anthropic",
model: "claude-opus-4-5",
model: "anthropic/claude-opus-4-5",
workspace: join(home, "clawd"),
},
routing: {
@@ -168,8 +167,7 @@ describe("trigger handling", () => {
{},
{
agent: {
provider: "anthropic",
model: "claude-opus-4-5",
model: "anthropic/claude-opus-4-5",
workspace: join(home, "clawd"),
},
routing: {
@@ -210,8 +208,7 @@ describe("trigger handling", () => {
{},
{
agent: {
provider: "anthropic",
model: "claude-opus-4-5",
model: "anthropic/claude-opus-4-5",
workspace: join(home, "clawd"),
},
routing: {
@@ -250,8 +247,7 @@ describe("trigger handling", () => {
{},
{
agent: {
provider: "anthropic",
model: "claude-opus-4-5",
model: "anthropic/claude-opus-4-5",
workspace: join(home, "clawd"),
},
routing: {

View File

@@ -730,7 +730,6 @@ export async function getReplyFromConfig(
const heartbeatSeconds = resolveHeartbeatSeconds(cfg, undefined);
const statusText = buildStatusMessage({
agent: {
provider,
model,
contextTokens,
thinkingDefault: agentCfg?.thinkingDefault,

View File

@@ -11,7 +11,10 @@ afterEach(() => {
describe("buildStatusMessage", () => {
it("summarizes agent readiness and context usage", () => {
const text = buildStatusMessage({
agent: { provider: "anthropic", model: "pi:opus", contextTokens: 32_000 },
agent: {
model: "anthropic/pi:opus",
contextTokens: 32_000,
},
sessionEntry: {
sessionId: "abc",
updatedAt: 0,
@@ -112,8 +115,7 @@ describe("buildStatusMessage", () => {
const text = buildStatusMessageDynamic({
agent: {
provider: "anthropic",
model: "claude-opus-4-5",
model: "anthropic/claude-opus-4-5",
contextTokens: 32_000,
},
sessionEntry: {

View File

@@ -202,11 +202,9 @@ export function buildStatusMessage(args: StatusArgs): string {
const optionsLine = `Options: thinking=${thinkLevel} | verbose=${verboseLevel} (set with /think <level>, /verbose on|off, /model <id>)`;
const modelLabel = args.agent?.provider?.trim()
? `${args.agent.provider}/${args.agent?.model ?? model}`
: model
? model
: "unknown";
const modelLabel = model
? `${resolved.provider}/${model}`
: "unknown";
const agentLine = `Agent: embedded pi • ${modelLabel}`;