Skip to content

Commit 0fdf2d3

Browse files
Pigbibiclaude
andauthored
fix(ui): exclude non-runtime strategies from switch dropdown (#175)
strategyAllowedForAccount had a loophole: runtime_enabled was only checked when allowed_execution_modes was empty. In paper mode, strategies with runtime_enabled=false but paper in allowed_execution_modes (e.g. shadow_candidate, live_candidate) would pass the filter and appear in the strategy dropdown. Fix: check runtime_enabled first, before any mode-specific logic. The strategy-switch-console is for live/runtime strategies only. Co-authored-by: Claude <noreply@anthropic.com>
1 parent 7a37ed9 commit 0fdf2d3

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

web/strategy-switch-console/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1584,13 +1584,13 @@
15841584
const cleanProfile = cleanStrategyProfile(profile);
15851585
const catalogEntry = strategyCatalogEntry(cleanProfile);
15861586
if (!catalogEntry.profile) return false;
1587+
if (catalogEntry.runtime_enabled !== true) return false;
15871588
if (dcaConfigForStrategy(cleanProfile) && !platformSupportsDca(platform)) return false;
15881589
if (!supportedDomainsForAccount(platform, account).includes(catalogEntry.domain)) return false;
15891590
const mode = normalizeExecutionMode(executionMode, false);
15901591
if (mode === "live") return strategyCanSwitchLive(catalogEntry);
15911592
const allowedModes = normalizeAllowedExecutionModes(catalogEntry.allowed_execution_modes);
15921593
if (allowedModes.length && !allowedModes.includes(mode)) return false;
1593-
if (catalogEntry.runtime_enabled !== true && !allowedModes.length) return false;
15941594
return true;
15951595
}
15961596

web/strategy-switch-console/app_js.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)