feat: wire multi-agent config and routing

Co-authored-by: Mark Pors <1078320+pors@users.noreply.github.com>
This commit is contained in:
Peter Steinberger
2026-01-09 12:44:23 +00:00
parent 81beda0772
commit 7b81d97ec2
189 changed files with 4340 additions and 2903 deletions

View File

@@ -57,7 +57,9 @@ function makeRuntime() {
describe("models list/status", () => {
it("models status resolves z.ai alias to canonical zai", async () => {
loadConfig.mockReturnValue({ agent: { model: "z.ai/glm-4.7" } });
loadConfig.mockReturnValue({
agents: { defaults: { model: "z.ai/glm-4.7" } },
});
const runtime = makeRuntime();
const { modelsStatusCommand } = await import("./models/list.js");
@@ -69,7 +71,9 @@ describe("models list/status", () => {
});
it("models status plain outputs canonical zai model", async () => {
loadConfig.mockReturnValue({ agent: { model: "z.ai/glm-4.7" } });
loadConfig.mockReturnValue({
agents: { defaults: { model: "z.ai/glm-4.7" } },
});
const runtime = makeRuntime();
const { modelsStatusCommand } = await import("./models/list.js");
@@ -80,7 +84,9 @@ describe("models list/status", () => {
});
it("models list outputs canonical zai key for configured z.ai model", async () => {
loadConfig.mockReturnValue({ agent: { model: "z.ai/glm-4.7" } });
loadConfig.mockReturnValue({
agents: { defaults: { model: "z.ai/glm-4.7" } },
});
const runtime = makeRuntime();
const model = {
@@ -106,7 +112,9 @@ describe("models list/status", () => {
});
it("models list plain outputs canonical zai key", async () => {
loadConfig.mockReturnValue({ agent: { model: "z.ai/glm-4.7" } });
loadConfig.mockReturnValue({
agents: { defaults: { model: "z.ai/glm-4.7" } },
});
const runtime = makeRuntime();
const model = {
@@ -131,7 +139,9 @@ describe("models list/status", () => {
});
it("models list provider filter normalizes z.ai alias", async () => {
loadConfig.mockReturnValue({ agent: { model: "z.ai/glm-4.7" } });
loadConfig.mockReturnValue({
agents: { defaults: { model: "z.ai/glm-4.7" } },
});
const runtime = makeRuntime();
const models = [
@@ -171,7 +181,9 @@ describe("models list/status", () => {
});
it("models list provider filter normalizes Z.AI alias casing", async () => {
loadConfig.mockReturnValue({ agent: { model: "z.ai/glm-4.7" } });
loadConfig.mockReturnValue({
agents: { defaults: { model: "z.ai/glm-4.7" } },
});
const runtime = makeRuntime();
const models = [
@@ -211,7 +223,9 @@ describe("models list/status", () => {
});
it("models list provider filter normalizes z-ai alias", async () => {
loadConfig.mockReturnValue({ agent: { model: "z.ai/glm-4.7" } });
loadConfig.mockReturnValue({
agents: { defaults: { model: "z.ai/glm-4.7" } },
});
const runtime = makeRuntime();
const models = [
@@ -251,7 +265,9 @@ describe("models list/status", () => {
});
it("models list marks auth as unavailable when ZAI key is missing", async () => {
loadConfig.mockReturnValue({ agent: { model: "z.ai/glm-4.7" } });
loadConfig.mockReturnValue({
agents: { defaults: { model: "z.ai/glm-4.7" } },
});
const runtime = makeRuntime();
const model = {