You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maka.apache.org by "AcerYue0 (via GitHub)" <gi...@apache.org> on 2026/09/16 06:31:53 UTC

[PR] feat(providers): add Meta Model API [maka]

AcerYue0 opened a new pull request, #5381:
URL: https://github.com/apache/maka/pull/5381

   ## Summary
   
   Add first-party Meta Model API support for Muse Spark 1.3 Standard and Contributor tiers over the Responses API.
   
   The provider uses https://api.meta.ai/v1 with bearer authentication, encrypted reasoning replay, model discovery, hosted web search, Meta branding, and localized settings copy. Standard and Contributor remain distinct in the catalog: Standard does not permit training on prompts/completions and supports max reasoning, while Contributor uses discounted pricing, permits training, and omits max reasoning.
   
   ## Verification
   
   - npm run lint
   - npm run format:check
   - npm run typecheck
   - Core provider, metadata, and hosted-search tests: 40 passed
   - Runtime Responses contract tests: 19 passed
   - Runtime pricing and cost tests passed
   - Live connection test with a user-supplied Meta API key succeeded for the new provider
   - Desktop UI, preload, main process, and renderer bundle compiled successfully
   - npm run build reached the final renderer attestation step; that script requires Node >=22.19.0, while this Windows host has Node 22.17.0
   
   No screenshot is attached because the live verification surface contains account-specific connection state; the automated request test asserts both model IDs, the official endpoint, bearer authentication, and encrypted reasoning replay.
   
   ## AI use
   
   Select exactly one:
   
   - [ ] No generative tool made a substantive contribution
   - [x] Generative tooling made a substantive contribution
   
   Tool(s) and scope: OpenAI Codex implemented the provider integration, tests, copy, and branding under human direction and review.
   
   ## Checklist
   
   - [x] Tests cover the change and fail without it
   - [x] Lint, format, typecheck and the affected suites pass locally
   
   Does this PR entail a change in behavior?
   
   - [x] Yes — described under Summary above
   - [ ] No


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org


Re: [PR] feat(providers): add Meta Model API [maka]

Posted by "hqhq1025 (via GitHub)" <gi...@apache.org>.
hqhq1025 commented on code in PR #5381:
URL: https://github.com/apache/maka/pull/5381#discussion_r4023467094


##########
packages/core/src/provider-registry.ts:
##########
@@ -915,6 +915,24 @@ const providerRegistry = {
     signupUrl: 'https://aistudio.google.com/app/apikey',
     catalogOrder: 11,
   },
