diff --git a/tests/strategy_switch_worker_validation.mjs b/tests/strategy_switch_worker_validation.mjs index 5e12236..39bda39 100644 --- a/tests/strategy_switch_worker_validation.mjs +++ b/tests/strategy_switch_worker_validation.mjs @@ -752,6 +752,14 @@ const normalizedLegacyAutoPluginInputs = __test.normalizeSwitchInputs({ plugin_mode: "auto", }); assert.equal(normalizedLegacyAutoPluginInputs.plugin_mode, "none"); +const normalizedCurrentPluginInputs = __test.normalizeSwitchInputs({ + platform: "ibkr", + target_name: "ibkr-primary", + strategy_profile: "tqqq_growth_income", + execution_mode: "live", + plugin_mode: "current", +}); +assert.equal(normalizedCurrentPluginInputs.plugin_mode, "current"); assert.throws( () => __test.normalizeSwitchInputs({ platform: "ibkr", diff --git a/web/strategy-switch-console/worker.js b/web/strategy-switch-console/worker.js index 9150b11..911b960 100644 --- a/web/strategy-switch-console/worker.js +++ b/web/strategy-switch-console/worker.js @@ -4447,7 +4447,10 @@ function normalizeSwitchInputs(raw) { if (!supportedExecutionModesForPlatform(platform).includes(executionMode)) { throw new Error(`${platform} does not support ${executionMode} control execution`); } - const requestedPluginMode = cleanChoice(raw.plugin_mode || "none", ["auto", "none"], "plugin_mode"); + // "current" is used only by internal deployment reconciliation to retain + // a service's existing plugin mount. It is deliberately not exposed as a + // console editing mode, where operators can still select only "none". + const requestedPluginMode = cleanChoice(raw.plugin_mode || "none", ["auto", "none", "current"], "plugin_mode"); const pluginMode = requestedPluginMode === "auto" ? "none" : requestedPluginMode; if (String(raw.custom_plugin_mounts_json || "").trim()) { throw new Error("legacy custom plugin mounts are retired pending a P1/P2/P3-bound signal.v2 adapter");