Repository navigation
chore: switch off the Robinhood real-money path - #656
Merged
Merged
Conversation
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>
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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>
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>
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 = Falseindomain/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}andPOST /api/v1/robinhood/agents/{id}/live-runanswer 404, before auth (require_robinhood_live).GET /api/auth/robinhood/callbackredirects to/app?robinhood=disabledand never exchanges the code.PATCH /api/v1/agents/{id}refuseslive_trading_enabled: truewith 409.falseis still accepted.Still up, on purpose
GET /api/v1/robinhood/statusaddsenabledand 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_upstreamnow reports whatrevoke_connectionreturned; it used to beTruewhenever the call came back.Editor
hidden. An account that is still linked sees it with only the Disconnect button; nobody else sees it.live_trading_enabledout of the PATCH while the switch is off.app.jsv162,agent-editor.jsv33,styles.cssv160.Copy and docs
/appdrops the two "real money if you connect a brokerage" sentences.live_trading.rst,operating_modes, the architecture API row,local-run.mdand.env.examplenow say the path is switched off.BROKER_TOKEN_ENCRYPTION_KEYmoves out of the Robinhood block in.env.example, because BYOK keys and Financial Datasets keys need it too.Tests:
test_robinhood_live_disabled.pypins 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_pdfwas skipped becausereportlabis 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