Repository navigation
fix: prevent node gateway hangs and runaway local inference - #115248
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 28, 2026, 11:23 AM ET / 15:23 UTC. ClawSweeper reviewWhat this changesThis PR carries one deadline through paired-node wake, policy, and transport work; forwards cancellation to first-party node hosts; bounds self-hosted model discovery; and validates related browser and CLI inputs. Merge readiness⛔ Blocked until stronger real behavior proof is added - 4 items remain Keep this PR open for explicit maintainer review. It carries a protected Priority: P1 Review scores
Verification
How this fits togetherThe gateway’s node-invocation path accepts commands from CLI, MCP, plugins, and browser clients, then resolves pairing, optionally wakes an offline node, applies policy, and sends work to the paired host. Provider setup separately reads self-hosted model catalogs and turns them into selectable local models. flowchart LR
Client[CLI, MCP, plugin, or browser client] --> Gateway[Gateway node invocation]
Gateway --> Pairing[Pairing and wake]
Pairing --> Policy[Command policy]
Policy --> Transport[Paired node transport]
Transport --> Outcome[Result, timeout, or cancellation]
Setup[Self-hosted provider setup] --> Discovery[Bounded model discovery]
Discovery --> Catalog[Available local models]
Decision needed
Why: The patch deliberately broadens an established gateway-to-node transport behavior; source tests exercise the new first-party path, but the supplied context does not establish the minimum released node-host protocol contract. Before merge
Agent review detailsSecurityNone. PR surfaceSource +244, Tests +755. Total +999 across 18 files. View PR surface stats
Review metricsNone. Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Retain one absolute invocation deadline, but land only after confirming the widened cancellation frame is compatible with the oldest supported first-party node host and attaching redacted after-fix runtime evidence for a paired-node timeout or cancellation path. Do we have a high-confidence way to reproduce the issue? No high-confidence live reproduction is included in inspectable form. The affected deadline and cancellation paths are source-reproducible from the branch tests, but the supplied context does not show a directly inspectable paired-node runtime reproduction. Is this the best way to solve the issue? Unclear. A shared absolute deadline is a maintainable fix shape, but broadening cancellation delivery requires confirmation against the supported first-party node-host protocol before it is the safest solution. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against a8f088e50ad8. 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
|
|
Merged via squash.
|
…etwork-none * origin/main: feat(skills): shared authoring standards make learned skills routable (#115103) fix(matrix): suppress previews for modifying hooks fix: prevent node gateway hangs and runaway local inference (#115248) refactor(ui): adopt @lit/task across remaining page surfaces (#115274) fix(slack): cap chat.update edit text at the 4000-char limit, not the 8000 send limit (#115027) [AI-assisted] docs: recommend Node 26 in quickstart, landing, and platform install docs (#115064) refactor(workboard): tidy Control UI card execution helpers (#115195) perf(agents): amortize history-limit eviction with hysteresis (#115273) (#115281)
…-20260728 * origin/main: fix(tui): order delayed prompts before completed replies (#115219) feat(macos): enable Computer Control by default and diagnose stale Accessibility grants (#115280) fix(qa): restore full-stack scenarios and truthful suite exits (#115290) feat(memory): backfill past sessions from Control UI (#115266) docs: link macOS onboarding pages to app download (#111361) feat(skills): shared authoring standards make learned skills routable (#115103) fix(matrix): suppress previews for modifying hooks fix: prevent node gateway hangs and runaway local inference (#115248) refactor(ui): adopt @lit/task across remaining page surfaces (#115274)
* origin/main: (62 commits) feat(macos): enable Computer Control by default and diagnose stale Accessibility grants (openclaw#115280) fix(qa): restore full-stack scenarios and truthful suite exits (openclaw#115290) feat(memory): backfill past sessions from Control UI (openclaw#115266) docs: link macOS onboarding pages to app download (openclaw#111361) feat(skills): shared authoring standards make learned skills routable (openclaw#115103) fix(matrix): suppress previews for modifying hooks fix: prevent node gateway hangs and runaway local inference (openclaw#115248) refactor(ui): adopt @lit/task across remaining page surfaces (openclaw#115274) fix(slack): cap chat.update edit text at the 4000-char limit, not the 8000 send limit (openclaw#115027) [AI-assisted] docs: recommend Node 26 in quickstart, landing, and platform install docs (openclaw#115064) refactor(workboard): tidy Control UI card execution helpers (openclaw#115195) perf(agents): amortize history-limit eviction with hysteresis (openclaw#115273) (openclaw#115281) fix: schema-version refusal blames a downgrade that never happened and cannot identify the stale install (openclaw#115232) fix: restore Fish completion after global CLI options (openclaw#115222) refactor(agents): collapse the client-tool catalog branch (openclaw#115212) fix(macos): signed rebuild no longer stalls on app shutdown (openclaw#103957) fix(agents): prevent repeated Code Mode output across waits (openclaw#115213) refactor(ui): split Profile (identity) from Usage (statistics) (openclaw#115245) fix(channels): report a channel that cannot receive as unhealthy instead of connected (openclaw#115229) fix(cli): reject malformed infer model refs (openclaw#115225) ...
…#115248) * fix(node): bound gateway wake, cancellation, and local inference * refactor(gateway): extract bounded node invocation policies
The gateway deadline machinery from #115248 reads a top-level timeoutMs on the node.invoke payload, but buildNodeSystemRunInvoke() only ever emitted the nested program budget. With p.timeoutMs undefined the registry falls back to a fixed 30s pending-invoke timer, drops the pending entry, and discards the node's later success as ignored, so the caller never sees a terminal outcome. Serialize the resolved invocation deadline as the top-level timeoutMs and keep three ordered budgets: node program runtime < gateway deadline < caller wait. A zero timeout still means "no program-runtime timer" and is never rewritten, while the gateway deadline and caller wait stay positive and finite so neither side can hang forever. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 8ea5a828-596c-4bf9-9382-0081bd0d50cd
The gateway deadline machinery from #115248 reads a top-level timeoutMs on the node.invoke payload, but buildNodeSystemRunInvoke() only ever emitted the nested program budget. With p.timeoutMs undefined the registry falls back to a fixed 30s pending-invoke timer, drops the pending entry, and discards the node's later success as ignored, so the caller never sees a terminal outcome. Serialize the resolved invocation deadline as the top-level timeoutMs and keep three ordered budgets: node program runtime < gateway deadline < caller wait. A zero timeout still means "no program-runtime timer" and is never rewritten, while the gateway deadline and caller wait stay positive and finite so neither side can hang forever. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 8ea5a828-596c-4bf9-9382-0081bd0d50cd
…116591) The gateway deadline machinery from #115248 reads a top-level timeoutMs on the node.invoke payload, but buildNodeSystemRunInvoke() only ever emitted the nested program budget. With p.timeoutMs undefined the registry falls back to a fixed 30s pending-invoke timer, drops the pending entry, and discards the node's later success as ignored, so the caller never sees a terminal outcome. Serialize the resolved invocation deadline as the top-level timeoutMs and keep three ordered budgets: node program runtime < gateway deadline < caller wait. A zero timeout still means "no program-runtime timer" and is never rewritten, while the gateway deadline and caller wait stay positive and finite so neither side can hang forever. Co-authored-by: Omar Shahine <[email protected]> Co-authored-by: Copilot App <[email protected]> Copilot-Session: 8ea5a828-596c-4bf9-9382-0081bd0d50cd
…penclaw#116591) The gateway deadline machinery from openclaw#115248 reads a top-level timeoutMs on the node.invoke payload, but buildNodeSystemRunInvoke() only ever emitted the nested program budget. With p.timeoutMs undefined the registry falls back to a fixed 30s pending-invoke timer, drops the pending entry, and discards the node's later success as ignored, so the caller never sees a terminal outcome. Serialize the resolved invocation deadline as the top-level timeoutMs and keep three ordered budgets: node program runtime < gateway deadline < caller wait. A zero timeout still means "no program-runtime timer" and is never rewritten, while the gateway deadline and caller wait stay positive and finite so neither side can hang forever. Co-authored-by: Omar Shahine <[email protected]> Co-authored-by: Copilot App <[email protected]> Copilot-Session: 8ea5a828-596c-4bf9-9382-0081bd0d50cd
What Problem This Solves
Fixes an issue where users running paired nodes, MCP and shell commands, the browser copilot, or local model providers could experience hanging gateway requests, orphaned node work, invalid reconnects, unsafe retries, malformed camera output, or runaway model discovery.
Why This Change Was Made
Carry one absolute invocation deadline across pairing, APNs wake, reconnect, plugin policy, and node transport; propagate cancellation only to first-party node hosts that support it; preserve command-dispatch ownership for safe retries. Extract reusable deadline and iOS foreground helpers so the gateway handler stays within the repository module limit. Bound self-hosted model probing without losing advertised models and validate external gateway and provider records at their boundaries.
User Impact
Node commands now time out and cancel predictably, including stalled pairing stores, late wake results, revoked pairings, browser reconnect failures, and timeouts longer than the Node timer limit. CLI camera and notification commands reject malformed records and invalid choices safely. Ollama and compatible self-hosted llama.cpp, vLLM, and SGLang catalog discovery remain bounded and keep all valid models.
Evidence