Skip to content

Handle steering cases from upstream mlx-swift-lm - #272

Open
solderzzc wants to merge 2 commits into
mainfrom
fix/handle-steering-cases
Open

solderzzc wants to merge 2 commits into
mainfrom
fix/handle-steering-cases

Conversation

@solderzzc

Copy link
Copy Markdown
Member

Summary

mlx-swift-lm main (merged into SharpAI/mlx-swift-lm#125) adds Generation.steering and GenerateStopReason.steered / .interrupted. The SwiftLM server never enables steering, so:

  • .steering is a no-op in the Generation switches.
  • .steered and .interrupted map to "stop", like .cancelled.

This is needed for SwiftLM's integration job (CI SwiftLM, sealed offline) to compile against mlx-swift-lm #125. That job checks out SharpAI/SwiftLM main, so this PR must merge before #125's SwiftLM job can pass.

Verification

  • swift build --target SwiftLM passes against the merged mlx-swift-lm (sync/upstream-4c21c84-merge).

🤖 Generated with Claude Code

solderzzc and others added 2 commits November 19, 2026 15:07
mlx-swift-lm main (merged into PR SharpAI/mlx-swift-lm#125) adds
Generation.steering and GenerateStopReason.steered/.interrupted. The
SwiftLM server never enables steering, so the new cases are no-ops, and
steered/interrupted map to "stop" like cancelled does.

Without this, Sources/SwiftLM/Server.swift fails "switch must be
exhaustive" against the merged library (CI SwiftLM integration job).

Verified: swift build --target SwiftLM passes against the merged
mlx-swift-lm (sync/upstream-4c21c84-merge).

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
CI build_and_unit_test failed: SwiftLM builds against its pinned
mlx-swift-lm (69346d0e), which has no Generation.steering, so the
`case .steering` added in the previous commit does not compile there.

The Generation switches already have a `default:` that covers steering, so
they need nothing. Only the two stop-reason switches must change, and
`@unknown default` covers GenerateStopReason.steered/.interrupted on the
merged library without naming them, so the file compiles against both the
pin and the merged mlx-swift-lm.

Verified: swift build --target SwiftLM passes against the old pin (69346d0e)
and against sync/upstream-4c21c84-merge.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant