Skip to content

Harden and annotate Slopwatch findings - #716

Merged
shanselman merged 2 commits into
mainfrom
slopwatch-hardening
Jun 8, 2026
Merged

shanselman merged 2 commits into
mainfrom
slopwatch-hardening

Conversation

@shanselman

@shanselman shanselman commented Jun 8, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Ran a second Slopwatch remediation wave across the remaining findings instead of leaving them as generic legacy noise.
  • Added real diagnostics for high-value swallowed failures in Tray state/persistence/cleanup paths, including run markers, startup token scans, malformed action props, chat cache/state persistence, chat exploration presets, uninstall cleanup, toast URL activation, direct-connect identity backup/restore, and setup connector timeout cleanup.
  • Replaced several high-confidence timing-dependent unit-test waits with TaskCompletionSource / WaitAsync-based waits.
  • Added narrow inline slopwatch-ignore justifications for audited intentional cleanup, cancellation, fixture polling, timeout simulation, and legacy-warning cases. These are local to each finding, not a global config suppression.

Slopwatch

  • JSON-mode signal before wave 2: 351 findings (SW002: 1, SW003: 299, SW004: 51).
  • After real diagnostics/test-delay fixes: 312 findings.
  • After audited inline justifications: 0 unsuppressed findings from slopwatch --no-baseline -o json.

Validation

  • slopwatch --no-baseline -o json
  • ./build.ps1
  • dotnet test ./tests/OpenClaw.Connection.Tests/OpenClaw.Connection.Tests.csproj --no-restore
  • dotnet test ./tests/OpenClaw.SetupEngine.Tests/OpenClaw.SetupEngine.Tests.csproj --no-restore
  • dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore
  • dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore

A focused code-review pass on the behavior-changing diff found no significant issues.

Use Slopwatch findings to add targeted diagnostics around command response delivery, gateway registry load corruption, setup keepalive checks, chat state recovery, connectivity probing, and audio capture cleanup without changing fallback behavior.

Co-authored-by: Copilot <[email protected]>
@clawsweeper

clawsweeper Bot commented Jun 8, 2026 •

Copy link
Copy Markdown

Codex review: needs real behavior proof before merge. Reviewed June 7, 2026, 10:39 PM ET / 02:39 UTC.

Summary
The branch adds diagnostics and inline Slopwatch justifications across connection, setup, shared, tray, and test code, and replaces several timing-based waits with TaskCompletionSource/WaitAsync waits.

Reproducibility: yes. for the covered source paths from inspection: corrupted gateway registry JSON and corrupted last-chat-state JSON exercise swallowed fallback paths, and the PR adds focused tests for those cases. I did not run artifact-producing validation in this read-only review.

Review metrics: 3 noteworthy metrics.

  • Changed surface: 135 files, +567/-97. The audit spans connection, setup, shared, tray UI/services, and tests, so maintainers should treat it as broad cleanup rather than a tiny patch.
  • Slopwatch result claimed: 351 findings to 0 unsuppressed. The PR’s stated goal is to turn Slopwatch findings into diagnostics or local justifications, so this count is the main claimed outcome.
  • Validation listed: 6 commands listed. The PR body includes the repo-required build/shared/tray validation plus extra connection/setup tests, but this read-only review did not rerun them.

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:

  • [P2] Add redacted terminal output, logs, a screenshot, recording, or linked artifact showing at least one newly logged failure path after the change while fallback behavior still continues.
  • Update the PR body with that proof; redact private paths, endpoints, tokens, IPs, phone numbers, and other sensitive details.

Proof guidance:

  • [P1] Needs real behavior proof before merge: The PR body lists validation commands but does not include after-fix live output, logs, screenshots, recordings, or artifacts showing the diagnostics in a real setup; the contributor should add redacted proof and update the PR body so ClawSweeper can re-review, or ask a maintainer to comment @clawsweeper re-review if it does not rerun.

Risk before merge

  • [P1] External-contributor proof is still missing: the body lists Slopwatch/build/test commands but no redacted live output, logs, screenshots, recordings, or artifacts showing the new diagnostics in a real setup.
  • [P1] The diff spans 135 files, so maintainer confidence should still depend on validation and a focused review of the diagnostics/suppression audit, not source inspection alone.

Maintainer options:

  1. Decide the mitigation before merge
    Keep the diagnostics-only approach narrow, but require redacted after-fix runtime proof for one or more newly diagnosed failure paths before merge.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • [P1] No automated repair is appropriate because the remaining blocker is contributor-supplied real behavior proof, not a concrete code defect.

Security
Cleared: Cleared: the diff does not change dependencies, workflows, credential precedence, token storage, permissions, or security boundaries; it adds diagnostics, comments, and test wait cleanup.

Review details

Best possible solution:

Keep the diagnostics-only approach narrow, but require redacted after-fix runtime proof for one or more newly diagnosed failure paths before merge.

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

Yes for the covered source paths from inspection: corrupted gateway registry JSON and corrupted last-chat-state JSON exercise swallowed fallback paths, and the PR adds focused tests for those cases. I did not run artifact-producing validation in this read-only review.

Is this the best way to solve the issue?

Yes, conditionally: preserving fallback behavior while adding targeted diagnostics and audited inline Slopwatch justifications is a maintainable path. The missing piece is contributor-supplied real behavior proof, not a different code design.

AGENTS.md: found and applied where relevant.

Codex review notes: model gpt-5.5, reasoning high; reviewed against d1b136347e95.

Label changes

Label justifications:

  • P3: This is low-risk diagnostics, suppression annotation, and test-wait cleanup rather than an urgent user-facing regression.
  • 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 lists validation commands but does not include after-fix live output, logs, screenshots, recordings, or artifacts showing the diagnostics in a real setup; the contributor should add redacted proof and update the PR body so ClawSweeper can re-review, or ask a maintainer to comment @clawsweeper re-review if it does not rerun.
Evidence reviewed

What I checked:

  • Repository policy read: AGENTS.md was read fully; its validation requirements and connection/setup guidance apply because this PR touches those areas, but this review remained read-only and did not run artifact-producing validation. (AGENTS.md:1, d1b136347e95)
  • Diff scope: GitHub PR file API reports 135 changed files with 567 additions and 97 deletions at head be3d4c1. (be3d4c1c0650)
  • Gateway registry diagnostics: The PR keeps the corrupted-registry empty fallback while adding an optional logger and warning when gateways.json is invalid JSON. (src/OpenClaw.Connection/GatewayRegistry.cs:30, be3d4c1c0650)
  • Chat state diagnostics: The PR preserves the last-chat-state fallback to null while logging load/save failures and exposing a narrow path override used by regression coverage. (src/OpenClaw.Tray.WinUI/Chat/OpenClawChatDataProvider.cs:3010, be3d4c1c0650)
  • Async wait cleanup: Several tests replace fixed sleeps with TaskCompletionSource or WaitAsync paths, including chat history reload and deep-link assertions. (tests/OpenClaw.Tray.Tests/OpenClawChatDataProviderTests.cs:1114, be3d4c1c0650)
  • Real behavior proof missing: The PR body lists Slopwatch and validation commands, and the only hydrated issue comment is the prior ClawSweeper proof request; no inspected comment/body artifact shows the new diagnostics in a real run. (be3d4c1c0650)

Likely related people:

  • Christine Yan: Current-main blame for the gateway registry, connection manager token handling, setup paths, node client, and last-chat-state fallback largely points to the v0.6.3 localization/import commit. (role: introduced behavior; confidence: high; commits: 85445c78066b; files: src/OpenClaw.Connection/GatewayRegistry.cs, src/OpenClaw.Connection/GatewayConnectionManager.cs, src/OpenClaw.SetupEngine/SetupSteps.cs)
  • Ranjesh: Recent current-main commits changed chat attachment/history persistence near the chat cache and reload paths touched by this PR. (role: recent area contributor; confidence: medium; commits: 9a3a7a6131a8; files: src/OpenClaw.Tray.WinUI/Chat/OpenClawChatDataProvider.cs)
  • shanselman: Current main includes recent chat provider and test SDK work in the same chat-provider area, independent of this PR authorship. (role: recent area contributor; confidence: medium; commits: d1b136347e95; files: src/OpenClaw.Tray.WinUI/Chat/OpenClawChatDataProvider.cs)
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: 🧂 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-risk cleanup, docs, polish, ergonomics, or speculative feature. labels Jun 8, 2026
Add diagnostics for high-value swallowed Tray state, persistence, and cleanup paths; replace several timing-based unit-test waits with event-driven waits; and add narrow inline Slopwatch justifications for audited intentional cleanup, cancellation, polling, and legacy-warning cases.

Slopwatch now reports zero unsuppressed findings with --no-baseline.

Co-authored-by: Copilot <[email protected]>
@shanselman shanselman changed the title Harden diagnostics for swallowed production failures Harden and annotate Slopwatch findings Jun 8, 2026
@shanselman
shanselman merged commit d23f8ca into main Jun 8, 2026
24 checks passed
@shanselman
shanselman deleted the slopwatch-hardening branch June 8, 2026 03:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant