Hi everyone,

What is the supported way for a Python QCAlgorithm on QuantConnect Cloud to determine that IBKR positions, open orders and executions have been reconciled after a disconnect or process restart, before allowing new orders?

The edge case is an order accepted by the broker whose acknowledgement was not durably recorded locally, potentially followed by a fill while disconnected. The goal is to avoid both duplicate entries and incorrectly sized protective stops, using the existing managed connection rather than a second IBKR session.

I reviewed the public LEAN and IB brokerage code. Transactions.GetOpenOrders reads LEAN's local order collection, while the IB adapter has internal broker queries with completion events. The 1101/1102 reconnect paths do not appear to provide the algorithm with a combined reconciliation-complete barrier. This is a question about the supported API/guarantees, not a claim that fills are necessarily lost or a report of a production incident.

Could someone clarify:

1. Is there a supported Python API or event indicating completion and scope of broker reconciliation, tied to a particular reconnect/request? Or is on_brokerage_reconnect intended only as a connectivity notification?
2. How can an algorithm recover executions/statuses for orders fully filled during an outage, including after process restart? What time-window and clientId limitations apply?
3. Which identifiers are available and stable across restart (IB permId, clientId/orderId, execId, orderRef), and how do they map to LEAN BrokerId and reconstructed order tickets?
4. For partially filled open orders loaded at startup, how should original, filled and remaining quantities be verified before replacing a protective stop?
5. If this is not exposed to QCAlgorithm in Cloud, is there a supported extension or recommended recovery pattern? Please distinguish standard IBKR and FIX if the guarantees differ.

Public source revisions reviewed (not assumed to match every Cloud deployment):
LEAN: ebd7268d68609ae85f73de8290d9673afb1992ac
IB brokerage: 25fa440f43542f7a6afed98592fd8a2b6d6536dc
https://github.com/QuantConnect/Lean.Brokerages.InteractiveBrokers/blob/25fa440f43542f7a6afed98592fd8a2b6d6536dc/QuantConnect.InteractiveBrokersBrokerage/InteractiveBrokersBrokerage.cs
https://github.com/QuantConnect/Lean/blob/ebd7268d68609ae85f73de8290d9673afb1992ac/Engine/TransactionHandlers/BrokerageTransactionHandler.cs

A documentation link or minimal example of a supported interface would be very helpful. Thank you!