Skip to content

Harden mlx-lm capability probing and argument classification #5

Description

@acari-git

Problem

The mlx-lm capability probe is functional but still has several edge cases from the original audit.

Current verification (2026-08-15)

Already fixed:

  • Cache invalidates when the executable at the same path changes.
  • Unavailable probes are retried instead of cached.
  • Rapid-MLX does not use the mlx-lm probe.
  • Repeated Start requests are guarded.

Still open:

  • Concurrent requests for the same executable can start duplicate --help probes because the actor does not share an in-flight task.
  • requestedOptionalFlags derives flags from the flattened argv; a value beginning with -- can be misclassified as a flag.
  • Help parsing accepts any --word in output and does not require canonical flags such as --model, --host, and --port, so diagnostic prose can cause false positives.
  • Capability probing runs before the fresh port check, so an occupied port can still pay the probe delay.

Desired behavior

  • Coalesce concurrent probes per executable identity.
  • Classify flags from structured launch-option sources rather than arbitrary argv values.
  • Treat help output as valid only when expected core server flags are present.
  • Perform the fresh port check before an optional runtime capability probe where that preserves existing safety semantics.
  • Add regression tests for all four cases.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions