Skip to content

Doctor: expose extra gateway service findings#84340

Merged
giodl73-repo merged 6 commits into
openclaw:mainfrom
giodl73-repo:doctor-gateway-services-structured-repairs
Jun 23, 2026
Merged

Doctor: expose extra gateway service findings#84340
giodl73-repo merged 6 commits into
openclaw:mainfrom
giodl73-repo:doctor-gateway-services-structured-repairs

Conversation

@giodl73-repo

@giodl73-repo giodl73-repo commented May 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Exposes the extra gateway service Doctor checks as structured health findings.
  • Adds dry-run repair effects for legacy Gateway cleanup that Doctor already knows how to describe.
  • Keeps the existing doctor:gateway-services legacy run path authoritative for normal doctor / doctor --fix mutation.
  • Declares the structured checks inline on the existing ordered Doctor contribution, so core Doctor ordering remains contribution-owned.
  • Preserves compatibility for intentional non-legacy extra Gateway services by reporting them as informational instead of warning-level lint failures.

This is intentionally the Gateway services slice from the Doctor repair stack. It does not change Gateway startup, provider config, or plugin health behavior.

Stack

Review order: this is the next Doctor structured-repair PR after #84326. The branch itself is rebased on current main; #86627 has landed and supplies the ordered core Doctor contribution model.

Current branch head is signed commit 1818dcab5c5ba0c592b976e45955ac67a3c0d1e5 (Keep doctor lint deep internal). The latest commit removes deep from the public HealthCheckContext SDK contract while keeping doctor --lint --deep available to core Doctor checks. The prior rebased-base cleanup for the unused sessionStore destructure remains included so prod type/lint CI passes on current main.

Real behavior proof

Behavior or issue addressed:
Extra or legacy Gateway-like services are visible through structured Doctor health checks, while normal mutating service cleanup remains owned by the existing doctor:gateway-services run path. Intentional non-legacy extra Gateway services are non-failing by default; legacy Gateway services remain warning-level and repairable.

Real environment tested:
WSL Ubuntu 24.04, OpenClaw checkout /root/src/openclaw-84340-proof, prior PR head 5d57cbeccc55509c3867bb4c964a0094c6869293, source CLI via node scripts/run-node.mjs, source harness via node --import tsx --input-type=module, isolated temp OPENCLAW_STATE_DIR, temp OPENCLAW_CONFIG_PATH, temp HOME, and a synthetic legacy user systemd unit. The branch has since been rebased and updated to 8fb226be72dc33af84aa63fb14d4ae4b68adafab; the latest functional Gateway-services behavior is unchanged.

Exact steps or command run after this patch:

  1. Reused the isolated source CLI lint proof for a synthetic legacy clawdbot-gateway.service unit.
  2. Ran a source harness importing extraGatewayServiceToHealthFinding, extraGatewayServiceToRepairEffects, and exitCodeFromFindings.
  3. The harness compared an intentional non-legacy extra Gateway service with a legacy Gateway service under the default lint threshold.
  4. Ran focused validation for Gateway-services and Doctor contribution tests.
  5. Ran changed-file checks: targeted oxlint, targeted oxfmt --check, git diff --check, and pnpm tsgo:core.
  6. After the test-only CI follow-up, ran the failed CI coverage locally: src/cli/program/register.maintenance.test.ts, src/flows/doctor-core-checks.test.ts, pnpm check:test-types, and pnpm tsgo:core.
  7. Removed the unused sessionStore destructure exposed by current upstream/main, then reran pnpm tsgo:core successfully.

Evidence after fix:

{
  "intentional": {
    "severity": "info",
    "fixHint": "Run a single gateway per machine unless this extra gateway is intentional.",
    "defaultLintExit": 0,
    "repairEffects": []
  },
  "legacy": {
    "severity": "warning",
    "fixHint": "Run openclaw doctor --fix to remove legacy gateway services.",
    "defaultLintExit": 1,
    "repairEffects": [
      {
        "kind": "service",
        "action": "would-remove-legacy-gateway-service",
        "target": "openclaw-gateway.service",
        "dryRunSafe": false
      }
    ]
  }
}

The earlier real CLI proof still applies to the legacy path: doctor --lint --json --only core/doctor/gateway-services/extra reports the synthetic legacy clawdbot-gateway.service as a structured warning with the expected check id, Linux source, target service label, and fix hint.

Observed result after fix:
Intentional non-legacy extra Gateway services are visible in structured output without failing default doctor --lint. Legacy Gateway services remain warning-level, fail default lint, and expose the dry-run cleanup effect.

What was not tested:
The proof uses synthetic Gateway service fixtures, not a real installed or running Gateway service. I did not run full doctor --fix service cleanup in WSL because the mutating cleanup path can invoke systemd/service-management behavior; the PR intentionally keeps that existing legacy run path authoritative.

ClawSweeper and maintainer status

Latest visible ClawSweeper status:

  • Proof: sufficient.
  • Status label: ready for maintainer look.
  • No concrete contributor-facing blocker remains from the latest durable review.

Maintainer findings to accept before merge:

  • Default doctor --lint now reports and fails warning-and-above findings; info findings require --severity-min info.
  • The structured repair preview intentionally coexists with the legacy Gateway-services mutation path until that rule is deliberately moved fully behind structured health.

Severity finding:

  • Keep legacy extra Gateway services at warning; they are actionably stale service state with an existing openclaw doctor --fix correction path.
  • Keep intentional non-legacy extra Gateway services at info; they are noteworthy but can be left in place indefinitely when intentional.
  • RFC pointer: RFC: Doctor health upgrades rfcs#1, rfcs/needs_refactoring/0002-doctor-health-upgrades.md, records the Doctor warning/info severity bar in the structured health contract.

Validation

Current head 8fb226be72dc33af84aa63fb14d4ae4b68adafab:

  • $env:OPENCLAW_VITEST_MAX_WORKERS='1'; node scripts\run-vitest.mjs run src\commands\doctor-gateway-services.test.ts src\commands\doctor-lint.test.ts src\flows\doctor-core-checks.test.ts src\flows\doctor-health-contributions.test.ts src\cli\program\register.maintenance.test.ts --reporter=dot - 121 tests passed across 3 shards
  • pnpm exec oxlint src\cli\program\register.maintenance.test.ts src\cli\program\register.maintenance.ts src\commands\doctor-gateway-services.test.ts src\commands\doctor-gateway-services.ts src\commands\doctor-lint.test.ts src\commands\doctor-lint.ts src\flows\doctor-core-checks.test.ts src\flows\doctor-core-checks.ts src\flows\doctor-health-contributions.test.ts src\flows\doctor-health-contributions.ts src\flows\health-checks.ts src\config\sessions\session-accessor.ts
  • pnpm exec oxfmt --check src\cli\program\register.maintenance.test.ts src\cli\program\register.maintenance.ts src\commands\doctor-gateway-services.test.ts src\commands\doctor-gateway-services.ts src\commands\doctor-lint.test.ts src\commands\doctor-lint.ts src\flows\doctor-core-checks.test.ts src\flows\doctor-core-checks.ts src\flows\doctor-health-contributions.test.ts src\flows\doctor-health-contributions.ts src\flows\health-checks.ts src\config\sessions\session-accessor.ts
  • pnpm tsgo:core
  • pnpm tsgo:test:src
  • git diff --check

Follow-up 1818dcab5c5ba0c592b976e45955ac67a3c0d1e5:

  • OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/run-vitest.mjs run src/commands/doctor-lint.test.ts src/flows/doctor-core-checks.test.ts src/commands/doctor-gateway-services.test.ts src/flows/doctor-health-contributions.test.ts src/cli/program/register.maintenance.test.ts --reporter=dot - 121 tests passed across 3 shards
  • node_modules/oxlint/bin/oxlint src/commands/doctor-lint.ts src/commands/doctor-lint.test.ts src/flows/doctor-core-checks.ts src/flows/doctor-core-checks.test.ts src/flows/health-checks.ts
  • node_modules/oxfmt/bin/oxfmt --check src/commands/doctor-lint.ts src/commands/doctor-lint.test.ts src/flows/doctor-core-checks.ts src/flows/doctor-core-checks.test.ts src/flows/health-checks.ts
  • node node_modules//native-preview/bin/tsgo.js -p tsconfig.core.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/core.tsbuildinfo --declaration false --singleThreaded --checkers 1
  • node node_modules//native-preview/bin/tsgo.js -p test/tsconfig/tsconfig.test.src.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/test-src.tsbuildinfo --declaration false --singleThreaded --checkers 1
  • git diff --check

@openclaw-barnacle openclaw-barnacle Bot added commands Command implementations agents Agent runtime and tooling size: XL maintainer Maintainer-authored PR labels May 19, 2026
@clawsweeper

clawsweeper Bot commented May 19, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed June 22, 2026, 3:18 AM ET / 07:18 UTC.

Summary
The branch adds structured Doctor health findings and repair-preview effects for extra gateway services, threads doctor --lint --deep into health checks, and changes default lint severity filtering to warning.

PR surface: Source +77, Tests +242. Total +319 across 11 files.

Reproducibility: not applicable. this is a PR review for a structured Doctor migration slice, not a bug report with a failing current-main reproduction.

Review metrics: 3 noteworthy metrics.

  • Lint default threshold: 1 changed: info -> warning. This changes which findings default doctor --lint emits and uses for exit status, which can affect CI or preflight scripts.
  • SDK-facing context fields: 1 added: HealthCheckContext.deep. The field is exposed through the public health SDK subpath, so maintainers should notice the contract expansion before merge.
  • Structured Doctor checks: 1 added: core/doctor/gateway-services/extra. The new check creates a stable id that users and automation may target with --only or suppress with --skip.

Stored data model
Persistent data-model change detected: migration/backfill/repair: src/commands/doctor-gateway-services.test.ts, migration/backfill/repair: src/commands/doctor-gateway-services.ts, migration/backfill/repair: src/commands/doctor-lint.test.ts, migration/backfill/repair: src/commands/doctor-lint.ts, migration/backfill/repair: src/flows/doctor-core-checks.test.ts, migration/backfill/repair: src/flows/doctor-core-checks.ts, and 7 more. Migration or upgrade compatibility proof is recorded; maintainers should verify it before merge.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🦞 diamond lobster
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.

Risk before merge

  • [P1] Existing automation that relied on default doctor --lint including or failing on info findings will need to opt in with --severity-min info.
  • [P1] HealthCheckContext.deep is additive, but it is re-exported through openclaw/plugin-sdk/health, so maintainers should accept it as public plugin health context surface.
  • [P1] The new structured repair preview intentionally coexists with the legacy gateway-services mutation path, which is a temporary dual-path Doctor migration contract.

Maintainer options:

  1. Accept the Doctor compatibility change
    Maintainers can accept that default doctor --lint now reports/fails warning-and-above findings while info findings require --severity-min info.
  2. Preserve the old lint default
    If existing automation compatibility matters more, require a revision that keeps the old info default and handles intentional extra gateways through a narrower check-specific behavior.
  3. Pause SDK context growth
    If HealthCheckContext.deep should not become plugin-facing yet, pause this PR until maintainers choose a private core-only context path or document the public contract.

Next step before merge

  • [P2] Manual review is appropriate because the protected maintainer label and compatibility-sensitive lint/SDK changes require maintainer acceptance rather than an automated repair.

Security
Cleared: The diff only touches Doctor CLI/flow TypeScript and tests; it does not add dependencies, workflow permissions, secrets handling, package metadata, or new external code execution.

Review details

Best possible solution:

Land only after maintainers explicitly accept the lint-default and SDK-context compatibility changes as part of the structured Doctor migration series, keeping legacy gateway cleanup authoritative until a deliberate full switchover.

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

Not applicable; this is a PR review for a structured Doctor migration slice, not a bug report with a failing current-main reproduction.

Is this the best way to solve the issue?

Yes, the implementation follows the merged ordered-contribution migration shape and keeps real gateway cleanup in the existing legacy path; the remaining question is compatibility/product acceptance, not a code defect.

AGENTS.md: found and applied where relevant.

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

Label changes

Label justifications:

  • P2: This is a normal-priority Doctor CLI/health-check improvement with limited but real compatibility impact.
  • merge-risk: 🚨 compatibility: The diff changes default lint threshold behavior and adds a plugin-SDK-facing health context field.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR body includes after-fix terminal proof from WSL source CLI and harness runs showing legacy extras as warning/failing and intentional extras as informational/non-failing, plus focused validation output.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes after-fix terminal proof from WSL source CLI and harness runs showing legacy extras as warning/failing and intentional extras as informational/non-failing, plus focused validation output.
Evidence reviewed

PR surface:

Source +77, Tests +242. Total +319 across 11 files.

