[codex] Add IBKR dry-run report summary - #133
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4deeac6203
ℹ️ 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".
| recorded_delivery_events.append( | ||
| { | ||
| "sink": "telegram", | ||
| "delivery_status": "sent", |
There was a problem hiding this comment.
Avoid marking failed Telegram delivery as sent
In environments where Telegram is not configured or the API returns a non-2xx response, send_tg_message/send_telegram_message returns without raising (it only logs failures), but this wrapper still appends a delivery_status: "sent" event. That makes the new dry-run evidence report claim notification delivery succeeded even when no Telegram message was actually delivered; the recorder needs an explicit success signal or should not record sent for silent/no-op failures.
Useful? React with 👍 / 👎.
| execution_summary.get("orders_skipped"), | ||
| reconciliation_record.get("orders_skipped"), | ||
| ) | ||
| orders_previewed_count = orders_submitted_count if dry_run else 0 |
There was a problem hiding this comment.
Count dry-run option previews in the report
When a dry run contains only option intents, execute_rebalance records those previews in execution_summary["option_orders_submitted"] and even treats them as an executed cycle, but orders_submitted remains empty. Deriving orders_previewed_count only from stock orders_submitted_count makes orders_previewed_count zero and dry_run_order_preview_available false for real option order previews, so the machine-readable dry-run report loses evidence for option-only plans.
Useful? React with 👍 / 👎.
Summary
orders_previewed_countanddry_run_order_preview_availableso dry-run runtime reports can feed HK live-enable evidence drafting consistently with LongBridge.Validation
python3 -m ruff check main.py tests/test_request_handling.py→ passed.venv/bin/python -m pytest -q tests/test_request_handling.py tests/test_runtime_reporting_adapters.py tests/test_rebalance_service.py tests/test_notifications.py tests/test_notification_events.py→42 passedNotes
hk_low_vol_dividend_qualityvalidation.