refactor: only handle test environments

This commit is contained in:
Jacob Kim 2025-08-06 15:51:12 -07:00
parent e480bcf9d0
commit 51ef9a9ec7

View file

@ -1,15 +1,13 @@
type NextEditModelName = "mercury-coder-nextedit";
export function isNextEditTest(): boolean {
const enabled = process.env.NEXT_EDIT_TEST_ENABLED;
export function isModelCapableOfNextEdit(modelName: string): boolean {
// In test mode, we can control whether next edit is enabled via environment variable.
if (process.env.NEXT_EDIT_TEST_ENABLED === "false") {
if (enabled === "false") {
return false;
}
if (process.env.NEXT_EDIT_TEST_ENABLED === "true") {
if (enabled === "true") {
return true;
}
const supportedModels: NextEditModelName[] = ["mercury-coder-nextedit"];
return supportedModels.some((supported) => modelName.includes(supported));
return false;
}