Skip to content

fix: ignore canonical Windows gateway task names#90512

Open
arkyu2077 wants to merge 2 commits into
openclaw:mainfrom
arkyu2077:fix/issue-90494
Open

fix: ignore canonical Windows gateway task names#90512
arkyu2077 wants to merge 2 commits into
openclaw:mainfrom
arkyu2077:fix/issue-90494

Conversation

@arkyu2077

Copy link
Copy Markdown
Contributor

Summary

Stop the Windows gateway-service detector from flagging the canonical \OpenClaw Gateway scheduled task as an extra service just because schtasks prefixes the task name with a backslash.

Changes

  • strip leading slash and backslash prefixes before canonical scheduled-task name matching
  • preserve legacy-task detection for genuinely different task names
  • add a focused regression test covering TaskName: \OpenClaw Gateway alongside a legacy task in the same schtasks output

Testing

  • node scripts/run-vitest.mjs run src/daemon/inspect.test.ts src/commands/doctor-gateway-services.test.ts src/cli/daemon-cli/status.print.test.ts

Fixes #90494

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

clawsweeper Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed June 5, 2026, 8:11 AM ET / 12:11 UTC.

Summary
The PR strips leading slash/backslash prefixes before Windows scheduled-task name matching and adds regression coverage for slash-prefixed canonical task names.

PR surface: Source 0, Tests +29. Total +29 across 2 files.

Reproducibility: yes. source inspection gives a high-confidence path: current main parses raw schtasks names, so \OpenClaw Gateway misses the managed-name check and is reported during the deep Windows scan. I did not run a native Windows Task Scheduler repro.

Review metrics: none identified.

Merge readiness
Overall: 🧂 unranked krab
Proof: 🧂 unranked krab
Patch quality: 🧂 unranked krab
Result: blocked until real behavior proof from a real setup is added.

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

Rank-up moves:

  • Tighten the matcher so slash-prefixed copy/stale OpenClaw scheduled tasks remain reported.
  • [P1] Add a regression for a slash-prefixed copy task such as \OpenClaw Gateway Copy.
  • [P1] Add redacted native Windows status/doctor proof after the patch; update the PR body to trigger a fresh ClawSweeper review, or ask a maintainer for @clawsweeper re-review if it does not run.

Proof guidance:

  • [P1] Needs real behavior proof before merge: The PR lists mocked Vitest coverage only; it still needs redacted native Windows schtasks plus gateway status --deep or doctor output after the fix before merge. 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] Merging as-is can stop status/doctor from warning about slash-prefixed stale OpenClaw scheduled tasks such as \OpenClaw Gateway Copy, leaving duplicate gateway jobs harder to diagnose.
  • [P1] Contributor proof is currently mocked Vitest coverage only; no native Windows schtasks, gateway status --deep, or doctor output demonstrates the real Task Scheduler path after the patch.

Maintainer options:

  1. Tighten the matcher before merge (recommended)
    Strip leading root-folder prefixes, then ignore only exact default/profile scheduled task names and add a regression showing \OpenClaw Gateway Copy still reports as extra.
  2. Accept reduced duplicate detection
    Maintainers could intentionally accept that slash-prefixed OpenClaw copy tasks are hidden, but that weakens the cleanup warning surface documented for status and doctor.
  3. Use the related branch after proof
    If the related open PR becomes the preferred implementation and supplies real Windows proof, maintainers can land that path and close this branch as superseded then.

Next step before merge

  • [P1] Human PR handling should keep this open until the matcher defect is fixed and redacted native Windows status/doctor proof is added.

Security
Cleared: The diff only changes the Windows scheduled-task matcher and adjacent tests; I found no concrete security or supply-chain regression.

Review findings

  • [P1] Preserve reporting for slash-prefixed copy tasks — src/daemon/inspect.ts:202
Review details

Best possible solution:

Strip root-folder prefixes, then match only canonical default/profile task names exactly and keep copy/stale tasks reported, with a focused regression and redacted Windows status/doctor proof.

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

Yes, source inspection gives a high-confidence path: current main parses raw schtasks names, so \OpenClaw Gateway misses the managed-name check and is reported during the deep Windows scan. I did not run a native Windows Task Scheduler repro.

Is this the best way to solve the issue?

No. Prefix stripping is the right direction, but applying it before the broad startsWith("openclaw gateway") match hides slash-prefixed copy/stale OpenClaw tasks; exact default/profile matching is the safer fix.

