Repository navigation
Conversation
…or system.run The nodes 'run' action passes commandTimeoutMs to the node as the process timeout, and invokeTimeoutMs inside the node.invoke message. However, callGatewayTool uses gatewayOpts.timeoutMs (default 30s) for the websocket call timeout, meaning any node command taking >30s is killed by the gateway before the node can respond. This computes runGatewayTimeout from invokeTimeoutMs (if set) or commandTimeoutMs + 15s buffer, and uses it for both the callGatewayTool options and the message-level timeoutMs. This ensures the gateway waits long enough for the node to complete the command. Affects both the initial run attempt and the post-approval retry path.
Addresses review feedback: small commandTimeoutMs values (e.g. 2s) could shrink the gateway timeout below 30s, which breaks node wake/reconnect flows that need the full default budget.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fa36bae42c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…invokeTimeoutMs Addresses review: explicit invokeTimeoutMs should be honored as-is for callers that need short timeouts for fast failure/retry. The 30s floor now only applies to the commandTimeoutMs-derived path.
Greptile SummaryThis PR fixes a timeout propagation bug in the The fix introduces Issue found: A logic flaw remains: when both Confidence Score: 2/5
Last reviewed commit: 9af7e20 |
…imeoutMs is shorter Addresses Greptile review: when both params are set and invokeTimeoutMs < commandTimeoutMs + buffer, the gateway would still kill the connection before the node finishes. Now takes the max of derivedTimeout, commandTimeoutMs + 15s, and 30s floor.
|
Closing this as implemented after Codex review. Current What I checked:
So I’m closing this as already implemented rather than keeping a duplicate issue open. Review notes: reviewed against 564f820efa2b; fix evidence: commit 564f820efa2b. |
Summary
• Problem: nodes run (system.run) kills any node command taking >30s because callGatewayTool uses gatewayOpts.timeoutMs (default 30s) regardless of commandTimeoutMs or invokeTimeoutMs values.
• Why it matters: Makes nodes run unusable for any real workload (builds, coding agents, long scripts) on paired nodes.
• What changed: Compute runGatewayTimeout from invokeTimeoutMs or commandTimeoutMs + 15s, propagate it to both the websocket call options and the message-level timeoutMs.
• What did NOT change (scope boundary): No schema changes, no gateway-side changes, no new parameters. Only the agent-side timeout propagation logic in nodes-tool.ts.
Change Type (select all)
• [x] Bug fix
• [ ] Feature
• [ ] Refactor
• [ ] Docs
• [ ] Security hardening
• [ ] Chore/infra
Scope (select all touched areas)
• [ ] Gateway / orchestration
• [x] Skills / tool execution
• [ ] Auth / tokens
• [ ] Memory / storage
• [ ] Integrations
• [ ] API / contracts
• [ ] UI / DX
• [ ] CI/CD / infra
Linked Issue/PR
• Closes #
• Related #
User-visible / Behavior Changes
• nodes run commands with commandTimeoutMs or invokeTimeoutMs set will now correctly wait for the node to complete instead of timing out at 30s.
• No new parameters or config changes. Existing behavior for commands <30s is unchanged.
Security Impact (required)
• New permissions/capabilities? No
• Secrets/tokens handling changed? No
• New/changed network calls? No
• Command/tool execution surface changed? No
• Data access scope changed? No
Repro + Verification
Environment
• OS: WSL2 (Ubuntu) + Windows 11 paired node
• Runtime/container: Node v22.22.0, OpenClaw v2026.3.8
• Model/provider: github-copilot/claude-opus-4.6
• Integration/channel: Telegram
• Relevant config: Default gateway config, Windows companion node paired via LAN
Steps
Pair a Windows node with OpenClaw gateway
Run nodes run with a command that takes >30s (e.g., ping -n 35 127.0.0.1) and commandTimeoutMs: 60000
Observe timeout behavior
Expected
• Command completes after ~35s and returns stdout with all 35 ping replies
Actual
• Before fix: gateway timeout after 30000ms error at 30s
• After fix: Command completes successfully (34.6s), returns full output
Evidence
• [x] Trace/log snippets
Before fix:
{"status":"error","error":"gateway timeout after 30000ms"}
After fix (monkey-patched dist):
{"stdout":"...35 pings...","exitCode":0,"timedOut":false,"durationMs":34605}
Also tested GitHub Copilot CLI (74s run) successfully via Windows node after fix.
Human Verification (required)
• Verified scenarios: 35-ping test (34.6s), Copilot CLI codebase analysis (74s), both via Windows node
• Edge cases checked: No invokeTimeoutMs set (falls back to commandTimeoutMs + 15s); neither set (preserves default 30s behavior)
• What you did not verify: Approval retry path (tested only the first-attempt path); nodes invoke action (separate code path with same issue, not addressed here)
Review Conversations
• [x] I replied to or resolved every bot review conversation I addressed in this PR.
• [x] I left unresolved only the conversations that still need reviewer or maintainer judgment.
Compatibility / Migration
• Backward compatible? Yes
• Config/env changes? No
• Migration needed? No
Failure Recovery (if this breaks)
• How to disable/revert this change quickly: Revert the single commit; timeout falls back to default 30s behavior.
• Files/config to restore: src/agents/tools/nodes-tool.ts
• Known bad symptoms reviewers should watch for:
If runGatewayTimeout computes an unexpectedly large value, gateway websocket connections could stay open longer than intended. Mitigated by only deriving from user-provided timeout params.
Risks and Mitigations
• Risk: Gateway websocket connections held open longer when large commandTimeoutMs values are passed.
• Mitigation: Timeout is derived directly from user-specified params — no unbounded defaults. If neither commandTimeoutMs nor invokeTimeoutMs is set, behavior is unchanged (30s default).