Commit abe8a63
refactor(agent): split openclaw/manager.rs into focused submodules (#344)
`openclaw/manager.rs` was a 2,830-line file mixing the OpenClawManager
struct/impl, the tungstenite WebSocket loop, identity loading, Ed25519
signing, URL/IP validation, exponential backoff, and ~1,090 lines of
integration tests. Split it into focused siblings, all production files
now under 500 lines:
- manager.rs (315) - OpenClawManager struct + public API surface
- connection.rs (454) - WebSocket session/reconnect loop
- runtime_state.rs (187) - per-gateway runtime snapshot mutators
- identity.rs (241) - device identity loading + filesystem fallback
- device_proof.rs (202) - Ed25519 signing + payload + scope validation
- url_validation.rs (150) - URL parsing, DNS resolution, IP allowlist
- dto.rs (110) - public DTOs (status, snapshot, view, requests, events)
- command.rs (82) - `openclaw` external binary invocation
- backoff.rs (40) - reconnect attempt + jittered sleep helpers
- util.rs (34) - shared scalar helpers (now_ms, normalize_*)
- session.rs (26) - internal channel types
- tests.rs (1116) - integration tests (tests-only, may exceed 600)
`mod.rs` declares the new submodules and preserves the existing public
re-exports. `manager::GatewayView` is re-exported on the manager path so
`api_server.rs` `crate::openclaw::manager::GatewayView` keeps resolving.
All 27 openclaw tests still pass.
Co-authored-by: bb-connor <bb-connor@users.noreply.github.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 92cbfd7 commit abe8a63
13 files changed
Lines changed: 2680 additions & 2542 deletions
File tree
- apps/agent/src-tauri/src/openclaw
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
0 commit comments