Full review comments:

  • [P1] Preserve reporting for slash-prefixed copy tasks — src/daemon/inspect.ts:202
    Because this strips the leading slash before the existing broad prefix check, \OpenClaw Gateway Copy normalizes to openclaw gateway copy and is skipped as if it were the managed task. Current main would still report that backslashed copy-style task as an extra gateway service, so merging this would hide stale/duplicate Windows gateway jobs from gateway status --deep and doctor cleanup hints.
    Confidence: 0.92

Overall correctness: patch is incorrect
Overall confidence: 0.9

AGENTS.md: found and applied where relevant.

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

Label changes

Label changes:

  • add P2: This is a focused Windows gateway status/doctor bug fix with limited blast radius, but the current patch has a merge-blocking detection regression.
  • add merge-risk: 🚨 availability: The changed matcher can hide duplicate or stale Windows gateway scheduled tasks that status/doctor are supposed to surface before they compete for gateway availability.

Label justifications:

  • P2: This is a focused Windows gateway status/doctor bug fix with limited blast radius, but the current patch has a merge-blocking detection regression.
  • merge-risk: 🚨 availability: The changed matcher can hide duplicate or stale Windows gateway scheduled tasks that status/doctor are supposed to surface before they compete for gateway availability.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🧂 unranked krab.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR lists mocked Vitest coverage only; it still needs redacted native Windows schtasks plus gateway status --deep or doctor output after the fix before merge. 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 0, Tests +29. Total +29 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 1 1 0
Tests 1 29 0 +29
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 30 1 +29

What I checked:

  • Current main behavior: On current main, isOpenClawGatewayTaskName compares the raw normalized task name to the default task name and then uses a broad startsWith("openclaw gateway") profile-style match, so a backslashed canonical task is not ignored but unprefixed copy-style names are also treated as managed. (src/daemon/inspect.ts:201, afa04d6454f5)
  • PR matcher behavior: At PR head, the changed line strips leading slash/backslash prefixes before the same broad startsWith("openclaw gateway") check, which makes names like \OpenClaw Gateway Copy look managed instead of extra. (src/daemon/inspect.ts:202, eabded9aae1c)
  • Caller impact: gateway status --deep loads findExtraGatewayServices, and the human output prints Other gateway-like services detected only when that scan returns entries. (src/cli/daemon-cli/status.gather.ts:560, afa04d6454f5)
  • Doctor impact: Doctor also calls findExtraGatewayServices and only reports cleanup hints when extra services are returned, so hidden Windows copy tasks would also disappear from doctor cleanup guidance. (src/commands/doctor-gateway-services.ts:661, afa04d6454f5)
  • Test gap: The PR regression covers \OpenClaw Gateway and /OpenClaw Gateway plus a legacy clawdbot task, but it does not assert that slash-prefixed copy or stale OpenClaw scheduled tasks remain reported. (src/daemon/inspect.test.ts:388, eabded9aae1c)
  • User-facing contract: Docs describe gateway status --deep as extra service discovery and document Windows managed startup as OpenClaw Gateway or OpenClaw Gateway (<profile>), which supports exact default/profile matching rather than ignoring arbitrary copy suffixes. Public docs: docs/gateway/index.md. (docs/gateway/index.md:149, afa04d6454f5)

Likely related people:

  • Peter Steinberger: Current-main blame attributes isOpenClawGatewayTaskName and the adjacent Windows findExtraGatewayServices tests to commit d77bac8, and recent log history shows additional daemon lowercase-helper refactoring in this area. (role: introduced current inspector path / recent area contributor; confidence: high; commits: d77bac891154, 572c5b6dd0ae; files: src/daemon/inspect.ts, src/daemon/inspect.test.ts)
  • Greg Retkowski: Commit 14430ad tightened duplicate gateway detection and expanded the same inspector tests, making this a relevant routing signal for extra-service scan behavior. (role: adjacent duplicate-detection contributor; confidence: medium; commits: 14430ade573a; files: src/daemon/inspect.ts, src/daemon/inspect.test.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: 🧂 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. labels Jun 5, 2026
@byungskers

Copy link
Copy Markdown

Nice focused fix. Small test-shape thought: the implementation now strips both leading \ and /, but the regression only exercises the backslash form from schtasks. Would it be worth adding a second assertion (or making this test table-driven) for a slash-prefixed task name too, just so the broader normalization rule is documented by tests and doesn't look accidental later?

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. labels Jun 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: XS status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

doctor/status: false positive 'Other gateway-like services detected' for active Windows Scheduled Task

2 participants