View PR surface stats
Area Files Added Removed Net
Source 6 83 6 +77
Tests 5 249 7 +242
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 11 332 13 +319

What I checked:

  • Root and scoped policy applied: Root policy treats CLI, Doctor, plugin API, defaults, and fallback changes as compatibility-sensitive, and the plugin SDK guide applies because HealthCheckContext is re-exported through openclaw/plugin-sdk/health. (AGENTS.md:1, c57fee8239ed)
  • Current-main baseline: Current main still defaults doctor --lint severity to info and lacks the new deep lint context wiring, so this PR is not obsolete on main. (src/commands/doctor-lint.ts:46, c57fee8239ed)
  • Structured gateway service check: The PR head adds detectExtraGatewayServiceIssues, maps legacy services to warning findings, maps intentional extra services to info findings, and exposes dry-run service cleanup effects only for legacy services. (src/commands/doctor-gateway-services.ts:236, 5d57cbeccc00)
  • Legacy Doctor path preserved: The PR head routes the existing human Doctor gateway-services contribution through the shared detector while leaving real cleanup in the existing maybeScanExtraGatewayServices path. (src/commands/doctor-gateway-services.ts:697, 5d57cbeccc00)
  • Lint default and deep context changed: The PR head changes the default CLI severity threshold from info to warning and passes deep into HealthCheckContext. (src/commands/doctor-lint.ts:47, 5d57cbeccc00)
  • SDK-facing type exposure: HealthCheckContext.deep is present in the PR head and src/plugin-sdk/health.ts re-exports HealthCheckContext, making this an additive public plugin health contract change. (src/flows/health-checks.ts:52, 5d57cbeccc00)

Likely related people:

  • giodl73-repo: Authored the merged ordered Doctor health contribution model in Keep core doctor health in contribution order #86627 and authored the current structured gateway-services branch. (role: feature-history owner; confidence: high; commits: e56fd1dc0466, 04be37cbc5ea, 0bd7b083648d; files: src/flows/doctor-core-checks.ts, src/flows/doctor-health-contributions.ts, src/commands/doctor-gateway-services.ts)
  • vincentkoc: Current-main blame and log for the central Doctor lint, gateway-services, and contribution files point to recent baseline lint/test gate repair work on those same paths. (role: recent area contributor; confidence: medium; commits: a9be81d51036, c57fee8239ed; files: src/commands/doctor-lint.ts, src/commands/doctor-gateway-services.ts, src/flows/doctor-core-checks.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. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. labels May 19, 2026
@clawsweeper

clawsweeper Bot commented May 19, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper PR egg

🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat.

Where did the egg go?
  • The egg game starts only after the PR passes the real-behavior proof check.
  • Before that, no creature or rarity is rolled. The treat waits for real proof.
  • This is still just collectible flavor: proof affects review readiness, not creature quality.

@giodl73-repo
giodl73-repo force-pushed the doctor-gateway-services-structured-repairs branch from 6412d3f to 2cd30e3 Compare May 19, 2026 23:46
@giodl73-repo
giodl73-repo force-pushed the doctor-gateway-services-structured-repairs branch 2 times, most recently from 5e24059 to 02f5ff9 Compare May 20, 2026 04:32
@giodl73-repo
giodl73-repo force-pushed the doctor-gateway-services-structured-repairs branch from 02f5ff9 to 51ab30c Compare May 20, 2026 22:53
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels May 20, 2026
@giodl73-repo
giodl73-repo force-pushed the doctor-gateway-services-structured-repairs branch 7 times, most recently from 591b40d to ab2b9dc Compare May 22, 2026 20:02
@giodl73-repo
giodl73-repo force-pushed the doctor-gateway-services-structured-repairs branch from ab2b9dc to 583a243 Compare May 24, 2026 04:02
@clawsweeper

clawsweeper Bot commented Jun 19, 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

@clawsweeper re-review

Updated the branch to signed head bfe89099c77fe1a87bfb2a77dade63a068071a60 with fix(doctor): keep intentional extra gateways informational.

This addresses the compatibility finding: non-legacy extra gateway services now produce severity: "info", do not fail default doctor --lint, and still have no repair effects. Legacy gateway services remain warning-level, fail default lint, and still expose would-remove-legacy-gateway-service.

Validation passed locally: focused gateway/contribution Vitest (82 tests), targeted oxlint, targeted oxfmt --check, git diff --check, and pnpm tsgo:core. The PR body includes the current-head proof snippet showing default lint exit 0 for intentional extras and 1 for legacy extras.

@clawsweeper

clawsweeper Bot commented Jun 19, 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

@clawsweeper re-review

Pushed a4bcd70 to address the structured gateway-services deep-scan parity finding.

Change made:

  • Added deep to the health-check context.
  • doctor --lint now forwards --deep into runDoctorLintCli and health-check context.
  • core/doctor/gateway-services/extra now passes deep through both detect and repair-preview paths.
  • Added regressions for lint context deep propagation and gateway structured detect/repair-preview propagation.
  • Kept the existing gateway symlink realpath test platform-stable on Windows by normalizing separators in the mock.

Validation:

  • OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/run-vitest.mjs src/commands/doctor-gateway-services.test.ts src/commands/doctor-lint.test.ts src/flows/doctor-core-checks.test.ts src/flows/doctor-health-contributions.test.ts --reporter=dot
  • pnpm exec oxlint src/commands/doctor-gateway-services.ts src/commands/doctor-gateway-services.test.ts src/commands/doctor-lint.ts src/commands/doctor-lint.test.ts src/cli/program/register.maintenance.ts src/flows/health-checks.ts src/flows/doctor-core-checks.ts src/flows/doctor-core-checks.test.ts src/flows/doctor-health-contributions.ts src/flows/doctor-health-contributions.test.ts
  • pnpm exec oxfmt --check src/commands/doctor-gateway-services.ts src/commands/doctor-gateway-services.test.ts src/commands/doctor-lint.ts src/commands/doctor-lint.test.ts src/cli/program/register.maintenance.ts src/flows/health-checks.ts src/flows/doctor-core-checks.ts src/flows/doctor-core-checks.test.ts src/flows/doctor-health-contributions.ts src/flows/doctor-health-contributions.test.ts
  • pnpm tsgo:core
  • git diff --check

@clawsweeper

clawsweeper Bot commented Jun 21, 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

@clawsweeper re-review

Updated #84340 at head 866c82e6f3 to address the default lint threshold finding:

  • doctor --lint now defaults the CLI severity threshold to warning, matching exitCodeFromFindings and avoiding a failing exit for informational findings unless the operator explicitly requests --severity-min info.
  • Added coverage that default JSON lint hides/does not fail an info extension finding, and explicit severityMin: "info" still reports and fails that same finding.

Validation on 866c82e6f3:

  • OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/run-vitest.mjs src/commands/doctor-lint.test.ts src/commands/doctor-gateway-services.test.ts src/flows/doctor-core-checks.test.ts src/flows/doctor-health-contributions.test.ts --reporter=dot
  • pnpm exec oxlint src/commands/doctor-lint.ts src/commands/doctor-lint.test.ts
  • pnpm exec oxfmt --check src/commands/doctor-lint.ts src/commands/doctor-lint.test.ts
  • pnpm tsgo:core
  • git diff --check

@clawsweeper

clawsweeper Bot commented Jun 21, 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

@clawsweeper re-review

Pushed 5d57cbeccc to address the two CI failures on #84340:

  • src/cli/program/register.maintenance.test.ts now expects deep: false in the doctor --lint CLI handoff.
  • src/flows/doctor-core-checks.test.ts gives the gateway-service mocks explicit return types so check:test-types no longer infers never[] for the test-only mock data.

Validation on 5d57cbeccc:

  • OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/run-vitest.mjs src/cli/program/register.maintenance.test.ts src/flows/doctor-core-checks.test.ts --reporter=dot
  • pnpm tsgo:core:test
  • pnpm check:test-types
  • pnpm exec oxlint src/cli/program/register.maintenance.test.ts src/flows/doctor-core-checks.test.ts
  • pnpm exec oxfmt --check src/cli/program/register.maintenance.test.ts src/flows/doctor-core-checks.test.ts
  • pnpm tsgo:core
  • git diff --check

@clawsweeper

clawsweeper Bot commented Jun 21, 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

Rebased #84340 onto current upstream/main and force-with-lease pushed 16aea4ddc52e90cee3453273a29fbb8a8de28c99.

Validation after rebase:

  • $env:OPENCLAW_VITEST_MAX_WORKERS='1'; node scripts\run-vitest.mjs run src\commands\doctor-gateway-services.test.ts src\commands\doctor-lint.test.ts src\flows\doctor-core-checks.test.ts src\flows\doctor-health-contributions.test.ts src\cli\program\register.maintenance.test.ts --reporter=dot - 121 passed across 3 shards
  • changed-file oxlint
  • changed-file oxfmt --check
  • pnpm tsgo:test:src
  • git diff --check

pnpm tsgo:core is currently blocked on rebased upstream/main by untouched src/config/sessions/session-accessor.ts:1545 (sessionStore unused, TS6133), so I left that outside this gateway services doctor PR.

@clawsweeper please re-review current head.

@clawsweeper

clawsweeper Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper assist is taking a look at your question.

I queued a lightweight read-only assist pass. It will post a separate answer comment and will not edit the durable ClawSweeper review comment or trigger close, merge, repair, label, or branch changes.

Request: please re-review current head.

@giodl73-repo

Copy link
Copy Markdown
Contributor Author

Added a follow-up cleanup commit 8fb226be7272c76c7969c9ad0b6e53f3f413af08 on #84340 so pnpm tsgo:core and CI prod-types/lint are not blocked by the rebased-base unused sessionStore destructure in src/config/sessions/session-accessor.ts.

Validation for the follow-up cleanup:

  • pnpm tsgo:core
  • pnpm exec oxlint src\config\sessions\session-accessor.ts
  • pnpm exec oxfmt --check src\config\sessions\session-accessor.ts
  • git diff --check

@clawsweeper please re-review current head.

@clawsweeper

clawsweeper Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper assist is taking a look at your question.

I queued a lightweight read-only assist pass. It will post a separate answer comment and will not edit the durable ClawSweeper review comment or trigger close, merge, repair, label, or branch changes.

Request: please re-review current head.

@clawsweeper

clawsweeper Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper assist: A full current-head correctness review is needed for #84340. I can’t perform that review in assist mode; use @clawsweeper review to re-review head 8fb226be72dc33af84aa63fb14d4ae4b68adafab.

Evidence:

  • Current PR head is 8fb226be72dc33af84aa63fb14d4ae4b68adafab.
  • Since the prior review at 5d57cbeccc00e4be7d69dfa99c6da8867892cf3c, the branch was rebased to 16aea4ddc52e90cee3453273a29fbb8a8de28c99 and then updated with cleanup commit 8fb226be7272c76c7969c9ad0b6e53f3f413af08.
  • Latest stated validation includes 121 focused tests passed, changed-file oxlint, oxfmt --check, pnpm tsgo:core, pnpm tsgo:test:src, and git diff --check.
  • PR remains open, mergeable, and mergeableState is unstable.

Suggested next action: Comment @clawsweeper review on #84340 to trigger the full re-review.


Source: #84340 (comment)
Assist reasoning: low.

@clawsweeper

clawsweeper Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper assist: A full current-head correctness review is needed for #84340. Assist mode can’t perform that review; use @clawsweeper review for head 8fb226be72dc33af84aa63fb14d4ae4b68adafab.

Evidence:

  • Current PR head is 8fb226be72dc33af84aa63fb14d4ae4b68adafab.
  • The prior ClawSweeper review covered 5d57cbeccc00e4be7d69dfa99c6da8867892cf3c, before the rebase and cleanup commits.
  • Latest stated validation includes 121 focused tests passed, changed-file oxlint, oxfmt --check, pnpm tsgo:core, pnpm tsgo:test:src, and git diff --check.
  • PR is open, mergeable, and mergeableState is unstable.

Suggested next action: Comment @clawsweeper review on #84340 to trigger the full re-review.


Source: #84340 (comment)
Assist reasoning: low.

@galiniliev galiniliev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR exposes extra gateway-like services through structured Doctor health findings, threads --deep into lint health checks, and changes default doctor --lint reporting to warning-and-above. That matters because doctor --lint is the automation surface, while the existing mutating gateway-service cleanup path remains in the legacy Doctor contribution.

LOC: +333/-15 (12 files)

By: Gio Della-Libera (@giodl73-repo, acct 2025-09-30) | OpenClaw: 173 PRs, 14 issues, 132 commits/12mo | GitHub: 6177 commits, 206 PRs, 29 issues, 17 reviews/12mo

Findings: No blocking findings.

Bug/behavior: Adds a structured core/doctor/gateway-services/extra check so openclaw doctor --lint can report extra gateway services; legacy services are warning-level and repair-previewable, intentional non-legacy extras are info-level. Also forwards doctor --lint --deep into health checks and changes the default lint threshold from info to warning.

Affected surface: src/commands/doctor-gateway-services.ts, src/commands/doctor-lint.ts, src/flows/doctor-core-checks.ts, src/flows/doctor-health-contributions.ts, src/flows/health-checks.ts, and CLI registration/tests.

Provenance: N/A for a feature/migration slice. Current origin/main defaults runDoctorLintCli() to info in src/commands/doctor-lint.ts and has only core/doctor/gateway-services/platform-notes attached to the Gateway services contribution; it does not expose the new extra-service structured check.

Best-fix verdict: acceptable mitigation / likely best for this migration slice. The implementation keeps real service cleanup in the existing maybeScanExtraGatewayServices() / legacy contribution path while sharing detection and mapping for lint/repair previews, which avoids moving systemd/launchd mutation ownership prematurely.

Alternatives considered:

  • Move legacy gateway cleanup fully into the structured repair check now: rejected because doctor --fix service mutation policy, prompts, external-service policy, and platform cleanup behavior are still owned by the existing contribution path.
  • Keep default lint threshold at info and special-case intentional extra gateways: rejected as noisier for the automation surface; the branch explicitly tests --severity-min info for opt-in info visibility.
  • Put the extra-service check only in standalone lint registration instead of the ordered Doctor contribution map: rejected because current Doctor lint resolves checks through contribution ordering, and this PR keeps the new check attached to doctor:gateway-services.

Code read: src/commands/doctor-gateway-services.ts, src/daemon/inspect.ts, src/commands/doctor-lint.ts, src/flows/doctor-lint-flow.ts, src/flows/health-checks.ts, src/flows/doctor-core-checks.ts, src/flows/doctor-health-contributions.ts, src/flows/doctor-repair-flow.ts, src/cli/program/register.maintenance.ts, src/plugin-sdk/health.ts, src/plugin-sdk/AGENTS.md, docs/cli/doctor.md, docs/gateway/doctor.md, plus adjacent tests.

Validation:

  • pnpm docs:list
  • pnpm test src/commands/doctor-gateway-services.test.ts src/commands/doctor-lint.test.ts src/flows/doctor-core-checks.test.ts src/flows/doctor-health-contributions.test.ts src/cli/program/register.maintenance.test.ts --reporter=dot (3 Vitest shards; 121 tests passed)
  • Live PR checks queried at head 8fb226be72dc33af84aa63fb14d4ae4b68adafab; no non-success/non-skipped/non-neutral check runs were returned.

Remaining uncertainty: I did not run real systemd/launchd/schtasks service discovery or mutating cleanup E2E; this review is based on current detector contracts, focused tests, and the PR’s synthetic service proof. The default lint threshold change remains a maintainer product/compatibility acceptance point rather than a code defect.

Copy link
Copy Markdown
Contributor Author

@clawsweeper review

@clawsweeper

clawsweeper Bot commented Jun 22, 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.

Copy link
Copy Markdown
Contributor Author

Updated #84340 at head 1818dcab5c5 to keep doctor --lint --deep internal to core Doctor checks instead of adding deep to the public plugin SDK health context.

Change made:

  • Removed deep from exported HealthCheckContext.
  • Wrapped core Doctor lint checks with an internal deep-aware context.
  • Left extension/plugin health checks on the plain public context, with regression coverage asserting they do not receive deep.
  • Kept the structured gateway-services core check honoring --deep for detect and repair-preview paths.

Validation:

  • OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/run-vitest.mjs run src/commands/doctor-lint.test.ts src/flows/doctor-core-checks.test.ts src/commands/doctor-gateway-services.test.ts src/flows/doctor-health-contributions.test.ts src/cli/program/register.maintenance.test.ts --reporter=dot - 121 tests passed across 3 shards
  • changed-file oxlint
  • changed-file oxfmt --check
  • core typecheck via tsgo against tsconfig.core.json
  • test source typecheck via tsgo against test/tsconfig/tsconfig.test.src.json
  • git diff --check

@clawsweeper review

@clawsweeper

clawsweeper Bot commented Jun 22, 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

Merged via squash.

Thanks @giodl73-repo!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes commands Command implementations maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants