piker/ai/prompt-io/claude/20260610T213549Z_f084e899_p...

2.0 KiB
Raw Blame History

Prompt

User bug report from live ib testing of the (datad|brokerd)-split branch:

ok doing some testing and noticing live orders do not work otb, pikerd show this on live submission, [pdb traceback: RuntimeError("Can not order {symbol}, no live feed?") at ib/api.py:1152 submit_limit() with self._contracts == {} in the brokerd.ib actor + a TrioTaskExited teardown cascade]

Follow-up user direction fixing the design intent:

i think the main thing here is that [brokerd] should be able to always submit orders without a live feed being up and registered in the same subactor right?

Response summary

Root cause: pre-split the feed code populated the actor-local Client._contracts cache (via get_mkt_info() writing mkt.bs_fqme keys) in the SAME process as order submission; post-split the trading actors client is never warmed. Fix: lazily qualify + cache the contract per order request in handle_order_requests() by running the same get_mkt_info(fqme, proxy=...) ep the feed side uses, plus per-order error relay (BrokerdError) so one bad submission cant crash the whole trades dialog (the TrioTaskExited storm was teardown cascade from the original raise).

Files changed

  • piker/brokers/ib/broker.py — thread proxies into handle_order_requests(); lazy contract qualify on cache-miss; guard submit_limit() w/ BrokerdError relay; uncomment the (anticipatory) get_mkt_info import
  • piker/brokers/ib/api.py — fix the non-f-string raise msg + document the new qualification contract

Human edits

None — committed as generated. Live ib order retest performed by the human post-commit.