Fix Firstrade buying-power sizing and dry-run isolation - #235
Conversation
Co-Authored-By: Codex <noreply@openai.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7abf81daad
ℹ️ 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".
| has_single_sync_target = not str(env.get("SYNC_PLAN_JSON", "") or "").strip() or ( | ||
| isinstance(targets, list) and len(targets) == 1 | ||
| ) |
There was a problem hiding this comment.
Avoid retaining the dispatcher beside direct monitor jobs
When SYNC_PLAN_JSON contains multiple targets and DIRECT_MONITOR_MIGRATION_COMPLETE=true, the scheduler step still creates and resumes the selected service's direct probe and precheck jobs, but this single-target condition forces direct_jobs_exist to remain false and preserves the global dispatcher. Because the preceding environment sync configures MONITOR_DISPATCH_TARGETS_JSON with that same selected service, the dispatcher continues invoking its due monitors alongside the direct jobs, causing duplicate dry-run previews, session checks, and failure notifications. Either remove migrated targets from the dispatcher configuration or retire the dispatcher after all represented targets have direct jobs.
Useful? React with 👍 / 👎.
Why
What changed
Verification
pytest: 202 passed.ruff check: passed for all changed Python files.actionlint: passed for the changed workflow.git diff --check: passed.Production safety