Skip to content

fix(status): avoid false shell-wrapper audit warnings#81778

Merged
vincentkoc merged 1 commit into
openclaw:mainfrom
liaoandi:fix/gateway-status-shell-wrapped-command
Jul 11, 2026
Merged

fix(status): avoid false shell-wrapper audit warnings#81778
vincentkoc merged 1 commit into
openclaw:mainfrom
liaoandi:fix/gateway-status-shell-wrapped-command

Conversation

@liaoandi

@liaoandi liaoandi commented May 14, 2026

Copy link
Copy Markdown
Contributor

Fixes #81751

What Problem This Solves

gateway status reports that the gateway subcommand is missing when a macOS LaunchAgent intentionally invokes OpenClaw through a POSIX shell inline command such as /bin/zsh -lc "... exec node ... gateway". The audit only sees the outer argv and cannot safely prove the inner shell command.

Why This Change Was Made

Treat recognized POSIX shell -c/combined-c wrappers as opaque for only the aggressive gateway-command-missing assertion. The audit does not parse shell text, infer inner ports, or change status/doctor/runtime behavior. Non-shell commands and shell invocations without an inline-command flag retain the exact existing audit.

User Impact

Healthy shell-wrapped LaunchAgents no longer emit the misleading missing-gateway warning. Other service diagnostics remain unchanged.

Evidence

  • node scripts/run-vitest.mjs src/daemon/service-audit.test.ts — 46/46 passed.
  • oxfmt --check src/daemon/service-audit.ts src/daemon/service-audit.test.ts — passed.
  • git diff --check — passed.
  • Regression coverage includes the reported zsh -lc shape plus non-shell and missing-inline-flag negatives.

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: S triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels May 14, 2026
@clawsweeper

clawsweeper Bot commented May 14, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 11, 2026, 6:09 AM ET / 10:09 UTC.

Summary
The PR makes the gateway service audit treat recognized POSIX shell inline-command wrappers as opaque for the missing-subcommand warning and adds regression tests for wrapper and negative cases.

PR surface: Source +21, Tests +36, Docs +1. Total +58 across 3 files.

Reproducibility: yes. Current main requires a top-level gateway argv token, while the linked macOS report places that token inside a /bin/zsh -lc command, so the false warning follows directly from the audited source path.

Review metrics: none identified.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #81751
Summary: The linked issue is the canonical false-warning report and this PR is its active candidate fix; two alternative implementations closed unmerged, while the LaunchAgent startup failure report is distinct.

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: 🐚 platinum hermit
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:

  • [P1] Post redacted after-fix gateway status terminal output from a real macOS shell-wrapped LaunchAgent showing the warning is absent; updating the PR body should trigger a fresh review, otherwise ask a maintainer to comment @clawsweeper re-review.
  • Remove the added CHANGELOG.md line.

Proof guidance:

  • [P1] Needs real behavior proof before merge: The PR body provides unit-test and formatting results but no after-fix terminal, log, recording, or live output from the affected macOS LaunchAgent path; redact private paths, endpoints, API keys, tokens, phone numbers, and other sensitive details before posting proof. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Risk before merge

  • [P1] No after-fix output from a real macOS shell-wrapped LaunchAgent currently demonstrates that gateway status removes the false warning while retaining other diagnostics.
  • [P1] The branch edits release-owned CHANGELOG.md; merging it as-is would bypass the repository's release-note workflow.

Maintainer options:

  1. Decide the mitigation before merge
    Retain the opaque-wrapper guard and focused tests, drop the CHANGELOG.md line, and merge only after redacted real macOS gateway status output proves the affected LaunchAgent path.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • [P1] The contributor needs to remove the changelog line and provide real macOS behavior proof; the proof requirement cannot be satisfied by an automated branch repair.

Security
Cleared: The exact diff adds no dependency, permission, secret, network, downloaded-artifact, package-resolution, or command-execution surface.

Review findings

  • [P3] Remove the release-owned changelog entry — CHANGELOG.md:31
Review details

Best possible solution:

