provide-terminal
2026-03-17
WebSocket session resumption, gateway split into a package, and generic swarm manager module
110 files · 11,188+ · 746-
WebSocket session resumption
12 files changed
resume.pySession resume logic — role and hijack ownership survive reconnectcore.pyHub core updated for resume token handlingconnections.pyConnections updated for resume flowbrowser_handlers.pyBrowser handlers updated for resumewebsockets.pyWebSocket routes updated for resumews_routes.pyCF WS routes with session resume supportsession_runtime.pyDO session runtime with resume token handlingstore.pyCF state store updates for resumetest_resume.pySession resume teststest_ws_resume.pyWebSocket resume teststest_cf_resume.pyCF resume teststest_e2e_ws.pyCF E2E WebSocket tests
- WebSocket sessions can now resume after disconnect; role assignments and hijack ownership survive reconnect. Resume tokens implemented in the gateway layer.
interface
behavioral
4 files
resume.pycore.pywebsockets.pyws_routes.py
Split gateway.py into a package
4 files changed
__init__.pyGateway package init — replaces monolithic gateway.py_colors.pyColor handling extracted into submodule_gateway.pyCore gateway logicgateway.pyLegacy gateway.py (superseded)
gateway.pyrefactored into a proper package structure for maintainability. decouple internal3 files
__init__.py_colors.py_gateway.py
- Added IAC stripping, CRLF normalization, and color downgrade features to the gateway. Fixed telnet=True wiring in
TelnetWsGateway._handle. remediate internal1 file
_gateway.py
Generic swarm manager module
18 files changed
__init__.pyManager package initapp.pyManager FastAPI appauth.pyManager authcli.pyManager CLIconfig.pyManager configurationconstants.pyManager constantscore.pyManager core — bot/agent lifecyclemodels.pyManager data modelsprocess.pyProcess managementprotocols.pyManager protocols__init__.pyRoutes packagebot_ops.pyBot operations routesbot_update.pyBot update routesmodels.pyRoute modelsspawn.pyBot spawn routesstatus.pyStatus routes__init__.pyTimeseries subpackagemanager.pyTimeseries manager
- Added a generic
swarm managermodule toundef.terminal.managerfor managing multiple bot/agent connections. Includes FastAPI app, CLI, auth, process management, bot operation routes, spawn routes, and a timeseries manager. instantiate behavioral5 files
core.pyprocess.pyspawn.pybot_ops.pymanager.py
Consolidate hardcoded constants into TerminalDefaults
2 files changed
defaults.pyCentralized TerminalDefaults classtest_defaults.pyTerminalDefaults tests
Manager branch coverage — 98-100%
16 files changed
__init__.pyManager tests packagetest_app.pyManager app teststest_auth.pyManager auth teststest_cli.pyManager CLI teststest_config.pyManager config teststest_constants.pyManager constants teststest_core.pyManager core teststest_coverage_final.pyFinal coverage gap teststest_coverage_gaps.pyCoverage gap teststest_models.pyManager model teststest_process.pyProcess management teststest_process_extra.pyExtra process teststest_protocols.pyProtocol teststest_routes.pyManager route teststest_routes_extra.pyExtra route teststest_timeseries.pyTimeseries tests
CF snapshot broadcast fix
2 files changed
contracts.pyContracts updated for snapshot broadcaststore.pyState store with snapshot broadcast fix
- Fixed snapshot broadcast and event store for pywrangler.
remediate
behavioral
2 files
store.pycontracts.py
Cloudflare DO architecture docs and 0.4.0 readiness
7 files changed
cf-do-architecture.mdCF Durable Objects architecture — lifecycle, hibernation, SQLite schema, session resumeproposal-ws-session-resumption.mdWebSocket session resumption design proposalproduction-readiness-pass2.mdProduction readiness checklist pass 2protocol-matrix.mdProtocol matrix updateREADME.mdREADME updateHANDOFF.mdHANDOFF updated for 0.4.0 milestoneREADME.mdCloudflare package README
- Documented Cloudflare Durable Objects architecture covering lifecycle, hibernation quirks, SQLite schema, and session resume. Added Mermaid diagrams to DO architecture docs.
specify
internal
2 files
cf-do-architecture.mdproposal-ws-session-resumption.md
- Updated protocol matrix, READMEs, readiness gates, and HANDOFF for 0.4.0 milestone (2126 tests, 100% coverage).
qualify
internal
3 files
protocol-matrix.mdproduction-readiness-pass2.mdHANDOFF.md
Gateway and transport test suites
8 files changed
test_gateway_helpers_iac.pyIAC stripping gateway helper tests (385 lines)test_gateway_pump.pyGateway pump tests (331 lines, renamed from test_gateway.py)test_gateway_ssh.pyGateway SSH tests (238 lines)test_ssh_gateway.pySSH gateway E2E teststest_cli.pyCLI teststest_bridge.pyBridge teststest_hub_coverage2.pyHub coverage 2 teststest_resume.pyPlaywright resume tests