Fix duplicate IBKR execution and market-data error scoping - #359
Conversation
Co-Authored-By: Codex <noreply@openai.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0a402c1dab
ℹ️ 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".
| "IBKR_MARKET_TIMEZONE", | ||
| "IB_GATEWAY_ZONE", | ||
| "IB_GATEWAY_IP_MODE", | ||
| "IBKR_EXECUTION_DEDUP_ENABLED", |
There was a problem hiding this comment.
Apply per-target dedup overrides before the shared fallback
When the repository-level variable is set and a service's runtime_target.overrides specifies the opposite value, adding this setting to SHARED_TARGET_FALLBACK_ENV makes _target_env_value select the shared value first; the override at lines 432–440 is only consulted when that value is None. For example, a shared false silently overrides a live target's explicit true, disabling deduplication and allowing manual and scheduled runs to submit the same signal, so the per-target override must take precedence.
Useful? React with 👍 / 👎.
| symbol = str(getattr(resolved_contract, "symbol", "") or "").strip().upper() | ||
| return bool(symbol and symbol in self.requested_symbols) |
There was a problem hiding this comment.
Match the actual quote request before suppressing errors
During a snapshot fetch, any other outstanding market-data request on the same IB connection whose contract has the same symbol is treated as part of this fetch, even if it has a different request ID, security type, exchange, or is a pre-existing streaming subscription. If that request emits 10089/10168, its error and subsequent 300 are hidden and included in this fetch's fallback summary, so unrelated subscription failures can still be obscured; suppression needs to be limited to request IDs/contracts initiated by the wrapped fetch rather than symbol equality alone.
Useful? React with 👍 / 👎.
Why
What changed
IBKR_EXECUTION_DEDUP_ENABLEDrepository/runtime setting without silently enabling it by default; explicitfalseremains authoritative.Verification
pytest: 388 passed, 5 skipped, 5 warnings.ruff check: passed for all changed Python files.actionlint: passed for the changed workflow.git diff --check: passed.Production safety
/runendpoint or order submission was triggered during verification.