Fix DCA workflow dispatch inputs#58
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7178a06fcc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| throw new Error("use dca_mode and dca_base_investment_usd instead of extra_variables_json for DCA settings"); | ||
| throw new Error("use dca_mode and dca_base_investment_usd control fields instead of DCA_MODE variables"); | ||
| } | ||
| const dcaExtraControls = dcaPayloadFromObject(extraVariables); |
There was a problem hiding this comment.
Validate JSON DCA controls before dispatch
When callers use the new extra_variables_json route for DCA controls, this sanitizing helper drops invalid values instead of preserving that a control field was supplied; for example {"dca_mode":"smart","dca_base_investment_usd":"0"} on a DCA profile passes normalizeSwitchInputs and gets dispatched, but build_runtime_switch.py later rejects the same payload. Please validate the raw dca_mode/dca_base_investment_usd JSON fields here so the switch API fails synchronously instead of creating a workflow run that fails after dispatch.
Useful? React with 👍 / 👎.
Summary
Tests