Skip to content

Normalize Firstrade account IDs for account-facts-sync match - #393

Merged
Pigbibi merged 1 commit into
mainfrom
fix/ft-afs-normalize-account-numbers
Oct 9, 2026
Merged

Pigbibi merged 1 commit into
mainfrom
fix/ft-afs-normalize-account-numbers

Conversation

@Pigbibi

@Pigbibi Pigbibi commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

After auth was fixed, /account-facts-sync returned HTTP 503 with account_identity_mismatch (collect path). Probe/session reuse is healthy.

Likely cause: Firstrade SDK can leave account_numbers as JSON ints while runtime_target.account_selector is a string, so membership checks fail.

Changes:

  • Coerce account numbers / balances keys to strings in FirstradeBrokerClient
  • Split empty account list to account_list_empty
  • Log masked expected account on collect failure
  • Regression test for int→str selector match

No trading-mode / strategy change.

Cloud Run /account-facts-sync was past auth but returned
account_identity_mismatch. Coerce SDK account numbers (and balances map
keys) to strings so int JSON values match the runtime_target selector,
split empty-list failures, and log a masked expected account on collect
errors.
@Pigbibi
Pigbibi merged commit 3a82e17 into main Oct 9, 2026
1 check passed
@Pigbibi
Pigbibi deleted the fix/ft-afs-normalize-account-numbers branch October 9, 2026 07:58
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