fix(consultation): make agentic runtime the default

This commit is contained in:
Jesse_Chen
2026-08-14 17:20:56 +08:00
parent 26606412a2
commit c6d406e76d
2 changed files with 7 additions and 6 deletions
+3 -2
View File
@@ -135,9 +135,10 @@ function mergeUsage(usages: Promise<Usage>[]): Promise<Usage> {
} }
function shouldUseAgenticRuntime(user: { id: string; app_metadata?: Record<string, unknown> }) { function shouldUseAgenticRuntime(user: { id: string; app_metadata?: Record<string, unknown> }) {
const mode = process.env.CONSULTATION_AGENTIC_RUNTIME?.trim().toLowerCase() ?? "legacy"; const mode = process.env.CONSULTATION_AGENTIC_RUNTIME?.trim().toLowerCase() ?? "enabled";
if (mode === "legacy") return false;
if (mode === "enabled") return true; if (mode === "enabled") return true;
if (mode !== "canary") return false; if (mode !== "canary") return true;
const ids = new Set((process.env.CONSULTATION_AGENTIC_CANARY_USER_IDS ?? "") const ids = new Set((process.env.CONSULTATION_AGENTIC_CANARY_USER_IDS ?? "")
.split(",").map((value) => value.trim()).filter(Boolean)); .split(",").map((value) => value.trim()).filter(Boolean));
const roles = Array.isArray(user.app_metadata?.roles) ? user.app_metadata.roles : []; const roles = Array.isArray(user.app_metadata?.roles) ? user.app_metadata.roles : [];
@@ -65,9 +65,9 @@ test("projects consultation themes through explicit strict workflow taxonomy", (
}); });
test("staging enables the agentic consultation runtime without changing production compose", () => { test("agentic consultation is the safe default and legacy is explicit rollback", () => {
assert.match(stagingCompose, /CONSULTATION_AGENTIC_RUNTIME: enabled/); assert.match(stagingCompose, /CONSULTATION_AGENTIC_RUNTIME: enabled/);
assert.match(route, /CONSULTATION_AGENTIC_RUNTIME/); assert.match(route, /CONSULTATION_AGENTIC_RUNTIME\?\.trim\(\)\.toLowerCase\(\) \?\? "enabled"/);
assert.match(route, /legacy/); assert.match(route, /mode === "legacy"/);
assert.match(route, /canary/); assert.match(route, /mode !== "canary"/);
}); });