Retain the opaque-wrapper guard and focused tests, drop the CHANGELOG.md line, and merge only after redacted real macOS gateway status output proves the affected LaunchAgent path.

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

Yes. Current main requires a top-level gateway argv token, while the linked macOS report places that token inside a /bin/zsh -lc command, so the false warning follows directly from the audited source path.

Is this the best way to solve the issue?

Yes, after the two merge-readiness fixes. Treating only recognized shell inline-command wrappers as opaque for the aggressive token assertion is narrower and safer than parsing shell syntax, and it leaves the remaining audits active.

Full review comments:

  • [P3] Remove the release-owned changelog entry — CHANGELOG.md:31
    Normal PRs must not edit CHANGELOG.md; release tooling owns this file. Please drop this line and keep the user-visible release context in the PR body or commit message.
    Confidence: 0.99

Overall correctness: patch is correct
Overall confidence: 0.94

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 6268eeef15b6.

Label changes

Label changes:

  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body provides unit-test and formatting results but no after-fix terminal, log, recording, or live output from the affected macOS LaunchAgent path; redact private paths, endpoints, API keys, tokens, phone numbers, and other sensitive details before posting proof. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Label justifications:

  • P2: The PR fixes a misleading gateway status diagnostic with limited blast radius and does not change gateway runtime or service installation behavior.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body provides unit-test and formatting results but no after-fix terminal, log, recording, or live output from the affected macOS LaunchAgent path; redact private paths, endpoints, API keys, tokens, phone numbers, and other sensitive details before posting proof. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed

PR surface:

Source +21, Tests +36, Docs +1. Total +58 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 1 22 1 +21
Tests 1 36 0 +36
Docs 1 1 0 +1
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 59 1 +58

What I checked:

  • Narrow implementation: The exact PR head checks only the shell executable and presence of a supported inline-command flag; it does not parse or trust the inner shell payload. (src/daemon/service-audit.ts:95, aecb9a126029)
  • Caller behavior: The guard applies only to gateway-command-missing; port, path, environment, runtime, token, launchd, and systemd audits continue independently. (src/daemon/service-audit.ts:267, aecb9a126029)
  • Regression coverage: Tests verify that /bin/zsh -lc suppresses only the gateway-token warning while a non-shell command and a shell without an inline-command flag retain the existing warning. (src/daemon/service-audit.test.ts:346, aecb9a126029)
  • Prior review continuity: Compared with the earlier reviewed head, the current patch removes shell tokenization and inline-payload port inference, resolving the repeated request to constrain parsing to the executed command. (src/daemon/service-audit.ts:95, aecb9a126029)
  • Helper contract: The shared resolver identifies inline-command argument placement and combined -c flags without executing or tokenizing the command string, matching this patch's opaque use. (src/infra/shell-inline-command.ts:158, 1aca83abf53f)
  • Live PR state: The PR is open and mergeable but behind, targets the still-open canonical issue, and currently points to head aecb9a12602930150f647959141387af4c7e8c03. (aecb9a126029)

