2.3 KiB
2.3 KiB
NOTE: diff-ref mode entry (code committed in the same commit as this log); recorded from the live debug session per the /prompt-io skill rules.
git log -1 -p --follow -- piker/brokers/ib/broker.pygit log -1 -p --follow -- piker/brokers/ib/api.py
Key diagnostic chain (from session):
- pdb showed
Client._contracts == {}insidebrokerd.ib‘ssubmit_limit(); the cache has exactly TWO write sites:Client.find_contracts()(api.py, keysf'{sym}.{exch}.ib') andsymbols.get_mkt_info()(keymkt.bs_fqme, eg. ’nvda.nasdaq’ — NO.ibsuffix). BrokerdOrder.symbolarrives as the bs_fqme form (‘nvda.nasdaq’) so ONLY theget_mkt_info()write site produces the keysubmit_limit()reads — ie. pre-split it was the feed’s in-procget_mkt_info(sym, proxy=proxy)call keeping orders working, NOTfind_contracts().- the existing TODO at
symbols.py:642-644literally predicted this: “this is going to be problematic if/when we split out the datad vs. brokerd actors since the mktmap lookup table will now be inaccessible..” - instance identity verified:
proxy._aio_nsIS the sameClientobj as_accounts2clients[account](both sourced from theload_aio_clients()cache viaopen_client_proxies()), so a brokerd-sideget_mkt_info(fqme, proxy=proxies[account])warms exactly the dictsubmit_limit()reads. It also populatesclient._cons2mktswhich the position-audit path (broker.pybackup-table code) needs in this actor anyway. - the
TrioTaskExitedstorm in the user’s log (recv_trade_updates,open_aio_client_method_relayaio tasks) is teardown cascade: the raise crashedhandle_order_requests-> nursery teardown ripped the trio sides of still-running aio relay tasks. Hence the added per-order try/except ->BrokerdErrorrelay hardening so a single bad submission degrades to an EMS error msg instead of killing the backend’s entire order-ctl dialog.
Verification: tests/test_services.py (5 passed) + tests/test_ems.py (6 passed) regression-green; live ib submission retest delegated to the human (needs a running TWS/gw).