Repository navigation
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 30, 2026, 4:59 PM ET / 20:59 UTC. ClawSweeper reviewWhat this changesThe branch adds a Codex-plugin background service that establishes explicitly configured remote WebSocket app-server connections at gateway startup, sends heartbeat pings, and reconnects after disconnects or transient failures. Merge readiness⛔ Blocked until stronger real behavior proof is added - 5 items remain Keep this PR open for human review. It presents a plausible reliability improvement and useful redacted live evidence, but that evidence was collected against commit Priority: P2 Review scores
Verification
How this fits togetherThe Codex plugin supplies OpenClaw agent harnesses with a shared Codex app-server client. A configured remote WebSocket transport currently connects on demand; this PR adds a plugin service that keeps that connection healthy between model requests and reports unrecoverable remote failures. flowchart LR
A[Gateway startup] --> B[Codex plugin configuration]
B --> C[Connection health service]
C --> D[Shared app-server client]
D --> E[Remote Codex app-server]
E --> F[Ping, pong, and close events]
F --> C
C --> G[Reconnect or operator-visible error]
Decision needed
Why: This is an intentional operator-visible lifecycle and failure-mode change, not a mechanical bug repair; source review cannot decide the desired operational default for existing remote deployments. Before merge
Agent review detailsSecurityNone. PR surfaceSource +297, Tests +368, Docs +11. Total +676 across 8 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain local and Unix transport behavior, then land the remote service only after a maintainer accepts the startup-managed lifecycle for explicitly configured WebSocket endpoints and the contributor posts redacted current-head proof of ping, pong, disconnect, and reconnect against a real remote app-server. Do we have a high-confidence way to reproduce the issue? No high-confidence current-head reproduction is available in the reviewed evidence. The PR includes a useful before-fix deployment transcript and after-fix proof for an earlier commit, but the latest head changes ping callback handling and lacks matching real-runtime proof. Is this the best way to solve the issue? Unclear. A plugin-owned service is the appropriate boundary for Codex-specific remote connection health, but the changed startup behavior needs an explicit maintainer decision and current-head proof before it can be called the best solution. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against c0946676da1c. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (5 earlier review cycles)
|
|
Addressing the review blockers:
The remaining startup/compatibility tradeoff is intentional and needs maintainer review; no concrete implementation or security issue was identified. |
…-supported-paths * origin/main: (168 commits) fix(plugins): keep registry sqlite root consistent (#116427) fix(cli): keep Gateway auth failures parseable in JSON (#116597) fix(trajectory): preserve prompts in oversized events (#116220) test(buzz): add live QA Lab channel lane (#116298) chore(i18n): refresh native locales (#116567) feat: add OpenClaw TUI prototype skill (#116583) fix(update): accept concrete versions selected by ranges (#116585) fix(agents): preserve locked session model routes test(qa-lab): preserve Matrix fault proxy identity fix(ci): extend OpenAI live profile setup budget (#116580) fix: prevent configured models from stalling startup (#116553) fix(cli): close MCP listener after one-shot commands fix(auto-reply): keep explicit NO_REPLY silent (#116548) test(discord): cover deferred backpressure terminals fix(discord): cancel backpressured realtime playback test(discord): cover realtime output backpressure fix(codex): add remote WebSocket heartbeat and reconnect (#116135) fix(macos): wait for the current reconnect snapshot (#116550) fix(outbound): recognize current-source message-tool sends (#116560) fix(voice-call): type cancelled consult outcomes ... # Conflicts: # extensions/google/setup-api.test.ts # ui/src/e2e/model-setup.e2e.test.ts
…-supported-paths * origin/main: (168 commits) fix(plugins): keep registry sqlite root consistent (openclaw#116427) fix(cli): keep Gateway auth failures parseable in JSON (openclaw#116597) fix(trajectory): preserve prompts in oversized events (openclaw#116220) test(buzz): add live QA Lab channel lane (openclaw#116298) chore(i18n): refresh native locales (openclaw#116567) feat: add OpenClaw TUI prototype skill (openclaw#116583) fix(update): accept concrete versions selected by ranges (openclaw#116585) fix(agents): preserve locked session model routes test(qa-lab): preserve Matrix fault proxy identity fix(ci): extend OpenAI live profile setup budget (openclaw#116580) fix: prevent configured models from stalling startup (openclaw#116553) fix(cli): close MCP listener after one-shot commands fix(auto-reply): keep explicit NO_REPLY silent (openclaw#116548) test(discord): cover deferred backpressure terminals fix(discord): cancel backpressured realtime playback test(discord): cover realtime output backpressure fix(codex): add remote WebSocket heartbeat and reconnect (openclaw#116135) fix(macos): wait for the current reconnect snapshot (openclaw#116550) fix(outbound): recognize current-source message-tool sends (openclaw#116560) fix(voice-call): type cancelled consult outcomes ... # Conflicts: # extensions/google/setup-api.test.ts # ui/src/e2e/model-setup.e2e.test.ts
What Problem This Solves
Fixes an issue where users running Codex with a remote WebSocket app-server could see a session remain in progress after the opening handshake stalled or the established connection became half-open. The gateway did not proactively notice or reconnect until another request attempted to use the connection.
Why This Change Was Made
Remote WebSocket transport now has a bounded opening handshake and sends WebSocket protocol-level ping frames every 20 seconds, with a 20-second pong deadline. The transport tolerates five consecutive missed pongs and resets the failure count when a matching pong or app-server message proves the connection is alive. A plugin-owned background service establishes and recovers the existing shared client using bounded, jittered exponential backoff. Authentication failures, invalid configuration, and unsupported app-server versions stop retrying and produce an actionable operator-visible error. Explicit remote transport also activates the Codex plugin at gateway startup, so recovery does not depend on a user starting a model turn.
This behavior applies automatically to
transport: "websocket". Localstdioand Unix socket transports retain their existing behavior. Ping and pong frames do not invoke a model.User Impact
Remote Codex sessions fail promptly on stalled handshakes, tolerate transient packet loss, detect persistently dead connections while idle, and reconnect in the background without synchronized retry storms. Permanent failures are reported instead of retried indefinitely. Users do not need to discover or enable a new configuration option.
Before-Fix Evidence From a Real Deployment
An existing deployment without this PR repeatedly failed to reach its separately hosted Codex app-server. Six independent incidents occurred approximately 30 minutes apart; every affected session waited roughly ten minutes before surfacing the failure. Endpoints, tenant identifiers, user identifiers, credentials, and unrelated request data are omitted.
The deployed source did not contain this PR's background health service. These lines are before-fix problem evidence, not claimed recovery evidence.
After-Fix Evidence Against a Real Remote Codex App-Server
On 2026-07-30 PDT, the exact
transport-websocket.tsandconnection-health.tsmodules from PR commit687c7fcf499ef2452b36ad0a8061221082c9130fwere executed from a running gateway against an existing, separately hosted, authenticated Codex app-server0.146.0. This was not a mock server or loopback fixture. Only an isolated proof-owned WebSocket was closed; the production gateway and app-server were not restarted, and all gateway containers remained ready with zero restarts afterward.Direct Upstream Codex Contract Inspection
The sibling
../codexcheckout was directly inspected at immutable upstream commit410c22b30e71265cb5a0cfe69f5e80391393b946; this is source-level dependency verification, not an inference from an OpenClaw wrapper or the live transcript.TransportEvent::ConnectionClosed.Protocol ping/pong exchanges therefore require no
turn/startor model invocation; the zero-turn live transcript above independently confirms that source-derived contract against a real app-server.Startup Compatibility and Maintainer Decision
This PR deliberately changes only explicitly configured
appServer.transport: "websocket"from request-driven connection to gateway-startup-managed connection. This is the intentional behavior needed to detect and repair broken remote sessions before a user sends another message; maintainers should explicitly accept that operational contract before merge.activation.onStartupremainsfalse; only the existing, explicitly authored transport configuration activates this path.stdio, explicitly configured localstdio, and Unix-socket transport do not register the background connection-health service.initialize/initialized; it never invokes inference or creates a model turn.Evidence
autoreview --mode uncommitted --no-web-searchreports no accepted or actionable findings.git diff --checkpasses.oxfmt --checkpasses for all changed source, tests, manifest, and documentation.oxlintpasses for all changed TypeScript source and tests.chalkand@openclaw/fs-safe; a temporary, exact-versionchalksource confirmed the additional missing package without changingnode_modules, accessing a public package registry, or reconfiguring the package manager.AI-assisted: drafted and validated with Codex; the change and its transport-specific blast radius were reviewed against the upstream app-server protocol and existing OpenClaw shared-client lifecycle.