Skip to content

fix(exec): clarify node approval recovery#91280

Merged
steipete merged 3 commits into
openclaw:mainfrom
deepujain:fix/53250-approval-timeout-guidance
Jul 11, 2026
Merged

fix(exec): clarify node approval recovery#91280
steipete merged 3 commits into
openclaw:mainfrom
deepujain:fix/53250-approval-timeout-guidance

Conversation

@deepujain

@deepujain deepujain commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Fixes #53250.

What Problem This Solves

Fixes an issue where operators running an exec command on a node could receive only exec denied: approval required (approval UI not available) when no interactive approval route was available. The message did not tell them where to review the pending request or how to inspect the affected node's exec policy.

Why This Change Was Made

The shared exec approval-unavailable renderer now owns node-aware recovery guidance, so both the initial tool result and deterministic rerender use the same message. It distinguishes the two supported surfaces:

  • print the Control UI URL with openclaw dashboard --no-open, open it in a browser, then use the approval inbox
  • inspect the node's effective exec policy with openclaw approvals get --node <id|name|ip> or the resolved node id when available

The CLI command is intentionally described as policy inspection. Pending approval list/resolve commands proposed in #83440 are not on current main and are not claimed here.

User Impact

Operators who hit the current host=node approval-unavailable path get truthful Control UI access steps plus a separately labeled policy diagnostic. The change preserves fail-closed approval behavior and does not alter approval authority, decisions, or policy enforcement.

Evidence

Validation on Blacksmith Testbox lease tbx_01kx70bgej5kn6b8vsz00z2cp2:

  • 182 focused tests passed across src/infra/exec-approval-reply.test.ts, src/agents/bash-tools.exec-host-shared.test.ts, and src/agents/embedded-agent-subscribe.handlers.tools.test.ts.
  • corepack pnpm check:changed passed the core, core-tests, and docs lanes, including typecheck, lint, guards, and zero runtime import cycles.
  • Focused oxfmt and git diff --check passed.
  • Fresh autoreview reported no accepted or actionable findings.

Focused tests prove that:

  • buildExecApprovalUnavailableReplyPayload({ reason: "no-approval-route", host: "node", nodeId: "mac-1" }) identifies openclaw dashboard --no-open as a Control UI URL printer, tells the operator to open that URL and use the approval inbox, and labels openclaw approvals get --node mac-1 as effective-policy inspection.
  • host and node metadata pass from the exec-host result through the deterministic tool-result rerender boundary.

Live clawmac approval-unavailable/recovery proof was not collected because that machine was reserved for an unrelated exact-head signed restart cycle during this repair. This patch changes only recovery copy and metadata propagation; the focused tests cover each runtime boundary it touches.

AI-assisted maintainer repair: Codex corrected the command contract, rebased the contributor branch, expanded focused coverage, and preserved Deepak Jain's commit credit and PR attribution. Release-note context remains in this body per the repository's normal-PR policy.

Copy link
Copy Markdown
Contributor Author

Small CLI wording patch is up.

What changed:

  • the host=node approval-required error now points users to openclaw dashboard --no-open
  • it also suggests openclaw exec-approvals list for pending requests

Validation:

  • git diff --check

This keeps the approval flow untouched and just makes the dead-end error message actionable.

@openclaw-barnacle openclaw-barnacle Bot added cli CLI command changes size: XS triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels Jun 8, 2026
@clawsweeper

clawsweeper Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 10, 2026, 6:34 PM ET / 22:34 UTC.

Summary
The PR adds Control UI handoff and effective-policy inspection guidance to shared node exec approval-unavailable replies and preserves host/node metadata through deterministic rerendering.

PR surface: Source +30, Tests +59. Total +89 across 6 files.

Reproducibility: yes. from source: current main's shared no-approval-route reply lacks concrete node recovery steps, and exact-head tests exercise the initial and deterministic rendering boundaries. This read-only review did not run a live node failure.

Review metrics: none identified.

Stored data model
Persistent data-model change detected: vector/embedding metadata: src/agents/bash-tools.exec-host-shared.test.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #53250
Summary: This PR is the active current-architecture fix candidate for the linked approval-recovery UX issue; the related pull requests do not safely replace it.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🧂 unranked krab
Proof: 🧂 unranked krab
Patch quality: 🦞 diamond lobster
Result: blocked until real behavior proof is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Provide redacted live node approval-unavailable evidence showing the exact recovery text, printed Control UI URL, and approval-inbox access.
  • Refresh the exact head onto current main and confirm the focused approval-renderer checks remain green.

Proof guidance:

  • [P1] Needs real behavior proof before merge: No after-fix live node recovery evidence is present. Add a redacted transcript, terminal output, logs, or recording showing the new message and Control UI handoff; update the PR body to trigger re-review, or ask a maintainer to comment @clawsweeper re-review if it does not trigger automatically.

Risk before merge

  • [P1] No redacted after-fix node approval-unavailable run demonstrates that the operator sees the new guidance and can reach the intended Control UI approval inbox.
  • [P1] The PR head is behind current main and needs an exact integration refresh before landing, although current main still lacks the requested behavior and no sampled current-main commit overlaps these changed approval files.

