Skip to content

V4 alignment: vendor package alignment #231

Open

Description

@cunninghamcard-bit
Conventions

Why. Several vendor packages diverge from their pinned upstream packages. The main case: when layer E1 merged, openai-compatible lost its settings for extension points. Other upstream subpaths and fields are also missing.

Fixed in.

  • B1 to B3: layer E1 (and C1 for B2).
  • B21: layer B6.
  • N3: layer C1.
  • The rest: alignment migration.

Existing fixes. For B1, the D line still has the closure implementation (fb0f79e5: aimux-providers/src/openai_compatible/mod.rs:90-92, config.rs:154). Layer E1 (7330a6e) removed it. Restore the D-line version.

Checklist

  • B1 (U22): transformRequestBody and metadataExtractor were deleted from openai-compatible.
    • Evidence: v4: aimux-providers/src/openai_compatible/ has neither.
    • Doc: doc:159 (D15), :797, :1571. Upstream: @ai-sdk/openai-compatible@3.0.62 openai-compatible-provider.ts:107, :114, :185-186, openai-compatible-chat-language-model.ts:401, :451-452 (the extractor also covers streams).
    • Fixed in: layer E1. Restore (decided).
  • B2: supportsMultiPartToolContent is missing.
    • Evidence: layers B3 to B8 had an internal field (config.rs:133); C1 deleted it, and no layer exposes a setting.
    • Upstream: openai-compatible-provider.ts:100, :183, convert-to-openai-compatible-chat-messages.ts:183, :304.
    • Fixed in: layer C1, exposed as a public setting (decided).
  • B3: convertUsage became a closed enum, and supportedUrls became static data.
    • Evidence: v4: aimux-providers/src/openai_compatible/config.rs:57, :130-131, mod.rs:84-86. The D line has closures (fb0f79e5 config.rs:25, :131).
    • Upstream: openai-compatible-provider.ts:119, :125 (functions).
    • Fixed in: layer E1. Keep the closures (decided).
  • B21: the Anthropic stream never emits Raw, and the include_raw_chunks comment is stale.
    • Evidence: no StreamPart::Raw in v4: aimux-providers/src/anthropic/stream.rs. v4: aimux-core/src/options.rs:203-213 says only the OpenAI-compatible family honours it; 18 files do.
    • Doc: doc:109, RFC-0036:43. Upstream: @ai-sdk/anthropic@4.0.68 anthropic-language-model.ts:1948-1949.
    • Fixed in: layer B6.
  • N3: stale doc comments say the status code is "observed status only", while openai_stream_error infers a status from the error code or type.
    • Evidence: v4: aimux-core/src/error.rs:618-623 (status_code()), v4: aimux-provider-utils/src/response_handler.rs:296-304 (stream_error_api_call), against v4: aimux-providers/src/openai/mod.rs:87-175. Layer C1 (573de7e) introduced the inference.
    • Upstream: @ai-sdk/openai@4.0.80 src/openai-stream-error.ts:27-34, :240-266, :286-290 (the inference is correct).
    • Fixed in: layer C1. Comments only.
  • C15: Vertex maas and xai subpaths are missing.
    • Evidence: v4: aimux-providers/src/vertex/ has neither.
    • Doc: doc:769. Upstream: @ai-sdk/google-vertex@5.0.98 src/maas, src/xai.
  • C16: Anthropic InvokeModel on Bedrock is missing.
    • Evidence: v4: aimux-providers/src/bedrock/ has no anthropic.
    • Doc: doc:768. Upstream: @ai-sdk/amazon-bedrock@5.0.100 src/anthropic, amazon-bedrock-anthropic-fetch.ts:14-63.
    • Either implement it, or register it as a product difference in doc §5 with layer B6.
  • C17: openai_output always reads openai.logprobs, whatever the provider namespace.
    • Evidence: v4: aimux-core/src/openai_output.rs:347.
    • Doc: doc:820.
  • C50: the custom provider does not forward discovery.
    • Evidence: v4: aimux-core/src/custom_provider.rs:145-152 forwards files and skills only.
    • Doc: doc:1593. Upstream: ai@7.0.122 src/registry/custom-provider.ts:64 (no discovery; the doc requires forwarding).
  • U26: speech results lack usage.
    • Evidence: v4: aimux-core/src/speech_model.rs has no usage field, but V4 pins provider 4.0.21.
    • Upstream: @ai-sdk/provider@4.0.21 src/speech-model/v4/speech-model-v4-result.ts:27 (usage?: JSONObject).
    • The tracing half of U26 is done after the migration, together with C3 (telemetry split).
  • Note, doc carry only (no code): A1, A3 and A7 doc edits travel with layers B3, B4 and B3; see the planned alignment-doc PR plan. They are listed here so the vendor layers' PR descriptions pick them up.

Checklist: further items

  • N4.1-1: Azure lacks deepseek() and completion().

    • Evidence: upstream azure@4.0.84 src/azure-openai-provider.ts:52-67, :327-341 reuses @ai-sdk/deepseek/internal and the OpenAI completion model. v4: aimux-providers/src/azure/mod.rs:437-502 has only chat, responses, embedding, image, transcription and speech. doc:764.
    • Fixed in: layer C1. If not ported, register it in the doc's known-gaps list.
  • NP2-4: OpenAI Responses reasoning is not merged by item id (RSN-13).

    • Evidence: v4: aimux-providers/src/openai/responses/convert.rs:333-380 pushes each reasoning part separately, so store=true repeats item_reference and store=false splits one item into several. Upstream openai@4.0.80 src/responses/convert-to-openai-responses-input.ts:651, :1158-1209 merges summaries per reasoningId and sends item_reference once.
    • Fixed in: layer B4.
  • N31-5.2-1: provider-utils exports an OpenAI-shaped shared error handler. Also on master. Low priority.

    • Evidence: v4: aimux-provider-utils/src/response_handler.rs:222 (create_standard_json_error_response_handler), used by 11 providers (groq, deepseek, jev, linkup, parallel_ai, serper, tinyfish, you_com, azure transcription, …). PIPE:261-268 forbids it. Upstream provider-utils has only createJsonErrorResponseHandler; each package defines its own error schema.
    • Fixed in: the layers that own those providers (B4/B5/B7).
  • S2-4: Anthropic-AWS differs from upstream @ai-sdk/anthropic-aws 2.0.60.

    • Upstream anthropic-aws-provider.ts: workspaceId is required and read from ANTHROPIC_AWS_WORKSPACE_ID at request time (:219-227); region comes from AWS_REGION (:136-141, :210-217); with no apiKey / ANTHROPIC_AWS_API_KEY it signs with SigV4 from env AWS credentials (:128-134, :160-178).
    • Ours (v4: aimux-providers/src/anthropic_aws/mod.rs:60-76, :130-148): workspace optional and not read from env, region defaults to us-east-1 and never reads env, only x-api-key.
    • Fixed in: layer C1. Add the Anthropic-AWS row to the doc's §3.3 per-package timing table.
      Acceptance. Port the upstream openai-compatible tests: transformRequestBody, metadataExtractor (generate and stream), and multi-part tool content. Add an Anthropic raw-chunk test, plus fixtures for the new subpaths.

Activity

  1. cunninghamcard-bit commented on Oct 14, 2026

    @cunninghamcard-bit
    ContributorAuthor

    更新一下本 issue 的承载 PR,以下条目已实现、待合并:

    C16(Bedrock Anthropic InvokeModel)和 N4.1-1(Azure deepseek/completion)已在 alignment 文档 §5 登记为产品差异,对应能力未移植。

    本次核对了云端源码,未运行测试。

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions