Skip to content

Expose WhatsApp responsiveness doctor lint findings#98406

Merged
giodl73-repo merged 3 commits into
openclaw:mainfrom
giodl73-repo:doctor-whatsapp-responsiveness-lint-findings
Jul 3, 2026
Merged

Expose WhatsApp responsiveness doctor lint findings#98406
giodl73-repo merged 3 commits into
openclaw:mainfrom
giodl73-repo:doctor-whatsapp-responsiveness-lint-findings

Conversation

@giodl73-repo

@giodl73-repo giodl73-repo commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add default-disabled core/doctor/whatsapp-responsiveness structured lint findings
  • reuse the existing WhatsApp responsiveness signal: WhatsApp enabled + degraded Gateway event loop + local TUI clients
  • keep real cleanup in the existing doctor --fix path; lint only reports the actionable pressure state
  • keep selected lint side-effect-free: skip exec SecretRefs unless allowed, use a quiet Gateway status RPC, and pass deviceIdentity: null so lint cannot create Gateway identity state

Public contract

  • No config schema, plugin manifest, SDK export, persisted data-model, or public plugin contract changes.
  • The new check is opt-in for broad lint via defaultEnabled: false; default doctor --lint remains unchanged.

Validation

  • node scripts/run-vitest.mjs src/commands/doctor-whatsapp-responsiveness.test.ts src/flows/doctor-health-contributions.test.ts (71 tests)
  • .\node_modules\.bin\oxfmt.cmd --check src/commands/doctor-whatsapp-responsiveness.ts src/commands/doctor-whatsapp-responsiveness.test.ts src/flows/doctor-health-contributions.ts src/flows/doctor-health-contributions.test.ts
  • .\node_modules\.bin\oxlint.cmd --tsconfig config/tsconfig/oxlint.core.json src/commands/doctor-whatsapp-responsiveness.ts src/commands/doctor-whatsapp-responsiveness.test.ts src/flows/doctor-health-contributions.ts src/flows/doctor-health-contributions.test.ts
  • node scripts/plugin-sdk-surface-report.mjs --check
  • node scripts/sync-plugin-sdk-exports.mjs --check
  • git diff --check origin/main...HEAD

Not completed: pnpm tsgo:core timed out on this Windows linked worktree without diagnostics after 180s.

Real behavior proof

  • Source CLI with isolated OPENCLAW_STATE_DIR and OPENCLAW_CONFIG_PATH, WhatsApp enabled, selected check only:
    • node scripts/run-node.mjs doctor --lint --json --only core/doctor/whatsapp-responsiveness
    • exited 0, ran 1 check, emitted 0 findings because Gateway did not provide degraded event-loop status
    • verified <temp-state>/identity/device.json was not created (IdentityExists: false), proving the selected lint probe did not create Gateway device identity state
  • Focused source tests prove the positive selected-lint signal: WhatsApp enabled + eventLoop.degraded === true + local TUI process emits a warning finding with requirement: "local-tui-event-loop-pressure" and a doctor --fix hint.
  • Focused contribution tests prove the selected lint path uses quiet callGateway({ method: "status", params: { includeChannelSummary: false }, deviceIdentity: null }), does not call checkGatewayHealth, returns no finding without calling runtime.error when Gateway status is unavailable, and does not call Gateway at all for exec SecretRefs unless exec refs are allowed.

ClawSweeper follow-up

  • Addressed P2 “Avoid creating device identity during lint probes” by passing deviceIdentity: null to the selected lint Gateway status call and asserting that in the contribution regression.
  • Addressed Omar's exec SecretRef concern by skipping selected lint Gateway status probes unless exec refs are allowed.
  • Addressed the Windows-only WhatsApp process-list test mismatch by asserting the intentional Windows skip instead of POSIX ps parsing on Windows.

@openclaw-barnacle openclaw-barnacle Bot added commands Command implementations size: M maintainer Maintainer-authored PR labels Jul 1, 2026
@giodl73-repo

Copy link
Copy Markdown
Contributor Author

@clawsweeper review

@clawsweeper

clawsweeper Bot commented Jul 1, 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.

@clawsweeper

clawsweeper Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 3, 2026, 2:48 PM ET / 18:48 UTC.

Summary
The PR adds a default-disabled core/doctor/whatsapp-responsiveness doctor lint check that reuses the existing degraded-Gateway/local-TUI WhatsApp signal and adds focused regression coverage.

PR surface: Source +66, Tests +231. Total +297 across 4 files.

Reproducibility: not applicable. as a feature PR rather than a bug report. The current-main absence and PR-head selected-lint behavior are source-verifiable, with PR proof for the read-only selected path.

Review metrics: 1 noteworthy metric.

  • Doctor lint surface: 1 default-disabled core check added. The check is user-selectable with --only or --all, while default doctor --lint behavior remains unchanged.

Stored data model
Persistent data-model change detected: migration/backfill/repair: src/commands/doctor-whatsapp-responsiveness.test.ts, migration/backfill/repair: src/commands/doctor-whatsapp-responsiveness.ts, migration/backfill/repair: src/flows/doctor-health-contributions.test.ts, migration/backfill/repair: src/flows/doctor-health-contributions.ts, unknown-data-model-change: src/commands/doctor-whatsapp-responsiveness.test.ts, unknown-data-model-change: src/commands/doctor-whatsapp-responsiveness.ts, and 1 more. Confirm migration or upgrade compatibility proof before merge.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🐚 platinum hermit
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

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

Rank-up moves:

  • none.

Next step before merge

  • [P2] No repair job is needed; current head has no blocking findings and the remaining action is protected-label maintainer merge/check gating.

Security
Cleared: No concrete security or supply-chain concern remains after inspecting the Gateway credential, exec SecretRef, and device-identity paths touched by the diff.

Review details

Best possible solution:

Land the default-disabled structured doctor lint check after maintainer review, keeping the existing doctor --fix path as the only mutation owner and preserving the read-only Gateway probe behavior.

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

Not applicable as a feature PR rather than a bug report. The current-main absence and PR-head selected-lint behavior are source-verifiable, with PR proof for the read-only selected path.

Is this the best way to solve the issue?

Yes. Reusing the existing WhatsApp responsiveness signal and keeping the lint check default-disabled/read-only is the narrow maintainable solution; the earlier human-facing Gateway health helper approach was correctly replaced.

AGENTS.md: found and applied where relevant.

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

Label changes

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body and exact-head Real behavior proof check show selected source CLI lint running in isolated state without creating device identity; focused tests cover the positive warning path.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.

Label justifications:

  • P3: This is a low-blast-radius opt-in doctor lint enhancement with no config, SDK, plugin manifest, or persisted data-model change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body and exact-head Real behavior proof check show selected source CLI lint running in isolated state without creating device identity; focused tests cover the positive warning path.
Evidence reviewed

PR surface:

Source +66, Tests +231. Total +297 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 2 67 1 +66
Tests 2 238 7 +231
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 305 8 +297

What I checked:

  • Current main lacks the structured lint check: On current main, the WhatsApp responsiveness contribution only wires the legacy run path and has no healthChecks entry for core/doctor/whatsapp-responsiveness. (src/flows/doctor-health-contributions.ts:1915, df1452799b28)
  • PR head adds an opt-in check: The PR head adds healthChecks.id = core/doctor/whatsapp-responsiveness, keeps defaultEnabled: false, skips exec SecretRef probes unless allowed, and calls Gateway status with deviceIdentity: null. (src/flows/doctor-health-contributions.ts:1918, 39f003931ff8)
  • Finding mapper is narrow: The new mapper only emits a warning when WhatsApp is enabled, Gateway event-loop status is degraded, and local TUI processes are present; otherwise it returns no findings. (src/commands/doctor-whatsapp-responsiveness.ts:98, 39f003931ff8)
  • Default lint remains unchanged: The lint runner skips default-disabled checks unless --only or --all selects them, matching the PR's compatibility claim. (src/flows/doctor-lint-flow.ts:38, df1452799b28)
  • Gateway dependency contract checked: callGateway resolves configured SecretRef-backed credentials, and an omitted deviceIdentity would load or create device identity; the PR's explicit deviceIdentity: null avoids that state write path. (src/gateway/call.ts:1171, df1452799b28)
  • Exec SecretRef path checked: Gateway credential resolution materializes configured SecretRefs, and exec providers can run through the secret resolver, so the PR's exec-gate regression test covers a real security boundary. (src/gateway/credentials-secret-inputs.ts:311, df1452799b28)

Likely related people:

  • giodl73-repo: Authored prior merged WhatsApp responsiveness process-matching work and multiple merged default-disabled doctor lint finding PRs on the same doctor-health-contributions surface. (role: recent area contributor; confidence: high; commits: 1fb09069c342, 43a7fd383997, 6638a575d39d; files: src/commands/doctor-whatsapp-responsiveness.ts, src/commands/doctor-whatsapp-responsiveness.test.ts, src/flows/doctor-health-contributions.ts)
  • omarshahine: Identified the exec SecretRef security-boundary issue in this PR discussion with concrete source paths, and the current head's gate directly addresses that review. (role: reviewer; confidence: medium; files: src/flows/doctor-health-contributions.ts, src/gateway/call.ts, src/gateway/credentials-secret-inputs.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.

@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. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. labels Jul 1, 2026
@giodl73-repo

Copy link
Copy Markdown
Contributor Author

Addressed ClawSweeper's P2: selected WhatsApp responsiveness lint no longer calls the human-facing gateway health helper. It now uses a quiet direct Gateway status RPC, treats unavailable status as no WhatsApp-specific finding, and the focused contribution test proves no \ call on gateway failure. Refreshed PR body with validation and source CLI no-human-output proof. @clawsweeper re-review

@giodl73-repo

Copy link
Copy Markdown
Contributor Author

Clean correction to my prior comment: the focused contribution test proves selected lint does not call runtime.error when Gateway status is unavailable. The PR body has the correct text and validation details.

@giodl73-repo

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 1, 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.

@clawsweeper clawsweeper Bot added status: 🔁 re-review loop A fresh ClawSweeper review was explicitly requested after the latest review. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. and removed merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jul 1, 2026
@omarshahine

Copy link
Copy Markdown
Contributor

Codex review finding:

The selected lint detector can execute exec SecretRefs even though Doctor only permits that after --allow-exec. The new core/doctor/whatsapp-responsiveness detector calls callGateway() directly (src/flows/doctor-health-contributions.ts:1748-1757). The existing Gateway health path first checks hasActiveGatewayExecCredential(ctx) and skips unless ctx.options.allowExec === true (src/flows/doctor-health-contributions.ts:990-999), but this new lint path bypasses that gate. callGateway() resolves Gateway credentials through resolveGatewayCredentialsWithSecretInputs() (src/gateway/call.ts:748-761), which resolves SecretRefs (src/gateway/credentials-secret-inputs.ts:311-328) and can run exec providers (src/secrets/resolve.ts:771-782).

That means openclaw doctor --lint --only core/doctor/whatsapp-responsiveness can run an operator's exec secret provider without --allow-exec, which regresses the policy enforced by the sibling Gateway doctor check. Best fix: apply the same exec-credential skip behavior here, or use a status probe path that proves it never materializes exec SecretRefs.

@giodl73-repo

Copy link
Copy Markdown
Contributor Author

Addressed Omar's review finding about selected lint resolving exec SecretRefs without --allow-exec.

What changed:

  • core/doctor/whatsapp-responsiveness now checks for active Gateway exec SecretRefs before issuing the Gateway status RPC.
  • Without allowExecSecretRefs, selected lint skips the status probe and collects findings with status: undefined, so no exec provider is invoked.
  • Added a regression proving callGateway is not called for exec SecretRefs unless exec refs are allowed.

Validation:

  • node scripts/run-vitest.mjs src/flows/doctor-health-contributions.test.ts (57 tests)
  • changed-file oxfmt --check
  • changed-file oxlint
  • node scripts/plugin-sdk-surface-report.mjs --check
  • git diff --check

Noted while checking: src/commands/doctor-whatsapp-responsiveness.test.ts still has a Windows-only platform mismatch in the POSIX ps parsing test (listLocalTuiProcesses() intentionally returns [] on win32). I did not mix that unrelated test fix into this exec-gate patch.

@clawsweeper review

@clawsweeper

clawsweeper Bot commented Jul 2, 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.

@clawsweeper clawsweeper Bot added status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. and removed status: 🔁 re-review loop A fresh ClawSweeper review was explicitly requested after the latest review. labels Jul 2, 2026
@giodl73-repo
giodl73-repo force-pushed the doctor-whatsapp-responsiveness-lint-findings branch from 9fa0243 to 80d5662 Compare July 3, 2026 18:19
@giodl73-repo

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review exact head 80d5662. Rebased onto current main after #98729, fixed the selected lint Gateway status probe to pass deviceIdentity: null, added/updated regression coverage for the read-only call shape, and fixed the Windows-only POSIX process-list test mismatch. Focused Vitest, changed-file oxfmt/oxlint, SDK surface report, SDK export sync, diff-check, and selected source CLI no-identity-write proof passed. pnpm tsgo:core timed out locally on Windows without diagnostics.

@clawsweeper

clawsweeper Bot commented Jul 3, 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.

@giodl73-repo

Copy link
Copy Markdown
Contributor Author

Maintainer note for the remaining positive-proof ask: accepted for review readiness.

The concrete lint side-effect issue is fixed on 80d566242ae7a5eebdca1e46f47ed069e12c030b: selected lint now calls Gateway status with deviceIdentity: null, and source CLI proof against an isolated state dir verified <state>/identity/device.json was not created.

I am not requiring a live degraded-Gateway/local-TUI recording before review. The positive warning path is covered by focused source tests that inject the degraded Gateway event-loop status plus local TUI process and assert the structured warning/fix hint. The real CLI proof covers the important read-only selected-lint behavior in an isolated state/config setup.

@giodl73-repo
giodl73-repo marked this pull request as ready for review July 3, 2026 18:23
@giodl73-repo
giodl73-repo force-pushed the doctor-whatsapp-responsiveness-lint-findings branch from 80d5662 to 39f0039 Compare July 3, 2026 18:33
@giodl73-repo

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review exact head 39f0039. Fixed the CI check-test-types failure by typing the WhatsApp responsiveness findings mock as readonly HealthFinding[]. Re-ran focused Vitest, changed-file oxfmt/oxlint, diff-check, and selected source CLI no-identity-write proof on this head; selected lint exits 0, runs 1 check, and does not create <state>/identity/device.json.

@clawsweeper

clawsweeper Bot commented Jul 3, 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.

@clawsweeper clawsweeper Bot removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jul 3, 2026
@giodl73-repo

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review exact head 39f0039 after CI type-fix push. Current head has focused Vitest, changed-file oxfmt/oxlint, diff-check, and selected source CLI no-identity-write proof passing.

@giodl73-repo

Copy link
Copy Markdown
Contributor Author

@clawsweeper review exact current head 39f0039. The durable review is stale on 80d5662; exact-head CI is clean and proof/body are updated.

@giodl73-repo

Copy link
Copy Markdown
Contributor Author

Maintainer note for ClawSweeper remaining review item: accepted.

I accept the new opt-in Doctor lint surface core/doctor/whatsapp-responsiveness and warning copy. The check is default-disabled, only visible through doctor --lint --all or explicit --only, and default doctor --lint remains unchanged.

The selected lint path is read-only for the reviewed sensitive cases: exec SecretRefs are skipped unless allow-exec is enabled, and the quiet Gateway status call uses deviceIdentity: null so it does not create Gateway device identity state. Real cleanup remains in the existing doctor --fix path.

@giodl73-repo
giodl73-repo merged commit 6011c9e into openclaw:main Jul 3, 2026
102 of 107 checks passed
@giodl73-repo

Copy link
Copy Markdown
Contributor Author

Maintainer merge closeout:

  • Source head: 39f003931ff8cd93f945e75bf7a480cf2271c910
  • Squash merge: 6011c9e16d212fa9be7da9211c0dffddaf059c27
  • Verification: focused WhatsApp responsiveness/contribution Vitest passed (71 tests); changed-file oxfmt; changed-file oxlint with core tsconfig; SDK surface report; SDK export sync; git diff --check; exact-head hosted checks passed/skipped, with only older superseded proof/auto-response runs cancelled.
  • Earlier selected source CLI proof on this head passed for doctor --lint --json --only core/doctor/whatsapp-responsiveness and did not create <state>/identity/device.json.
  • ClawSweeper was platinum/proof-sufficient/ready for maintainer review.
  • Maintainer accepted the opt-in lint check id and warning copy. No public config/plugin/SDK/persisted data contract change; default doctor --lint remains unchanged.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 4, 2026
Adds a default-disabled Doctor lint check for WhatsApp responsiveness pressure while keeping real cleanup in the existing doctor --fix path.

Verification:
- Focused WhatsApp responsiveness/contribution Vitest passed (71 tests).
- Changed-file oxfmt passed.
- Changed-file oxlint with core tsconfig passed.
- SDK surface report passed.
- SDK export sync passed.
- git diff --check passed.
- Selected source CLI proof passed earlier on this head: doctor --lint --json --only core/doctor/whatsapp-responsiveness exited 0, ran 1 check, and did not create <state>/identity/device.json.
- Exact-head hosted checks passed/skipped on 39f0039; older cancelled proof/auto-response runs were superseded by passing current runs.

Maintainer notes:
- ClawSweeper platinum hermit / ready for maintainer review.
- Accepted the opt-in lint check id and warning copy on the PR.
- No public config/plugin/SDK/persisted data contract change; default doctor --lint remains unchanged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants