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.py Session resume logic — role and hijack ownership survive reconnect
  • core.py Hub core updated for resume token handling
  • connections.py Connections updated for resume flow
  • browser_handlers.py Browser handlers updated for resume
  • websockets.py WebSocket routes updated for resume
  • ws_routes.py CF WS routes with session resume support
  • session_runtime.py DO session runtime with resume token handling
  • store.py CF state store updates for resume
  • test_resume.py Session resume tests
  • test_ws_resume.py WebSocket resume tests
  • test_cf_resume.py CF resume tests
  • test_e2e_ws.py CF 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.py
    • core.py
    • websockets.py
    • ws_routes.py

Split gateway.py into a package

4 files changed
  • __init__.py Gateway package init — replaces monolithic gateway.py
  • _colors.py Color handling extracted into submodule
  • _gateway.py Core gateway logic
  • gateway.py Legacy gateway.py (superseded)
  • gateway.py refactored into a proper package structure for maintainability. decouple internal
    3 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 internal
    1 file
    • _gateway.py

Generic swarm manager module

18 files changed
  • __init__.py Manager package init
  • app.py Manager FastAPI app
  • auth.py Manager auth
  • cli.py Manager CLI
  • config.py Manager configuration
  • constants.py Manager constants
  • core.py Manager core — bot/agent lifecycle
  • models.py Manager data models
  • process.py Process management
  • protocols.py Manager protocols
  • __init__.py Routes package
  • bot_ops.py Bot operations routes
  • bot_update.py Bot update routes
  • models.py Route models
  • spawn.py Bot spawn routes
  • status.py Status routes
  • __init__.py Timeseries subpackage
  • manager.py Timeseries manager
  • Added a generic swarm manager module to undef.terminal.manager for managing multiple bot/agent connections. Includes FastAPI app, CLI, auth, process management, bot operation routes, spawn routes, and a timeseries manager. instantiate behavioral
    5 files
    • core.py
    • process.py
    • spawn.py
    • bot_ops.py
    • manager.py

Consolidate hardcoded constants into TerminalDefaults

2 files changed
  • defaults.py Centralized TerminalDefaults class
  • test_defaults.py TerminalDefaults tests
  • Moved hardcoded terminal constants into a centralized TerminalDefaults class. Pinned tests to TerminalDefaults constants; fixed snapshot_matches double negation. decouple internal
    2 files
    • defaults.py
    • test_defaults.py

Manager branch coverage — 98-100%

16 files changed
  • __init__.py Manager tests package
  • test_app.py Manager app tests
  • test_auth.py Manager auth tests
  • test_cli.py Manager CLI tests
  • test_config.py Manager config tests
  • test_constants.py Manager constants tests
  • test_core.py Manager core tests
  • test_coverage_final.py Final coverage gap tests
  • test_coverage_gaps.py Coverage gap tests
  • test_models.py Manager model tests
  • test_process.py Process management tests
  • test_process_extra.py Extra process tests
  • test_protocols.py Protocol tests
  • test_routes.py Manager route tests
  • test_routes_extra.py Extra route tests
  • test_timeseries.py Timeseries tests
  • Reached 98-100% branch coverage across all manager files. Added comprehensive mutation-killing tests. qualify internal
    5 files
    • test_app.py
    • test_core.py
    • test_process.py
    • test_routes.py
    • test_timeseries.py

CF snapshot broadcast fix

2 files changed
  • contracts.py Contracts updated for snapshot broadcast
  • store.py State store with snapshot broadcast fix
  • Fixed snapshot broadcast and event store for pywrangler. remediate behavioral
    2 files
    • store.py
    • contracts.py

Cloudflare DO architecture docs and 0.4.0 readiness

7 files changed
  • cf-do-architecture.md CF Durable Objects architecture — lifecycle, hibernation, SQLite schema, session resume
  • proposal-ws-session-resumption.md WebSocket session resumption design proposal
  • production-readiness-pass2.md Production readiness checklist pass 2
  • protocol-matrix.md Protocol matrix update
  • README.md README update
  • HANDOFF.md HANDOFF updated for 0.4.0 milestone
  • README.md Cloudflare 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.md
    • proposal-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.md
    • production-readiness-pass2.md
    • HANDOFF.md

Gateway and transport test suites

8 files changed
  • test_gateway_helpers_iac.py IAC stripping gateway helper tests (385 lines)
  • test_gateway_pump.py Gateway pump tests (331 lines, renamed from test_gateway.py)
  • test_gateway_ssh.py Gateway SSH tests (238 lines)
  • test_ssh_gateway.py SSH gateway E2E tests
  • test_cli.py CLI tests
  • test_bridge.py Bridge tests
  • test_hub_coverage2.py Hub coverage 2 tests
  • test_resume.py Playwright resume tests
  • IAC stripping helper tests, gateway pump and SSH gateway tests, E2E SSH gateway tests. Playwright resume flow tests added. qualify internal
    4 files
    • test_gateway_helpers_iac.py
    • test_gateway_pump.py
    • test_gateway_ssh.py
    • test_resume.py