+  meta: {
+    label: 'Meta Model API',
+    menuLabel: 'Meta',
+    baseUrl: 'https://api.meta.ai/v1',
+    authKind: 'api_key',
+    fallbackModels: ['muse-spark-1.3', 'muse-spark-1.3-contributor'],
+    status: 'ready',
+    runtimeAdapter: {
+      kind: 'openai-compatible',
+      name: 'provider',
+      responses: { adapter: 'openai', reasoningReplay: 'encrypted-content' },
+    },
+    modelDiscovery: { kind: 'protocol' },

Review Comment:
   [P2] Do not expose every Meta `/models` row as a chat model. Meta's documented list endpoint returns all API-hosted models, including `muse-image-1.0` and `muse-voice-transcribe-1.0`, and its normal records provide only `id/object/created/owned_by`. Through this generic protocol path, Maka turns those rows into bare ids, the catalog treats the missing chat capability as usable, and onboarding lists them. I reproduced that official response shape: both entries had `canUseAsChatDefault: true`, and `getAIModel(...).doGenerate()` sent each to `https://api.meta.ai/v1/chat/completions`. Voice Transcribe is served only by transcription endpoints and Muse Image is not a chat-completions model, so selecting either creates a connection that deterministically fails on first use. Add Meta-specific filtering or capability/protocol projection, with a regression using the real list shape.



##########
packages/core/src/provider-registry.ts:
##########
@@ -915,6 +915,24 @@ const providerRegistry = {
     signupUrl: 'https://aistudio.google.com/app/apikey',
     catalogOrder: 11,
   },
+  meta: {
+    label: 'Meta Model API',
+    menuLabel: 'Meta',
+    baseUrl: 'https://api.meta.ai/v1',
+    authKind: 'api_key',
+    fallbackModels: ['muse-spark-1.3', 'muse-spark-1.3-contributor'],
+    status: 'ready',
+    runtimeAdapter: {
+      kind: 'openai-compatible',
+      name: 'provider',
+      responses: { adapter: 'openai', reasoningReplay: 'encrypted-content' },

Review Comment:
   [P1] Add an executable binding for the encrypted reasoning replay contract. Declaring `responses` here makes `provider-contract-matrix.ts` classify `meta:reasoning-replay` as an override, but `PROVIDER_CONTRACT_OVERRIDE_BINDINGS` has no matching key. The exact head and a clean merge with current `main` therefore fail the required matrix bijection test (`131 pass, 1 fail`). The new one-shot wire test returns an empty output and never exercises the required reasoning -> tool call -> tool result -> continued request path. Please bind Meta to a real continuation probe (for example the existing `runOpenAIResponsesWire` helper with stateless reasoning) so the declared replay contract is both tested and the required gate can pass.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org


Re: [PR] feat(providers): add Meta Model API [maka]

Posted by "AcerYue0 (via GitHub)" <gi...@apache.org>.
AcerYue0 commented on PR #5381:
URL: https://github.com/apache/maka/pull/5381#issuecomment-5754878112

   @hqhq1025 Thanks for the detailed review. I’ve updated the PR to address the discovery regression concern:
   
   - Removed the build-shipped `muse-spark` discovery allowlist and switched Meta to plain protocol discovery, consistent with #1584.
   - Kept `muse-spark-1.3` and `muse-spark-1.3-contributor` as fallback models without using them to constrain the live catalog.
   - Added coverage proving that a provider-listed model absent from the bundled fallback remains discoverable.
   - Resolved the latest `main` conflict while preserving the Meta wire coverage and upstream test changes.
   - Fixed the CI failure by adding Meta to the Responses reasoning-contract snapshot.
   
   The affected builds, 158 relevant tests, and formatting checks pass locally. CI is running again. Could you please review the updated changes?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org


Re: [PR] feat(providers): add Meta Model API [maka]

Posted by "hqhq1025 (via GitHub)" <gi...@apache.org>.
hqhq1025 commented on code in PR #5381:
URL: https://github.com/apache/maka/pull/5381#discussion_r4106427352


##########
packages/core/src/provider-registry.ts:
##########
@@ -869,6 +869,24 @@ const providerRegistry = {
     signupUrl: 'https://aistudio.google.com/app/apikey',
     catalogOrder: 11,
   },
+  meta: {
+    label: 'Meta Model API',
+    menuLabel: 'Meta',
+    baseUrl: 'https://api.meta.ai/v1',
+    authKind: 'api_key',
+    fallbackModels: ['muse-spark-1.3', 'muse-spark-1.3-contributor'],
+    status: 'ready',
+    runtimeAdapter: {
+      kind: 'openai-compatible',
+      name: 'provider',
+      responses: { adapter: 'openai', reasoningReplay: 'encrypted-content' },
+    },
+    modelDiscovery: { kind: 'protocol' },

Review Comment:
   [P2] Preserve incompatible-family filtering while admitting future chat models
   
   Using plain protocol discovery here accepts every `/models` entry. Issue #1584 explicitly requires continuing to exclude image-generation and audio models, and warns against blindly trusting all entries. With a provider response containing `muse-image-1.0` and `muse-voice-transcribe-1.0`, the production catalog marks both `canUseAsChatDefault: true` because unknown capabilities are not a veto; `openAiAdapterApiProtocol()` then routes them to `openai-chat` because only the known 1.3 Spark IDs select Responses. Selecting either row therefore sends chat traffic to an incompatible model family. The revised regression removes the Image/Voice decoys and only proves that an unseen Spark 1.4 ID survives. Please retain a provider-backed capability/type filter when the response supplies one, or use a Meta family classifier broad enough for future compatible Spark IDs while still excluding known non-chat families, and restore a negative regression for Image/Voice rows.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org


Re: [PR] feat(providers): add Meta Model API [maka]

Posted by "hqhq1025 (via GitHub)" <gi...@apache.org>.
hqhq1025 commented on code in PR #5381:
URL: https://github.com/apache/maka/pull/5381#discussion_r4025360072


##########
packages/runtime/src/model-fetcher.ts:
##########
@@ -640,11 +640,20 @@ async function fetchCohereModels(
  */
 function filterDiscoveredModels(
   models: ModelInfo[],
-  filter: 'language-models' | 'tool-capable' | undefined,
+  filter: 'language-models' | 'muse-spark' | 'tool-capable' | undefined,
 ): ModelInfo[] {
   if (filter === 'tool-capable') {
     return models.filter((model) => model.capabilities?.functionCalling === true);
   }
+  if (filter === 'muse-spark') {
+    return models
+      .filter((model) => /^muse-spark-/i.test(model.id))

Review Comment:
   [P2] Keep discovery within the model facts this connection actually supports. This prefix accepts Meta’s currently documented `muse-spark-1.2`, `muse-spark-1.2-contributor`, and `muse-spark-1.1` rows (the new test explicitly keeps 1.2), but metadata, reasoning choices, hosted search, and pricing are defined only for the two 1.3 IDs. With the normal bare `/models` records, the production catalog consequently exposes those older models with `supportsVision: false`, no thinking levels or context limit, no hosted search, and no built-in price, even though Meta documents all Muse Spark versions as multimodal reasoning/search models. Either restrict this filter to the two 1.3 IDs claimed by this PR, or add complete facts for every accepted Spark ID.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org


Re: [PR] feat(providers): add Meta Model API [maka]

Posted by "AcerYue0 (via GitHub)" <gi...@apache.org>.
AcerYue0 commented on PR #5381:
URL: https://github.com/apache/maka/pull/5381#issuecomment-5754678629

   @hqhq1025 I’ve merged the latest main and resolved the conflict in responses-wire-contract.test.ts, preserving the Meta wire coverage along with the upstream OpenCode and Moonshot updates.
   
   Could you please review the updated changes again? I’ll review the discovery allowlist concern and the remaining suggestions separately.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org