Skip to content

fix(cli): reject blank APNs environment before node lookup - #144687

Merged
obviyus merged 2 commits into
openclaw:mainfrom
Alix-007:alix/fix-nodes-push-empty-environment
Sep 11, 2026
Merged

obviyus merged 2 commits into
openclaw:mainfrom
Alix-007:alix/fix-nodes-push-empty-environment

Conversation

@Alix-007

@Alix-007 Alix-007 commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Related: #130352 (the earlier validation-order repair).

What Problem This Solves

An operator can explicitly pass an empty --environment value to openclaw nodes push --node <id>. The command currently treats it as omission, reaches node lookup, and can use the node's default Apple push environment.

Why This Change Was Made

The existing validator now checks whether the option was supplied. Empty, whitespace-only, and invalid values fail before lookup with the existing diagnostic. Regression coverage uses the existing full command-registration suite and replaces its contradictory empty-success expectation.

User Impact

Explicitly blank input fails locally. Omit the flag to retain the existing default selection. Valid normalized values, node resolution, title/body defaults, and complete failed-push output keep their behavior.

Evidence

  • Real compiled CLI through openclaw.mjs on pinned main: empty input in human and JSON modes reached node.list and the controlled push.test boundary, then exited successfully.
  • The regression failed on the original validator for exactly those two cases; the other 12 cases passed.
  • All 28 focused command-registration, push-handler, dispatch, and payload tests passed with the repair.
  • Formatting, syntax lint, size/assertion checks, and the runtime build passed.
  • Independent source-blind acceptance passed 31 public cases, including --environment= spellings, varied node resolution, omitted environment forwarding, and complete failed-push output. Blank input created no connection.
  • Independent source review found no actionable issues.

The public proof uses synthetic Linux state and a loopback Gateway peer. It verifies compiled CLI validation, forwarding and output. It does not send a real Apple notification or claim live server authorization or device delivery. Unchanged downstream payload, priority, expiration, registration and authorization contracts are covered by source review and focused owner tests.

AI-assisted implementation and validation.

@clawsweeper

clawsweeper Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added cli CLI command changes size: S labels Sep 11, 2026
@obviyus obviyus self-assigned this Sep 11, 2026
@obviyus
obviyus merged commit 9698406 into openclaw:main Sep 11, 2026
183 checks passed
@obviyus

obviyus commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

Thanks @Alix-007 for the fix.

Proof: The real compiled CLI on pinned main accepted an empty environment in both output modes and reached node lookup and the simulated push boundary. The repaired CLI rejects it locally with zero connections. Independent acceptance passed 31 public cases, including equals-form empty input, normalized and omitted values, varied node resolution, title/body defaults, and complete failed-push output.

  • Bug: An explicitly empty override was treated as omission and could select the node's default push environment.
  • Fix: Validate option presence before node lookup; retain the existing valid-value and output behavior.
Before After
Empty environment reached lookup and push submission. Empty environment fails locally before any connection.

All 28 focused tests passed, including the consolidated full-registration suite and unchanged push-owner controls. Independent source review and the exact-head ClawSweeper review found no actionable issues. Required CI passed.

Merged as 9698406. The public proof used a synthetic loopback peer; it does not claim real Apple notification delivery or live server authorization enforcement.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 12, 2026
…144687)

Reject an explicitly supplied blank push environment before node lookup while preserving omitted and normalized valid environments, request shaping, and complete failed-push output.

Related: openclaw#130352

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

Labels

cli CLI command changes size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants