Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the Foundation Models bridge (JS ↔ native Swift) to carry an explicit modelName so the editor can route requests to different underlying models in the future (e.g., “Private Cloud Compute”).
Changes:
- Extend the native Foundation Models protocol/bridge to accept
modelNamefor availability checks and session creation. - Update the CoreEditor TypeScript native module interface and
languageModel()API to pass a selected model name through to native. - Add native-side model selection plumbing (
createModel(named:)) to mapmodelNameto aSystemLanguageModel.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| MarkEditKit/Sources/Bridge/Native/Modules/EditorModuleFoundationModels.swift | Adds modelName plumbing and model selection helper for macOS 26 FoundationModels usage. |
| MarkEditKit/Sources/Bridge/Native/Generated/NativeModuleFoundationModels.swift | Updates generated native bridge decoding/routing to pass modelName. |
| CoreEditor/src/bridge/native/foundationModels.ts | Updates TS bridge interface signatures to include modelName. |
| CoreEditor/src/api/languageModel.ts | Updates public languageModel() API to require a model name and forwards it to native. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
7462ce9 to
6678d74
Compare
|
@copilot Review from scratch since the implementation has been fundamentally changed. |
Reviewed the current implementation from scratch. Overall it looks sound — no correctness or security issues found. Notes: Model routing is correct. In macOS 26 (< 27) silently ignores
The version gating ( Note: automated review flagged the |
Be prepared to support "Private Cloud Compute" model. This will not be functional until we migrate to Xcode 27.