Skip to content

fix(scripts): type windows taskkill helper#95527

Closed
ooiuuii wants to merge 1 commit into
openclaw:mainfrom
ooiuuii:fix/windows-taskkill-types
Closed

fix(scripts): type windows taskkill helper#95527
ooiuuii wants to merge 1 commit into
openclaw:mainfrom
ooiuuii:fix/windows-taskkill-types

Conversation

@ooiuuii

@ooiuuii ooiuuii commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add a colocated declaration file for scripts/lib/windows-taskkill.mjs.
  • Cover all current runtime exports: resolveWindowsTaskkillPath, resolveWindowsSystem32Path, and resolveWindowsPowerShellPath.
  • Let TypeScript resolve the helper from TS scripts such as scripts/control-ui-i18n.ts.

What Problem This Solves

Current main imports ./lib/windows-taskkill.mjs from TypeScript, but the JavaScript helper did not have a colocated declaration file. The CI type shard reported:

scripts/control-ui-i18n.ts(11,44): error TS7016: Could not find a declaration file for module './lib/windows-taskkill.mjs'.

After main moved the helper to re-export Windows path helpers, the declaration also needs to describe those exports so TypeScript consumers see the real module surface.

Linked context

Real behavior proof (required for external PRs)

  • Behavior or issue addressed: TypeScript could not type-check TS scripts that import scripts/lib/windows-taskkill.mjs; after the latest main changes, the declaration also needed to cover the helper module's three exported functions.
  • Real environment tested: Windows PowerShell checkout at F:\openclaw\worktrees\openclaw-windows-taskkill-types, rebased onto current origin/main.
  • Exact steps or command run after this patch: pnpm exec tsgo --ignoreConfig --noEmit --target ES2023 --lib ES2023 --module NodeNext --moduleResolution NodeNext --types node --skipLibCheck .artifacts\windows-taskkill-types-probe.ts
  • Evidence after fix: The focused probe imported resolveWindowsTaskkillPath, resolveWindowsSystem32Path, and resolveWindowsPowerShellPath from ../scripts/lib/windows-taskkill.mjs, assigned each result to string, and the command exited 0 with no TypeScript diagnostics.
  • Observed result after fix: TypeScript resolves the colocated declaration and accepts all current runtime exports used by TS consumers.
  • What was not tested: I did not rerun the full pnpm tsgo:core:test shard in this branch because a prior full local run stalled after passing the original TS7016 point; this PR uses the focused type probe for the changed declaration surface.
  • Proof limitations or environment constraints: This is declaration-only proof; it validates type resolution, not Windows process execution.
  • Before evidence: Current-main CI and local triage both reported TS7016 for scripts/control-ui-i18n.ts importing ./lib/windows-taskkill.mjs.

Evidence

Before this patch, current main reports TS7016 for the windows-taskkill.mjs import in scripts/control-ui-i18n.ts.

After this patch, the focused TypeScript probe covering all three exports exits 0 with no diagnostics.

Tests and validation

  • pnpm exec tsgo --ignoreConfig --noEmit --target ES2023 --lib ES2023 --module NodeNext --moduleResolution NodeNext --types node --skipLibCheck .artifacts\windows-taskkill-types-probe.ts
  • git diff --check

Risk checklist

  • Declaration-only change; no runtime code path changes.
  • No dependency, workflow, or generated artifact changes.
  • Declaration now matches the current windows-taskkill.mjs runtime export surface.

Current review state

Ready for ClawSweeper re-review and maintainer review.

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: XS triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Jun 21, 2026
@clawsweeper

clawsweeper Bot commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed June 21, 2026, 6:05 AM ET / 10:05 UTC.

Summary
Adds a colocated .d.mts declaration for scripts/lib/windows-taskkill.mjs covering its three exported Windows path helpers.

PR surface: Other +6. Total +6 across 1 file.

Reproducibility: yes. from source inspection: current main has TypeScript files importing scripts/lib/windows-taskkill.mjs, while git ls-files confirms the matching declaration file is absent.

Review metrics: 1 noteworthy metric.

  • Windows helper declaration coverage: 3 runtime exports, 3 declared. The declaration covers the full current helper surface that TypeScript consumers import from the .mjs module.

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.

Risk before merge

  • [P1] Required CI checks were still queued or unstable at live review time, so merge should wait for the normal required checks even though no patch defect was found.

Maintainer options:

  1. Decide the mitigation before merge
    Land the colocated declaration after required checks, keeping it synchronized with the helper's runtime exports.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • No automated repair is needed; the remaining action is ordinary maintainer review and required checks for the current PR head.

Security
Cleared: The diff adds only a TypeScript declaration file and does not change runtime code, dependencies, workflows, permissions, package metadata, or lockfiles.

Review details

Best possible solution:

Land the colocated declaration after required checks, keeping it synchronized with the helper's runtime exports.

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

Yes from source inspection: current main has TypeScript files importing scripts/lib/windows-taskkill.mjs, while git ls-files confirms the matching declaration file is absent.

Is this the best way to solve the issue?

Yes. A colocated .d.mts declaration follows the existing script-helper declaration pattern and avoids runtime or TypeScript-config churn.

AGENTS.md: found and applied where relevant.

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

Label changes

Label justifications:

  • P2: This PR fixes a bounded scripts type-check failure with limited runtime blast radius.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit 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 provides a Windows PowerShell after-fix focused tsgo probe that imports all three helper exports and exits with no diagnostics.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body provides a Windows PowerShell after-fix focused tsgo probe that imports all three helper exports and exits with no diagnostics.
Evidence reviewed

PR surface:

Other +6. Total +6 across 1 file.

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

What I checked:

Likely related people:

  • vincentkoc: Git blame and git log -S tie the current helper exports and TypeScript caller import to recent Windows taskkill script commits by this contributor. (role: recent area contributor; confidence: high; commits: 6c4028e07369, c000e4811d68, 282eb74128d9; files: scripts/lib/windows-taskkill.mjs, scripts/control-ui-i18n.ts, scripts/windows-cmd-helpers.d.mts)
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. P2 Normal backlog priority with limited blast radius. labels Jun 21, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. label Jun 21, 2026
@ooiuuii
ooiuuii force-pushed the fix/windows-taskkill-types branch from 98dde31 to 270402c Compare June 21, 2026 09:46
@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. and removed 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 21, 2026
@ooiuuii

ooiuuii commented Jun 21, 2026

Copy link
Copy Markdown
Contributor Author

Addressed the stale review: rebased onto current main, updated the declaration to cover all current windows-taskkill.mjs exports, and refreshed the proof fields.

@clawsweeper re-review

@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.

@ooiuuii

ooiuuii commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

Closing as superseded: current main already includes scripts/lib/windows-taskkill.d.mts from #95308, commit 0d351b9. This PR's only diff is the same declaration file, so there is no remaining code change to land.

@ooiuuii ooiuuii closed this Jun 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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. scripts Repository scripts size: XS 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.

1 participant