fix: per-agent model fallbacks (#583) (thanks @mitschabaude-bot)

This commit is contained in:
Peter Steinberger
2026-01-13 06:49:26 +00:00
parent ece01d89fe
commit 3368284b2a
4 changed files with 4 additions and 5 deletions

View File

@@ -6,6 +6,7 @@
- Cron: accept ISO timestamps for one-shot schedules (UTC) and allow optional delete-after-run; wired into CLI + macOS editor.
- Gateway: add Tailscale binary discovery, custom bind mode, and probe auth retry for password changes. (#740 — thanks @jeffersonwarrior)
- Agents: add compaction mode config with optional safeguard summarization for long histories. (#700 — thanks @thewilloftheshadow)
- Agents: support per-agent model fallbacks via `agents.list[].model`. (#583 — thanks @mitschabaude-bot)
- Tools: add tool profiles plus group shorthands for tool policy allow/deny (global, per-agent, sandbox).
### Fixes

View File

@@ -177,7 +177,7 @@ describe("runWithModelFallback", () => {
run: async (provider, model) => {
calls.push({ provider, model });
if (provider === "anthropic") {
throw new Error("primary failed");
throw Object.assign(new Error("nope"), { status: 401 });
}
if (provider === "openai" && model === "gpt-4.1") {
return "ok";

View File

@@ -1,8 +1,8 @@
import crypto from "node:crypto";
import fs from "node:fs";
import { resolveAgentModelFallbacksOverride } from "../../agents/agent-scope.js";
import { runCliAgent } from "../../agents/cli-runner.js";
import { getCliSessionId, setCliSessionId } from "../../agents/cli-session.js";
import { resolveAgentModelFallbacksOverride } from "../../agents/agent-scope.js";
import { lookupContextTokens } from "../../agents/context.js";
import { DEFAULT_CONTEXT_TOKENS } from "../../agents/defaults.js";
import { resolveModelAuthMode } from "../../agents/model-auth.js";

View File

@@ -1,10 +1,8 @@
import { resolveClawdbotAgentDir } from "../../agents/agent-paths.js";
import {
resolveAgentConfig,
resolveAgentDir,
resolveAgentModelPrimary,
resolveDefaultAgentId,
resolveSessionAgentId,
resolveAgentModelPrimary,
} from "../../agents/agent-scope.js";
import {
isProfileInCooldown,