Likely related people:

  • vincentkoc: Current checkout history for the daemon audit and shared shell helpers resolves to Vincent Koc, and the live PR is assigned to vincentkoc after current-head updates. (role: recent area contributor and current assignee; confidence: high; commits: 1aca83abf53f; files: src/daemon/service-audit.ts, src/daemon/service-audit.test.ts, src/infra/shell-inline-command.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 (3 earlier review cycles)
  • reviewed 2026-07-04T03:49:18.708Z sha 530149f :: needs changes before merge. :: [P2] Constrain shell parsing to the executed gateway command
  • reviewed 2026-07-11T03:15:29.865Z sha 7ebc71e :: needs changes before merge. :: [P2] Constrain shell parsing to the executed gateway command
  • reviewed 2026-07-11T09:56:08.390Z sha c8cec1f :: needs real behavior proof before merge. :: none

@openclaw-barnacle openclaw-barnacle Bot added proof: supplied External PR includes structured after-fix real behavior proof. and removed triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels May 14, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 14, 2026
@stielemans

This comment was marked as low quality.

@RomneyDa

Copy link
Copy Markdown
Member

Heads up: this PR needs to be updated against current main before the new required Dependency Guard check can pass.

@liaoandi
liaoandi force-pushed the fix/gateway-status-shell-wrapped-command branch from 8ba8752 to 530149f Compare May 29, 2026 09:59
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 29, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P2 Normal backlog priority with limited blast radius. labels May 29, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jun 20, 2026
@vincentkoc
vincentkoc force-pushed the fix/gateway-status-shell-wrapped-command branch from 530149f to d2758d0 Compare July 11, 2026 02:51
@vincentkoc
vincentkoc force-pushed the fix/gateway-status-shell-wrapped-command branch 2 times, most recently from 7ebc71e to c8cec1f Compare July 11, 2026 09:41
@vincentkoc vincentkoc self-assigned this Jul 11, 2026
@vincentkoc vincentkoc changed the title fix(status): detect shell-wrapped gateway services fix(status): avoid false shell-wrapper audit warnings Jul 11, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. labels Jul 11, 2026
@vincentkoc
vincentkoc force-pushed the fix/gateway-status-shell-wrapped-command branch from c8cec1f to add63e8 Compare July 11, 2026 09:57
@vincentkoc
vincentkoc force-pushed the fix/gateway-status-shell-wrapped-command branch from add63e8 to aecb9a1 Compare July 11, 2026 10:03
@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. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jul 11, 2026
@vincentkoc
vincentkoc merged commit 410e6db into openclaw:main Jul 11, 2026
117 of 121 checks passed
vincentkoc added a commit that referenced this pull request Jul 11, 2026
* origin/main:
  fix(cron): abort superseded reconciliation hooks (#104368)
  ci(release): expose Telegram runtime preflight stage (#104387)
  fix(status): avoid false shell-wrapper audit warnings (#81778)
  fix: retry live Gateway readiness proof (#104374)
  fix(exec-approval): stop misattributing Allow Always unavailability to policy (#97740)
  fix: preserve Mac bundle during live builds (#104376)
  chore(docs): translate with GPT-5.6 xhigh
  test: wire Control UI suite into CI, fix its broken tests, drop dead harness surface (#104361)
  fix(ui): hide group submenu separator when New group is the only entry (#104370)
  fix(discord): reset progress drafts across queued turns (#102341)
  docs(cli): clarify that exec-policy show and approvals get exclude per-session /exec overrides (#94999)
  fix(discord): single-source thread-binding default placement and guard artifact parity (#104342)
  fix(agents): add tool-activity heartbeat to keep subagent alive during tool calls (#95536)
  fix(maint): reuse recent same-PR hosted gates (#104355)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 12, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 12, 2026
* origin/main:
  fix(cron): abort superseded reconciliation hooks (openclaw#104368)
  ci(release): expose Telegram runtime preflight stage (openclaw#104387)
  fix(status): avoid false shell-wrapper audit warnings (openclaw#81778)
  fix: retry live Gateway readiness proof (openclaw#104374)
  fix(exec-approval): stop misattributing Allow Always unavailability to policy (openclaw#97740)
  fix: preserve Mac bundle during live builds (openclaw#104376)
  chore(docs): translate with GPT-5.6 xhigh
  test: wire Control UI suite into CI, fix its broken tests, drop dead harness surface (openclaw#104361)
  fix(ui): hide group submenu separator when New group is the only entry (openclaw#104370)
  fix(discord): reset progress drafts across queued turns (openclaw#102341)
  docs(cli): clarify that exec-policy show and approvals get exclude per-session /exec overrides (openclaw#94999)
  fix(discord): single-source thread-binding default placement and guard artifact parity (openclaw#104342)
  fix(agents): add tool-activity heartbeat to keep subagent alive during tool calls (openclaw#95536)
  fix(maint): reuse recent same-PR hosted gates (openclaw#104355)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime P2 Normal backlog priority with limited blast radius. proof: supplied External PR includes structured after-fix real behavior proof. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: S status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gateway status incorrectly reports LaunchAgent command missing gateway subcommand

4 participants