Skip to content

fix(deadcode): model memoized dynamic doctor import - #183272

Merged
steipete merged 1 commit into
mainfrom
steipete/fix-knip-memoized-dynamic-import
Oct 25, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/fix-knip-memoized-dynamic-import

Conversation

@steipete

@steipete steipete commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Problem

test/scripts/check-deadcode-exports.test.ts ("models exact generated and module-hook named consumers") is red on main. #183208 changed src/commands/config-preflight-snapshot.ts to memoize its optional doctor import as (await (doctorIssuesModule ??= import("./doctor/shared/legacy-config-issues.js"))).addDoctorLegacyIssues(...). The knip dynamic-consumer modeler only matched (await import("...")).name, so it stopped emitting the addDoctorLegacyIssues consumer edge. Main push CI did not select the tooling shard, so this surfaced only on PRs that touch scripts/ (for example #183243, whose required gate is blocked by it).

Fix

Extend the modeler's regex in config/knip-dynamic-consumers.mjs to also accept the memoized (await (name ??= import("..."))).member form. The direct form is unchanged.

Evidence

  • The existing test fails on origin/main (reproduced locally at a939b1d and f8afddd) and passes with this change: 17/17.
  • oxfmt clean; autoreview clean.

@clawsweeper

clawsweeper Bot commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-25T05:12:05.930800Z 2251d95 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@steipete
steipete merged commit 418c2ba into main Oct 25, 2026
81 of 82 checks passed
@steipete
steipete deleted the steipete/fix-knip-memoized-dynamic-import branch October 25, 2026 05:20
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant