Skip to content

Fix strategy switch cash/reserve sync conflict#148

Merged
Pigbibi merged 1 commit into
mainfrom
fix/strategy-switch-cash-reserve-sync
Jul 2, 2026
Merged

Fix strategy switch cash/reserve sync conflict#148
Pigbibi merged 1 commit into
mainfrom
fix/strategy-switch-cash-reserve-sync

Conversation

@Pigbibi

@Pigbibi Pigbibi commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Why

  • When loading account config, cash-only (allow margin) and reserved-cash override can be both detected from backend.
  • Sync flow previously set reserve fields first, then cash-only, leaving reserve policy as existing value (ratio/max/floor) while disabling reserve controls.

What changed

  • In syncStrategyForAccount, add one-line reconciliation after reserve/cash-only sync to clear reserve override when margin is enabled.
  • Regenerated web/strategy-switch-console/app_js.js.
  • Added regression coverage in tests/test_cash_financing.js for initial sync mutual-exclusion behavior.

Validation

  • node tests/test_cash_financing.js
  • node tests/strategy_switch_worker_validation.mjs

Co-Authored-By: Codex <noreply@openai.com>
@chatgpt-codex-connector

This comment has been minimized.

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

🤖 Codex PR Review

⚠️ Review skipped: The Codex review could not be completed.

No Codex service URL or API key configured. Set CODEX_AUDIT_SERVICE_URL, ANTHROPIC_API_KEY, or OPENAI_API_KEY.

Please ensure a human reviewer checks this PR before merging.

@Pigbibi Pigbibi merged commit 920b91c into main Jul 2, 2026
8 checks passed
@Pigbibi Pigbibi deleted the fix/strategy-switch-cash-reserve-sync branch July 2, 2026 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant