Repository navigation
fix(ui): show correct node command remediation - #135453
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: blocked before merge. Reviewed September 3, 2026, 12:17 AM ET / 04:17 UTC. ClawSweeper reviewWhat this changesThe PR adds runtime-scoped node-command eligibility to the Gateway catalog and uses it in New Session and Move Session pickers to distinguish undeclared, unauthorized, and pending-approval commands. Regression provenancePossible regression — probable (reproduction; reviewed change). No predecessor PR is attributed. Merge readiness⛔ Blocked before merge - 3 items remain Keep open: current main still gives the generic command-policy hint, while this PR adds the Gateway-owned command state needed to give accurate picker remediation. Priority: P2 Review scores
Verification
How this fits togetherThe Gateway inventories paired devices and their command policy for session placement. The web UI consumes that catalog to enable or explain device choices before a placement dispatch is attempted. flowchart LR
A[Selected agent runtime] --> B[Gateway environment listing]
C[Node command policy and pairing state] --> D[Command eligibility resolver]
B --> D
D --> E[Optional placement metadata]
E --> F[New Session picker]
E --> G[Move Session picker]
D --> H[Placement dispatch eligibility]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +186, Tests +695, Docs 0, Config +1, Other +36. Total +918 across 39 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the shared Gateway resolver as the sole source of command eligibility and retain the optional additive protocol fields consumed by both picker flows. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: current main's picker has the generic invocable-command check, and the supplied issue and exact-head Gateway evidence provide the concrete policy-state scenario; this reviewer did not rerun it locally. Is this the best way to solve the issue? Yes: resolving eligibility at the Gateway policy owner and sharing it with dispatch avoids both the previous misleading UI inference and a dispatch-only fix that would leave the picker wrong. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 7afb1a353b62. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (12 earlier review cycles; latest 8 shown)
|
This comment was marked as spam.
This comment was marked as spam.
|
🦞🧹 I asked ClawSweeper to review this item again. |
This comment was marked as spam.
This comment was marked as spam.
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Land-ready verification for exact head
pr-135453-merge2-real-gateway.webmValidation:
Direct Codex contract check: ClawSweeper rank-up moves are addressed: the cloud-node ownership leak is removed, and real after-fix Control UI proof is attached. |
# Conflicts: # test/vitest/vitest.ui-e2e.config.ts # ui/src/pages/chat/chat-pane-placement.runtime.ts
|
Exact-head proof refresh for
Validation:
|
# Conflicts: # ui/src/pages/new-session/new-session-page.ts
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
# Conflicts: # .github/workflows/ci.yml # test/scripts/ci-workflow-guards.test.ts # test/vitest-ui-e2e-config.test.ts # test/vitest/vitest.ui-e2e.config.ts
# Conflicts: # test/vitest-ui-e2e-config.test.ts
|
LandPR notes for the current exact head:
|
|
Thanks @gaoanze888! Proof: A real isolated Gateway with device pairing and an explicit command-policy deny showed the correct New Session and Move Session action for undeclared, pending-approval, and unauthorized commands. Exact-head CI passed.
|
Refs openclaw#135378 ## What Problem This Solves The Session host picker mapped three different node command states to one allowlist hint: - the node did not declare the command; - the command awaited pairing approval; - the declared command was blocked by Gateway command policy. The hint was wrong for the first two states and incomplete when a deny rule overrode an allow rule. ## Why This Change Was Made The Gateway owns node declaration, pairing, and command policy state. The client previously tried to infer that authority from `capabilities`, `invocableCommands`, and pending declarations. `environments.list` now accepts an optional bounded `runtimeId`. For write-scoped callers, the Gateway returns one bounded `requiredNodeCommand` result per connected node when the runtime needs a node command. Its closed state is `invocable`, `pending-approval`, `undeclared`, or `unauthorized`. The same Gateway resolver now gates dispatch and the New Session and Move Session pickers. Raw pending declarations remain private. Empty inventory reads remain available with `operator.read`; runtime-scoped command state requires `operator.write`. The change does not add configuration, change the protocol version, or infer workspace or Codex authentication eligibility. ## User Impact The picker now gives one correct next action: - make an undeclared command available on the device, then reconnect; - ask an administrator to approve a pending command request; - authorize a blocked command in the Gateway node command policy. ## Evidence Exact head: `7525af641884d3c103e33e1bf19eabc90900e39a` - Current-main red on `46ef0be1422f824d7620e1c5dbc87dc59d1a9138`: all three states showed the same allowlist remediation. - Exact-head green: a real isolated Gateway, real device and node pairing, an explicit policy deny, and Chromium showed the correct action for all three states. - Focused protocol, Gateway, dispatch, New Session, and Move Session tests passed. - Protocol registry and generated Swift and Kotlin checks passed. - P0 Autoreview reported no accepted or actionable findings. - Screenshots, video, commands, and validation details: openclaw#135453 (comment) ## Scope Note Issue openclaw#135378 also requests broader diagnostics. This PR does not add them, so the issue remains open. ## AI Assistance AI-assisted repair. A maintainer independently reproduced the bug, inspected the Codex remote-exec contract, rewrote the fix at the Gateway owner, and verified the real Gateway and Control UI path. Co-authored-by: Ayaan Zaidi <[email protected]>
… hot deny A hot gateway.nodes.commands deny re-applies policy to live node sessions: the registry narrows the effective commands and records the withheld ones, but the declaration stays. resolveRequiredNodeCommandAuthority checked "declared but not effective" before "withheld", so environments.list and placement reported pending-approval for a command no approval can restore. The real-gateway e2e added in #135453 only passed when it read the state before the refresh, which reds checks-ui-e2e-real-gateway on main. Withheld now wins, the rest of the closed state is unchanged, and the new table-driven unit test fails on the previous order.
|
🦞👀 Command router queued. I will update this comment with the next step. |
|
🦞👀 Command router queued. I will update this comment with the next step. |




Refs #135378
What Problem This Solves
The Session host picker mapped three different node command states to one allowlist hint:
The hint was wrong for the first two states and incomplete when a deny rule overrode an allow rule.
Why This Change Was Made
The Gateway owns node declaration, pairing, and command policy state. The client previously tried to infer that authority from
capabilities,invocableCommands, and pending declarations.environments.listnow accepts an optional boundedruntimeId. For write-scoped callers, the Gateway returns one boundedrequiredNodeCommandresult per connected node when the runtime needs a node command. Its closed state isinvocable,pending-approval,undeclared, orunauthorized.The same Gateway resolver now gates dispatch and the New Session and Move Session pickers. Raw pending declarations remain private. Empty inventory reads remain available with
operator.read; runtime-scoped command state requiresoperator.write.The change does not add configuration, change the protocol version, or infer workspace or Codex authentication eligibility.
User Impact
The picker now gives one correct next action:
Evidence
Exact head:
7525af641884d3c103e33e1bf19eabc90900e39a3c6169c63628a3c59f84b0650b6712c1180f5e42: all three states showed the same allowlist remediation.Scope Note
Issue #135378 also requests broader diagnostics. This PR does not add them, so the issue remains open.
AI Assistance
AI-assisted repair. A maintainer independently reproduced the bug, inspected the Codex remote-exec contract, rewrote the fix at the Gateway owner, and verified the real Gateway and Control UI path.