Skip to content

chore: switch off the Robinhood real-money path - #656

Merged
FlyM1ss merged 4 commits into
mainfrom
chore/comment-out-robinhood-live
Oct 23, 2026
Merged

FlyM1ss merged 4 commits into
mainfrom
chore/comment-out-robinhood-live

Conversation

@FlyM1ss

@FlyM1ss FlyM1ss commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

Real capital is out of scope under the 2026-10-14 direction. This PR switches off the Robinhood real-money path with one constant, ROBINHOOD_LIVE_ENABLED = False in domain/backtesting/constants.py. The code behind it stays mounted and under test, so turning it back on means flipping that line, plus the copy and doc steps listed in CLAUDE.md (execution/).

Off

  • POST /api/auth/robinhood/{start,complete} and POST /api/v1/robinhood/agents/{id}/live-run answer 404, before auth (require_robinhood_live).
  • GET /api/auth/robinhood/callback redirects to /app?robinhood=disabled and never exchanges the code.
  • PATCH /api/v1/agents/{id} refuses live_trading_enabled: true with 409. false is still accepted.

Still up, on purpose

  • GET /api/v1/robinhood/status adds enabled and skips the portfolio read. This is the editor's only copy of the switch; there is no JS mirror.
  • DELETE /api/v1/robinhood/disconnect, so an account linked before the switch can still delete its stored tokens. revoked_upstream now reports what revoke_connection returned; it used to be True whenever the call came back.

Editor

  • The panel ships hidden. An account that is still linked sees it with only the Disconnect button; nobody else sees it.
  • Save leaves live_trading_enabled out of the PATCH while the switch is off.
  • Cache-busters: app.js v162, agent-editor.js v33, styles.css v160.

Copy and docs

  • /app drops the two "real money if you connect a brokerage" sentences.
  • live_trading.rst, operating_modes, the architecture API row, local-run.md and .env.example now say the path is switched off.
  • BROKER_TOKEN_ENCRYPTION_KEY moves out of the Robinhood block in .env.example, because BYOK keys and Financial Datasets keys need it too.

Tests: test_robinhood_live_disabled.py pins the off state by behaviour: the routes, the PATCH refusal, and the editor run under node. It also flips the flag to show that each route reaches its handler when the switch is on. I mutation-checked it: removing any one of nine guards makes it fail. Local full backend suite: 6947 passed, 0 failed (test_report_pdf was skipped because reportlab is not installed locally).

Agents armed before the switch keep live_trading_enabled. CLAUDE.md says to clear that column before turning the path back on.

🤖 Generated with Claude Code

Real capital is out of scope (2026-10-14 direction). Unmount every entry
point (the /api/v1/robinhood router, the /api/auth/robinhood/* OAuth
decorators, the agent editor's broker panel and its JS call sites) and keep
the modules, adapters, broker store and their tests for a restore.

test_robinhood_live_disabled.py pins the disabled state; CLAUDE.md
(execution/) holds the restore steps.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
agentic-trading-lab Ready Ready Preview Oct 23, 2026 2:20am UTC

FlyM1ss and others added 2 commits October 22, 2026 22:03
Resolves the CLAUDE.md conflict with #652's last commit (f4aa2aa):
main's billing and LLM-safety text, the PR's execution/ bullet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review of #656. ROBINHOOD_LIVE_ENABLED (domain/backtesting/constants.py)
replaces the commented-out mounts, decorators, panel and call sites, so
the code stays imported and tested and a restore is one line.

- Off: start, complete and live-run answer 404 before auth; the OAuth
  callback redirects to /app?robinhood=disabled without exchanging its
  code; PATCH /api/v1/agents refuses live_trading_enabled=true (409).
- Kept up: status (now reports `enabled`, no portfolio read) and
  disconnect, so linked accounts can still delete their stored tokens.
  revoked_upstream now reports revoke_connection's answer.
- Editor: panel ships hidden, shows a linked account only Disconnect,
  and save omits live_trading_enabled while off.
- .env.example: BROKER_TOKEN_ENCRYPTION_KEY moves out of the Robinhood
  block; it also guards BYOK and Financial Datasets keys.
- test_robinhood_live_disabled.py pins this by behaviour (routes, PATCH,
  editor under node) and flips the flag to show the restore works.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@FlyM1ss FlyM1ss changed the title chore: comment out the Robinhood real-money path chore: switch off the Robinhood real-money path Oct 23, 2026
Comment thread dashboard/backend/tests/test_robinhood_live_disabled.py Fixed
Comment thread dashboard/backend/tests/test_robinhood_live_disabled.py Fixed
Fixes CodeQL py/import-and-import-from (alerts 1467, 1468) in
test_robinhood_live_disabled.py.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@FlyM1ss
FlyM1ss merged commit 59ac7f7 into main Oct 23, 2026
8 checks passed

This branch was successfully deployed

1 active deployment
Preview — 731439d6 Deployed Oct 23, 2026 by vercel[bot]
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.

2 participants