Handle missing TQQQ account hash metadata#52
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b9d27598cf
ℹ️ 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".
| sell_order_symbols = ("TQQQ", unlevered_symbol, "SPYI", "QQQI", "BOXX") | ||
| buy_order_symbols = ("SPYI", "QQQI", "TQQQ", unlevered_symbol) | ||
| snapshot_metadata = getattr(snapshot, "metadata", {}) or {} | ||
| account_hash = snapshot_metadata.get("account_hash") if isinstance(snapshot_metadata, dict) else None |
There was a problem hiding this comment.
Preserve account_hash from any Mapping metadata
The new extraction only reads account_hash when snapshot.metadata is a concrete dict, so snapshots that provide metadata as another Mapping type (e.g., MappingProxyType or custom mapping wrappers) will now silently lose account_hash even when the key is present. This is a regression from the prior snapshot.metadata["account_hash"] behavior and can break downstream execution metadata routing for environments that pass non-dict mappings; elsewhere in this repo metadata is normalized via isinstance(..., Mapping) (for example _metadata_mapping in entrypoints/_portfolio_dashboard.py), so this narrower type check is inconsistent.
Useful? React with 👍 / 👎.
Summary
Verification