Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions tests/strategy_switch_worker_validation.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 4 additions & 1 deletion web/strategy-switch-console/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down