Skip to content

Feat/meta first party provider - #83

Open
Zeptiny wants to merge 3 commits into
fix/tool-result-raw-contentfrom
feat/meta-first-party-provider
Open

Feat/meta first party provider#83
Zeptiny wants to merge 3 commits into
fix/tool-result-raw-contentfrom
feat/meta-first-party-provider

Conversation

@Zeptiny

@Zeptiny Zeptiny commented Aug 12, 2026

Copy link
Copy Markdown
Owner

No description provided.

Adds a code-owned Meta driver (api.meta.ai/v1, openai-responses protocol)
backed by @ai-sdk/openai's Responses adapter, plus the facet wiring and
catalog seeding needed to run Muse Spark models as a first-party provider:

- META_THINKING_POLICY: summary exposure with always-on stateless encrypted
  replay (store: false + include reasoning.encrypted_content) so tool loops
  keep chain-of-thought without server-side conversation state
- buildReasoningOptions validates the documented effort vocabulary
  (minimal..xhigh); none/max/numeric are rejected like the API does
- Cache facet rides prompt_cache_retention (in_memory | 24h) via a new
  retentionHint on the cache facet; cacheTtlLabelSchema accepts in_memory
- Trust policy pins meta to openai-responses with thinking+cache facets;
  catalog reseeded surgically with the three muse-spark models

Full unit suite (3364 tests), typecheck, lint, and runtime-cycle checks pass.
Meta's Responses API rejects replayed inputs where a reasoning item is not
followed by an assistant message or function_call (HTTP 400), and rejects
assistant text replayed as a plain final answer immediately before a
function_call. Two replay-path fixes, gated to openai-responses protocol:

- toModelMessages tags assistant text that precedes tool calls with
  openai.phase: "commentary" so the Responses adapter re-emits the message
  item with its phase (Meta drops/interprets such text as final otherwise)
- a reasoning-only turn (cancelled mid-thought, text-less artifact) now gets
  a minimal assistant message inserted after the reasoning item, the
  provider-documented workaround, instead of leaving reasoning directly
  before a user message

ThinkingReplayContext carries the frozen model protocol; send.ts and
subagent-runner.ts populate it from the request snapshot, and the
orchestrator enables the Responses rules only for openai-responses models.
@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 0b02d6e9-5da9-41cb-81f1-093eeae48f51

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

The integration gate asserting the complete shipped provider set failed
CI once the Meta provider was seeded into the bundled catalog. Adds meta
to the expected id list; the fixture-based seed test is unaffected
because its minimal models.dev capture has no meta entry.
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