Skip to content

Commit 16065ad

Browse files
authored
Merge pull request #332 from QuantStrategyLab/fix/console-current-plugin-sync
fix: preserve current plugin mode during account sync
2 parents 3872383 + a58dfbc commit 16065ad

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

tests/strategy_switch_worker_validation.mjs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -752,6 +752,14 @@ const normalizedLegacyAutoPluginInputs = __test.normalizeSwitchInputs({
752752
plugin_mode: "auto",
753753
});
754754
assert.equal(normalizedLegacyAutoPluginInputs.plugin_mode, "none");
755+
const normalizedCurrentPluginInputs = __test.normalizeSwitchInputs({
756+
platform: "ibkr",
757+
target_name: "ibkr-primary",
758+
strategy_profile: "tqqq_growth_income",
759+
execution_mode: "live",
760+
plugin_mode: "current",
761+
});
762+
assert.equal(normalizedCurrentPluginInputs.plugin_mode, "current");
755763
assert.throws(
756764
() => __test.normalizeSwitchInputs({
757765
platform: "ibkr",

web/strategy-switch-console/worker.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4447,7 +4447,10 @@ function normalizeSwitchInputs(raw) {
44474447
if (!supportedExecutionModesForPlatform(platform).includes(executionMode)) {
44484448
throw new Error(`${platform} does not support ${executionMode} control execution`);
44494449
}
4450-
const requestedPluginMode = cleanChoice(raw.plugin_mode || "none", ["auto", "none"], "plugin_mode");
4450+
// "current" is used only by internal deployment reconciliation to retain
4451+
// a service's existing plugin mount. It is deliberately not exposed as a
4452+
// console editing mode, where operators can still select only "none".
4453+
const requestedPluginMode = cleanChoice(raw.plugin_mode || "none", ["auto", "none", "current"], "plugin_mode");
44514454
const pluginMode = requestedPluginMode === "auto" ? "none" : requestedPluginMode;
44524455
if (String(raw.custom_plugin_mounts_json || "").trim()) {
44534456
throw new Error("legacy custom plugin mounts are retired pending a P1/P2/P3-bound signal.v2 adapter");

0 commit comments

Comments
 (0)