Repository navigation
refactor(core)!: remove unused parseToolCallsFromText NAPI export - #263
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
BREAKING CHANGE: @mlx-node/core no longer exports parseToolCallsFromText or the ParseToolCallsResult type. Nothing in the workspace used them. Co-Authored-By: Brooklyn <[email protected]>
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Closing in favor of one combined dead-code cleanup PR (requested by the maintainer). The new PR will include this branch's changes. |
…283) (#284) ## Summary This PR removes the dead code reported by the dead-code scan of `mlx-node/mlx-node`. It replaces the 62 single-finding PRs #222–#283, which are closed and had their CI cancelled. Each of those branches is merged here as-is, in PR-number order, so `git log --first-parent` lists every removal under its original PR title. Of the scan's 79 open findings, 78 are covered here. The remaining one, `Qwen4ExpModel.residencyInfo()`, was dismissed as a false positive because it is a documented diagnostics API. Totals: 159 files changed, about 16k lines deleted and about 440 added. Most of the added lines are helpers moved into `#[cfg(test)]` modules, plus doc and comment updates. Biggest removals: - `crates/mlx-core/src/gradients/` (the legacy `Gradients` API) and the Rust `Adam`/`SGD`/`RMSprop`/`LRScheduler` optimizers. AdamW stays. - The never-dispatched `copy_blocks` Metal kernel, the test-only `KvScaleManager` FP8 calibration API (the FP8 scales are now always `1.0`, as in production), and the test-only `profile_run` auto-sizer. - Unused `mlx-sys` FFI wrappers, the unused `mlx-db` API (`AsyncDb`, `DbConfig`, run-lifecycle/log writers), and unused `OutputStore` queries. - The test-only Gemma4 large sliding-restore suppression policy (`MLX_GEMMA4_MAX_SLIDING_RESTORE_TOKENS`), and the cold-tier `restore_suppressed` counter, which production never incremented. The dashboard trace index drops `cold_sidecar_restore_suppressed`, and `SCHEMA_VERSION` goes from 7 to 8, so the index rebuilds from JSONL. - Stale files: `example-tools.js`, the `experiments/flashqla/int8-recovery/` fragments, 16 unused `__test__/test-utils.ts` helpers, and the dashboard `tooltip` component together with `@radix-ui/react-tooltip`. Two merges needed conflict resolution, and both kept the removals from each side: - `crates/mlx-paged-attn/src/metal/mod.rs`: #255 (`copy_blocks`) against #262 (`kv_scale`). - `crates/mlx-core/src/tools/mod.rs`: #246 against #263. ## Breaking changes (public `@mlx-node/*` surface) - `@mlx-node/core`: - Removed the `Tensor` class and the `parseToolCallsFromText()`/`ParseToolCallsResult`, `gdnPrefixCheckpointLimit()`, and `quantizedQmvMicrobench()`/`QmvQuantizedMicrobenchResult` exports. - Removed these `MxArray` methods: `tan`, `sinh`, `cosh`, `arcsin`, `arccos`, `arctan`, `evalAsync`, `getBatchSeqLen`, and `getBatchSeqHidden`. - Removed `OutputStore.getRecentGenerations`, `getGenerationsByReward`, `getGenerationsByFinishReason`, `exportJsonl`, and `queryRaw`. - Removed `Qwen3Model.validateParameters`, `MuseGlimmerModel.autoEnablesMtp`, and the always-erroring `SftTrainingEngine.getModel`. - `@mlx-node/core` / `@mlx-node/vlm`: removed `TextDetModel.detectCrop()` and `TextRecModel.recognizeCrop()`. Use `detect()` / `recognize()` with an encoded image instead. - `@mlx-node/lm`: removed the `ChatMessageWithTools` and `ApplyChatTemplateOptions` types. - `@mlx-node/server`: removed `readDesktopEndpoint`. - Removed the desktop sidecar control ops `health` and `load`. ## Verification - CI is green: 9 checks passed and 1 (e2e) was skipped. The macOS `mlx-core` lib tests passed (3,947 passed, 0 failed), along with integration, other crates, and Clippy. - The macOS-only test `gemma4_coordinator_is_lawful_under_the_permissive_checker` still calls `NoDurableSettleInCycle::into_inner`, so 31fd05e brings that helper back. Code gated by `cfg(target_os = "macos")` was searched for any other references to removed symbols, and none were found. Link to Devin session: https://app.devin.ai/sessions/62a7b98e3d054aaca83c94c609273d7b Open in Devin Desktop: https://app.devin.ai/desktop/session/62a7b98e3d054aaca83c94c609273d7b?variant=devin Requested by: @Brooooooklyn --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: Brooklyn <[email protected]>
Summary
Removes the dead NAPI wrapper
parse_tool_calls_from_text(JSparseToolCallsFromText) and its return typeParseToolCallsResultfromcrates/mlx-core/src/tools/mod.rs. Nothing in the workspace (TS packages,__test__, examples, scripts, docs) called it; Rust code usesparse_tool_calls/parse_generation_outputdirectly, and those are unchanged.Breaking change (release notes):
@mlx-node/coreno longer exportsparseToolCallsFromText()or theParseToolCallsResulttype. The package is marked internal ("import from @mlx-node/lm or @mlx-node/trl"), but it is published, so external callers of this function would break. The repo has no CHANGELOG file (release notes are generated from PR titles), so the!in the title and this section are the changelog entry.The generated bindings (
packages/core/index.{cjs,d.cts}andcrates/mlx-core/index.{cjs,d.cts}) were edited by hand to drop the removed export/type, and the two.d.ctscopies are still byte-identical (build.tschecks this). I couldn't runyarn build:nativeor the fullcargo test -p mlx-coreon the x86_64 Linux dev VM becausemlx-sysneeds macOS/Metal or CUDA, so those are left to macOS CI. What I did run:yarn typecheck: passes.toolsmodule's unit tests (177), compiled in a scratch crate outside the workspace: all pass.Link to Devin session: https://app.devin.ai/sessions/b9a171a245aa432e8f86ff5546d125c2
Open in Devin Desktop: https://app.devin.ai/desktop/session/b9a171a245aa432e8f86ff5546d125c2?variant=devin
Requested by: @Brooooooklyn