fix(consultation): make agentic runtime the default
This commit is contained in:
@@ -135,9 +135,10 @@ function mergeUsage(usages: Promise<Usage>[]): Promise<Usage> {
|
||||
}
|
||||
|
||||
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 !== "canary") return false;
|
||||
if (mode !== "canary") return true;
|
||||
const ids = new Set((process.env.CONSULTATION_AGENTIC_CANARY_USER_IDS ?? "")
|
||||
.split(",").map((value) => value.trim()).filter(Boolean));
|
||||
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(route, /CONSULTATION_AGENTIC_RUNTIME/);
|
||||
assert.match(route, /legacy/);
|
||||
assert.match(route, /canary/);
|
||||
assert.match(route, /CONSULTATION_AGENTIC_RUNTIME\?\.trim\(\)\.toLowerCase\(\) \?\? "enabled"/);
|
||||
assert.match(route, /mode === "legacy"/);
|
||||
assert.match(route, /mode !== "canary"/);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user