Repository navigation
fix(exec): safely cancel pending node approvals - #115373
Merged
Merged
Conversation
steipete
marked this pull request as ready for review
July 28, 2026 18:41
Contributor
|
Merged via squash.
|
vincentkoc
added a commit
that referenced
this pull request
Jul 28, 2026
…etwork-none * origin/main: (74 commits) fix(ui): make Control UI ownership and permissions reliable (#115364) feat(system-agent): host memory import in Ask OpenClaw (#115376) fix(chat): preserve literal Markdown image examples (#113904) refactor(chat): keep web and terminal sessions synchronized (#115377) fix(ui): order model picker by provider strength (#115380) feat(ui): make Memory settings a destination page with live overview and dreams (#115383) docs(security): fix warning line wrap (#115388) fix(memory-core): avoid cubic MMR similarity rescans (#113359) fix(discord): preserve code-leading reasoning chunks (#103166) fix(slack): protect outbound hooks from previews fix(ui): keep explicit navigation ahead of chat canonicalization (#115366) fix(exec): safely cancel pending node approvals (#115373) fix: make Code Mode reliable across gateway and provider lifecycles (#115379) perf(ui): debounce event-driven session list refreshes and right-size child paging (#115374) feat(talk): support GPT-Live realtime voice over ChatGPT OAuth (#115226) feat(system-agent): guide gateway configuration in Ask OpenClaw (#115363) fix(agents): make overflow recovery append-only via branch-and-reappend (#115271) (#115310) fix(macos): bound websocket ping so a dropped pong cannot orphan its continuation (#115362) fix(codex): isolate native hook relay startup (#115078) fix(ci): stop reviving superseded pull request workflows (#115378) ... # Conflicts: # CHANGELOG.md
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Jul 29, 2026
* fix(exec): safely cancel pending node approvals * test(exec): satisfy detached node cancellation lint * refactor(exec): isolate bounded node approval followups --------- Co-authored-by: Peter Steinberger <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Problem This Solves
Fixes an issue where users cancelling a node-hosted command while approval was pending could leave an unhandled background rejection, start the remote command after cancellation, emit a denial after the run was already cancelled, or report a completed command as denied when notification delivery failed.
Why This Change Was Made
Refactor node-specific approval reasoning and bounded follow-up delivery into the existing node owner's small internal helper. Classify the canonical run-abort error; check cancellation before approval consumption, before failure notices, after final policy, and during gateway dispatch; pass the existing signal without changing operator approval scopes; observe both detached task and callback failures; retry a failed approval notice at most once; and never report a started or completed node command as approval-denied. The primary node owner remains below the enforced 700-line threshold. No approval policy, run identity, gateway protocol, configuration, workflow, or permissions are changed.
User Impact
Cancelled node commands stop without starting remote side effects, emitting stale messages, or causing process-level unhandled rejections. Successful commands remain successful even if follow-up delivery fails; genuine approval-request failures keep their existing truthful notices.
Evidence
430de2299c484116d14693af70cff64643f01619: immediate and delayed unhandled rejections; real remote execution during final-policy cancellation; independently detached failure-callback rejection; spurious notices after cancellation; and false denial after successful execution.node scripts/run-vitest.mjs src/agents/bash-tools.exec-host-node.test.ts src/agents/bash-tools.exec-host-node.cancellation.test.ts src/agents/bash-tools.exec-host-node-phases.cancellation.test.ts src/agents/bash-tools.exec-host-shared.test.ts src/agents/bash-tools.exec-approval-request.test.ts: 5 files, 127 tests passed.node scripts/run-oxlint.mjs --tsconfig tsconfig.json src/agents/bash-tools.exec-host-node.ts src/agents/bash-tools.exec-host-node-followup.ts src/agents/bash-tools.exec-host-node.test.ts src/agents/bash-tools.exec-host-node.cancellation.test.ts: all four files pass exact type-aware CI lint.oxfmt --checkandgit diff --check: passed.