Skip to content

[codex] fix Schwab strategy account equity#115

Merged
Pigbibi merged 2 commits into
mainfrom
codex/fix-strategy-total-equity
Jun 10, 2026
Merged

[codex] fix Schwab strategy account equity#115
Pigbibi merged 2 commits into
mainfrom
codex/fix-strategy-total-equity

Conversation

@Pigbibi

@Pigbibi Pigbibi commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Override total_strategy_equity in Schwab account-state conversion to use filtered strategy market value plus available cash.
  • Keep behavior scoped to configured managed symbols.

Root Cause

The platform consumes shared account-state conversion, and old pinned shared-kit versions can still copy full broker snapshot equity.

Validation

  • python3 -m py_compile application/runtime_strategy_adapters.py
  • Lightweight direct adapter check for filtered strategy equity.

@Pigbibi Pigbibi merged commit 32215e1 into main Jun 10, 2026
1 check passed
@Pigbibi Pigbibi deleted the codex/fix-strategy-total-equity branch June 10, 2026 20:18

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5c91bc2e5b

ℹ️ 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".

Comment on lines +135 to +137
account_state["total_strategy_equity"] = float(account_state["available_cash"]) + sum(
float(value) for value in dict(account_state["market_values"]).values()
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Update the scoped-equity regression test

With managed symbols configured, this override now returns available_cash + sum(filtered market_values); the existing RequestHandlingTests.test_build_account_state_from_snapshot_uses_strategy_symbols fixture has $8,000 cash and $6,000 in managed holdings, but still asserts total_strategy_equity == 50000.0, so CI will fail once the pinned dependencies are installed. Please update that regression test to the new scoped-equity expectation (or add an equivalent test here) with this behavior change.

Useful? React with 👍 / 👎.

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