Maintainer options:

  1. Decide the mitigation before merge
    Keep one canonical shared unavailable-reply renderer that consumes prepared host/node facts and emits truthful, separately labeled UI-access and policy-diagnostic guidance, with live recovery evidence or an explicit proof override before release.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • [P1] No mechanical code defect remains; maintainers must decide whether to require live proof or explicitly override that gate, then refresh the branch against current main.

Maintainer decision needed

  • Question: Should this external PR be allowed to merge without a live node approval-unavailable recovery run?
  • Rationale: Source, focused tests, history, and documented CLI contracts support the implementation, but repository policy treats after-fix real behavior proof as a merge gate and the current protected label reserves any exception for a maintainer.
  • Likely owner: steipete — They introduced and recently repaired the affected shared renderer and placed the PR under protected human review.
  • Options:
    • Require live recovery proof (recommended): Keep the PR open until a redacted node run shows the new message, printed Control UI URL, and successful approval-inbox handoff.
    • Record a proof override: Accept the focused Testbox boundary coverage because the patch is limited to recovery copy and propagation of already-known metadata.

Security
Cleared: The patch only changes typed internal metadata, local recovery text, and tests; it does not alter authorization, approval decisions, credentials, permissions, dependencies, or supply-chain execution.

Review details

Best possible solution:

Keep one canonical shared unavailable-reply renderer that consumes prepared host/node facts and emits truthful, separately labeled UI-access and policy-diagnostic guidance, with live recovery evidence or an explicit proof override before release.

Do we have a high-confidence way to reproduce the issue?

Yes from source: current main's shared no-approval-route reply lacks concrete node recovery steps, and exact-head tests exercise the initial and deterministic rendering boundaries. This read-only review did not run a live node failure.

Is this the best way to solve the issue?

Yes: extending the established shared renderer with already-prepared host/node facts is the narrowest maintainable solution and avoids competing CLI-specific or projection-specific recovery wording.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 9dee9ebffa58.

Label changes

Label justifications:

  • P3: This is a narrow operator-recovery UX improvement with limited blast radius and no change to approval authority, configuration, defaults, or persisted state.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦞 diamond lobster.
Evidence reviewed

PR surface:

Source +30, Tests +59. Total +89 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 3 35 5 +30
Tests 3 61 2 +59
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 96 7 +89

What I checked:

