Remove broker session rest

Reverts 062ec07 and 5eb0ea7: every firm's broker session stays logged in
around the clock again, renewing its token on the fixed timer as before.
The tree is back to 6dd2528's. A session_rest row left in settings is
unused.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Brandon Li
2026-10-21 23:39:53 -05:00
co-authored by Claude Opus 5.5
parent 062ec07f0a
commit 5ec5abde6e
19 changed files with 43 additions and 901 deletions
+2 -19
View File
@@ -184,9 +184,8 @@ It is read-only unless `DX_CONFIRM=yes DX_ACCOUNT=<code>` are set too, which
adds one minimum-size live round trip.
`npm run check` runs the pure-logic checks (fees, stops, sizing, trading
hours, session rest times, the DXtrade selector, the futures draw and
instrument lists), plus local HTTP/WebSocket checks against a temporary
database.
hours, the DXtrade selector, the futures draw and instrument lists), plus local
HTTP/WebSocket checks against a temporary database.
### Outbound user agent
@@ -204,22 +203,6 @@ Use `brokerWebSocket` or `signalrWebSocket` from `lib/outbound-proxy.ts` for bro
sockets, and `directWebSocket` for control sockets. All share the same user agent;
the broker proxy still applies only to broker traffic.
### Broker session rest
A firm's broker session is logged out while nothing needs it, rather than kept
up around the clock (`lib/clients.ts`, session rest). Once a firm has nothing
open, nothing pending and nothing left to trade before its next session (the
weekend, the daily break, or a trade date whose accounts are all done) for a
random 15–45 minutes, its client disconnects. The dashboard shows it as
*Resting* with its accounts as last synced. A fresh login comes a random 20–50
minutes before the firm's next session opens, and a long rest is broken by a
check-in every 3–7 hours of the Central daytime. Starting trading, a manual leg,
a copy trade, a manual order or an AutoBuyer run logs a resting firm back in at
once. While logged in, tokens are renewed at random points (Tradovate 15–45
minutes before expiry, TopstepX every 45–150 minutes) rather than on a fixed
timer. Settings → Trading → *Rest idle broker sessions* (`session_rest`) turns
it off; `/api/health` lists each resting firm and when it is back.
---
## The master dashboard