Route IBKR live orders by account group#55
Conversation
000418f to
bdff227
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 000418fa6f
ℹ️ 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".
| safe_haven_symbol = safe_haven_symbols[0] if safe_haven_symbols else None | ||
| equity = account_values.get("equity", 0) | ||
| normalized_account_ids = _normalize_account_ids(account_ids) | ||
| order_account_id = _resolve_order_account_id(normalized_account_ids) |
There was a problem hiding this comment.
Reject multi-account IDs only when submitting real orders
execute_rebalance now calls _resolve_order_account_id at function start, so any account_ids with more than one value raises ValueError even in dry_run_only=True runs or other early-exit paths where no order would be sent. That regresses dry-run/validation workflows for multi-account groups and does not match the stated behavior of failing when the service actually attempts real order routing; the check should be deferred to the non-dry-run submission path (or gated by a live-order mode flag).
Useful? React with 👍 / 👎.
Summary
Tests