Likely related people:

  • steipete: Current-main blame traces the shared renderer to their earlier work, and they authored the exact-head repair commits that corrected the command semantics and dashboard URL handoff. (role: feature introducer and recent area contributor; confidence: high; commits: 188535b097ef, 4b8d1f3719f8, 08f442558a84; files: src/infra/exec-approval-reply.ts, src/agents/bash-tools.exec-host-shared.ts, src/agents/embedded-agent-subscribe.handlers.tools.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
Review history (5 earlier review cycles)
  • reviewed 2026-07-10T14:07:44.363Z sha 6dffc69 :: needs real behavior proof before merge. :: [P2] Do not call the policy report an approval inbox
  • reviewed 2026-07-10T15:31:46.582Z sha 6dffc69 :: needs real behavior proof before merge. :: [P2] Describe approvals get as policy inspection, not an inbox
  • reviewed 2026-07-10T22:08:40.420Z sha 4b8d1f3 :: needs real behavior proof before merge. :: [P2] Describe dashboard --no-open as printing the inbox URL
  • reviewed 2026-07-10T22:20:33.843Z sha 08f4425 :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-10T22:27:17.480Z sha 08f4425 :: needs real behavior proof before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Jun 8, 2026

Copy link
Copy Markdown
Contributor Author

Follow-up pushed on the existing branch. I replaced the bad openclaw exec-approvals list hint with openclaw approvals get --node <node> guidance and dropped the unrelated .pre-commit-config.yaml hunk from this PR. Validation: git diff --check; targeted register.invoke.nodes-run-approval-timeout vitest passed locally. Commit: 5edb88f07b.

Copy link
Copy Markdown
Contributor Author

Pushed follow-up commit 39f13a411f to strengthen the proof for the approval recovery guidance.

What changed:

  • Kept the user-facing recovery text on the current nodes run approval-unavailable path.
  • Extracted the guidance string into a tiny helper so it is directly testable.
  • Added a focused regression assertion that the message points to openclaw dashboard --no-open and openclaw approvals get --node <node>, and does not mention the unsupported exec-approvals list command.
  • Cleaned the same touched file for the current lint rules; the commit hook passed.

Validation:

  • ./node_modules/.bin/vitest run src/cli/nodes-cli/register.invoke.nodes-run-approval-timeout.test.ts

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Current head is now 39f13a411f. Follow-up added focused regression proof for the approval-unavailable guidance and verifies the message uses the supported openclaw approvals get --node <node> command rather than the unsupported exec-approvals list wording.

@clawsweeper

clawsweeper Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@deepujain

Copy link
Copy Markdown
Contributor Author

Updated the PR body so it no longer mentions the unsupported openclaw exec-approvals list command. The description now points to openclaw approvals get --node <node> and includes the focused approval-guidance Vitest command from the current head.

@clawsweeper clawsweeper Bot added status: 🛠️ actively grinding The PR author has acted after the latest ClawSweeper review and work remains. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. and removed status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. status: 🛠️ actively grinding The PR author has acted after the latest ClawSweeper review and work remains. labels Jun 15, 2026
@openclaw-barnacle openclaw-barnacle Bot added the triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. label Jun 21, 2026
@deepujain
deepujain force-pushed the fix/53250-approval-timeout-guidance branch from 39f13a4 to cc184b9 Compare June 26, 2026 15:05
@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: S and removed cli CLI command changes size: XS labels Jun 26, 2026
@deepujain

Copy link
Copy Markdown
Contributor Author

Rebased this PR onto current main and replaced the stale node-CLI-only guidance with the shared exec approval unavailable renderer used by the current host=node path. The new head carries host/node metadata into that renderer and adds focused coverage for the node recovery command. Local validation: node scripts/run-vitest.mjs src/infra/exec-approval-reply.test.ts src/agents/bash-tools.exec-host-shared.test.ts src/agents/embedded-agent-subscribe.handlers.tools.test.ts, plus git diff --check.

@clawsweeper clawsweeper Bot added status: 🛠️ actively grinding The PR author has acted after the latest ClawSweeper review and work remains. merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. and removed merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jun 26, 2026
@steipete

Copy link
Copy Markdown
Contributor

Reopening this PR: ClawSweeper's automatic close was incorrect.

The branch is mergeable (currently UNSTABLE, not unmergeable), and the contributor rebased and posted fresh validation only about 4.5 hours before the close. The automation incorrectly treated that activity as absent. We are tightening the auto-close guard so recent author follow-up blocks this close reason.

Sorry, @deepujain.

@steipete steipete added the clawsweeper:human-review Needs maintainer review before ClawSweeper can continue label Jul 10, 2026
@clawsweeper clawsweeper Bot removed the status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. label Jul 10, 2026
@clawsweeper clawsweeper Bot closed this Jul 10, 2026
@steipete steipete added the maintainer Maintainer-authored PR label Jul 10, 2026
@steipete steipete reopened this Jul 10, 2026
@steipete

Copy link
Copy Markdown
Contributor

ClawSweeper re-closed this PR from a queued stale apply after the correction above. I have reopened it again and placed it under a current-main protected label while the guard fix lands. No contributor action is required.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Jul 10, 2026
@steipete steipete removed the maintainer Maintainer-authored PR label Jul 10, 2026
@steipete
steipete force-pushed the fix/53250-approval-timeout-guidance branch from 6dffc69 to 4b8d1f3 Compare July 10, 2026 22:00
@steipete

Copy link
Copy Markdown
Contributor

@clawsweeper re-review

Maintainer repair is now on exact head 4b8d1f3719f8d0d0273930090a08a9fe15e2ec47. The shared renderer now identifies the dashboard as the approval inbox and describes openclaw approvals get --node only as effective-policy inspection. Focused tests cover metadata propagation and deterministic rerendering; the PR body has the current authored problem/evidence sections and documents the live-proof gap.

@clawsweeper

clawsweeper Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@openclaw-barnacle openclaw-barnacle Bot removed the triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. label Jul 10, 2026
@steipete steipete changed the title fix(cli): add exec approval recovery guidance (Fixes #53250) fix(exec): clarify node approval recovery Jul 10, 2026
@steipete

Copy link
Copy Markdown
Contributor

@clawsweeper re-review

Exact head is now 3da838b6cf392f2bfb1fc82d064091bb828b233c. Runtime and test files are unchanged from the reviewed repair; the only follow-up removes the PR-owned CHANGELOG.md entry required by the repository's native normal-PR gate. Release-note context and contributor attribution remain in the PR body, and exact-head CI is rerunning.

@clawsweeper

clawsweeper Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@steipete

Copy link
Copy Markdown
Contributor

@clawsweeper re-review

Exact head 08f442558a84c62f38378249ebc10b4fe4f68fda resolves the review's remaining P2: dashboard --no-open is now described as printing the Control UI URL, followed by explicit browser/inbox steps. All three boundary assertions were updated; Blacksmith Testbox reran 182 focused tests successfully, and fresh autoreview reported no accepted or actionable findings.

@clawsweeper

clawsweeper Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. labels Jul 10, 2026
@steipete
steipete merged commit 612e1b9 into openclaw:main Jul 11, 2026
112 of 118 checks passed
@steipete

Copy link
Copy Markdown
Contributor

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 11, 2026
* fix(exec): clarify node approval recovery

Co-authored-by: Deepak Jain <[email protected]>

* chore(pr): keep release notes in PR context

* fix(exec): describe dashboard URL handoff

---------

Co-authored-by: Peter Steinberger <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling clawsweeper:human-review Needs maintainer review before ClawSweeper can continue P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: S triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[UX] Exec approval timeout message should include Control UI link and setup hints

2 participants