Repository navigation
feature(channels): add channels start|stop|reconnect for existing Gateway RPCs - #183099
nocodet888-arch wants to merge 1 commit into
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. What this changesAdds channels start, stop, and reconnect commands over existing Gateway RPCs and updates recovery instructions. Example: Restart the existing WhatsApp account named work while preserving pairing.
Review scores
ProductKind: Feature · Worth it: Needs a maintainer decision · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains Keep this PR open: the focused CLI addition is coherent and has runtime evidence, but adopting it as the preferred recovery interface still needs an owner decision. Priority: P3 Decision needed
Before merge
FindingsNone. Agent review detailsHow this fits togetherThe channels CLI accepts account selectors and Gateway connection options, invokes authenticated lifecycle RPCs, and prints the Gateway-owned runtime outcomes. flowchart LR
A[Operator] --> B[Channels CLI]
B --> C[Shared Gateway client]
C --> D[Authenticated lifecycle RPCs]
D --> E[Channel runtime owner]
E --> F[Account outcome]
Technical reviewBest possible solution: If approved, expose these commands as thin adapters while retaining Gateway ownership of authorization, account selection, and lifecycle outcomes. Do we have a high-confidence way to reproduce the issue? Source confirms the missing dedicated CLI interface and existing recovery RPCs; this feature proposal establishes no separate runtime bug. Is this the best way to solve the issue? The adapters fit the existing ownership boundary and avoid new protocol or persistence machinery, but promoting them is a product choice. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against ff9b95f3edb5. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +188, Tests +151, Docs +1. Total +340 across 9 files. Added test files: 1. View PR surface stats
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (2 earlier review cycles)
Reviewed October 27, 2026, 8:24 PM ET / October 28, 2026, 00:24 UTC (Revision 3). |
bf5e59b to
6467363
Compare
|
Addressed ClawSweeper author findings on head
Runtime hint in @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
6467363 to
b87a630
Compare
|
Rebased onto current |
|
@clawsweeper re-review Current head |
|
🦞👀 Re-review progress:
|
Implements #183098
What Problem This Solves
Docs already prescribe
channels.stop/channels.startfor non-destructive per-account recovery (keep pairing/credentials; crash-loop safe-mode manual override), but operators must hand-craftopenclaw gateway callJSON. The channels CLI has list/status/login/logout/dead-letters but no first-class start/stop.User Impact
User impact:
openclaw channels stop|start|reconnect --channel <id> [--account <id>] --jsonwraps the existing Gateway RPCs. Blank--accountfails closed. Unknown channel fails closed. Prefer these overgateway call. Distinct fromchannels logout(clears credentials) andgateway restart(whole process).Why This Change Was Made
Thin Alix-style CLI adapters under the existing
channelstree only: forward validated params (including Gateway--port/--url) tochannels.start/channels.stop, update recovery docs and the crash-loop manual-start hint, and keep Gateway semantics unchanged. No new Gateway methods, schema, or permissions.Evidence
src/commands/channels/start-stop.ts,src/cli/channels-cli.ts,src/infra/gateway-boot-lifecycle.ts(+ tests),docs/cli/channels.md,docs/gateway/restart-recovery.md,docs/channels/troubleshooting.mdnode scripts/run-vitest.mjs src/commands/channels/start-stop.test.ts— 6 passed;src/infra/gateway-boot-lifecycle.test.tshint cases — 19 passedReal behavior proof
Behavior or issue addressed
Operators need native
openclaw channels start|stop|reconnectthat call existingchannels.start/channels.stop; stop/start must return Gatewaystopped/started+outcome; blank--accountand unknown channel must fail closed; status probe remains available after recovery.Canonical reachability path
Packaged
openclaw channels stop|start|reconnect→channelsStopCommand/channelsStartCommand/channelsReconnectCommand→callGatewayFromCliWithTransport("channels.stop"|"channels.start", …)→src/gateway/server-methods/channels.ts.Shared helper / provider constraint check
Reuses
addGatewayClientOptions,callGatewayFromCliWithTransport, andparseAccountSelector. Does not own channel lifecycle; reuses existing Gateway account start/stop owners (same path login already uses forchannels.start).Real environment tested
Packaged CLI after
qaRuntimebuild on Node 24.22.1; temporaryOPENCLAW_STATE_DIR+OPENCLAW_CONFIG_PATH; localopenclaw gateway run --port 18821with token auth; Telegram channel enabled with fake BotFather tokens (accountsdefault+proof).Exact steps or command run after this patch
Evidence after fix
Notes for reviewers
channelsCLI tree (not a new top-level namespace).openclaw channels start --channel …instead ofgateway call.