Skip to content

Core 运行时:与 AI SDK 的剩余差距(对齐文档 §9.1 已知差距) #276

Open

Description

@cunninghamcard-bit

核对基线:master 5743a40a。对齐文档 §9.1 在 2026-10-13 登记了一批"迁移各层不实现、迁移完成后再做"的设计,迁移已完成,这些项目前没有跟踪项。另有几处核对时发现的小缺口一并列入。

清单

关联:#180(cache probe 已知限制)。

Activity

  1. cunninghamcard-bit commented on Oct 19, 2026

    @cunninghamcard-bit
    ContributorAuthor

    补充:核对上游测试覆盖(#278)时发现以下 core 功能上游有测试,aimux 没有实现,对齐文档 §9.1 和 rfc-0039-implementation 里也没登记。实现或登记为差异。

    • 中间件 extractJsonMiddleware、defaultSettingsMiddleware、simulateStreamingMiddleware
    • embedding 模型中间件(wrapEmbeddingModel)
    • onLanguageModelCallStart / onLanguageModelCallEnd 回调(工具选择违规检查在 aimux-core/src/generate.rs:2098-2126 已有,但没有这两个回调)
    • provider-utils 的 injectJsonInstruction(Bedrock convert.rs:1517 和 Mistral convert.rs:233 各自拼了不同的提示语):fix: Mistral injects the JSON instruction like the AI SDK #283,已合并(c0622ea4)
    • 转写流的客户端帧解析(上游 transcription-stream.* 帧类型)
    • 图片 part 接受 provider 引用(aimux-core/src/content.rs:49-57 的 UserContentPart::Image 只收字节)

    已登记、不在此列:prepareStep / onStepStart(D25 单步内核)、redirect error 模式(跨域重定向差异)、Batch 与 Realtime(不在范围)。


    Generated by Claude Code

  2. cunninghamcard-bit commented on Oct 20, 2026

    @cunninghamcard-bit
    ContributorAuthor

    补充:按锁定版本(fixtures/aisdk/VERSIONS.json)复核偏差 PR 时,发现下面几项。前两项是锁定版本之后的上游才有的,等锁升级时一起做;第三项是 core 和锁定的 @ai-sdk/provider 规范之间的缺口。

    上面 injectJsonInstruction 那一项由 #283 处理。


    Generated by Claude Code

  3. cunninghamcard-bit commented on Oct 20, 2026

    @cunninghamcard-bit
    ContributorAuthor

    Hugging Face 测试迁移(#303)里有 3 个上游用例因为错误提示文字和上游不同,暂记为 sub-feature,挂在这里:

    上游用例 上游的文字 aimux 现在
    HuggingFaceProvider › unsupported functionality › should throw for text embedding models Hugging Face Responses API does not support text embeddings. Use the Hugging Face Inference API directly for embeddings. no such model: any-model
    HuggingFaceProvider › unsupported functionality › should throw for image models Hugging Face Responses API does not support image generation. Use the Hugging Face Inference API directly for image models. no such model: any-model
    HuggingFaceResponsesLanguageModel › message conversion › should throw for file parts with provider references 'file parts with provider references' functionality not supported. unsupported functionality: file parts with provider references

    原因在 aimux-core:NoSuchModel 没有自定义 message 字段(上游 NoSuchModelError 可以传 message,huggingface-provider.ts:95-110),UnsupportedFunctionality 的 Display 格式和上游 UnsupportedFunctionalityError 不同。aimux-core/src/error.rs 正在 #268 里改,等它合并后在 core 里对齐这两处,再把这 3 个用例从 layout.toml 的排除里移出、补上测试。


    Generated by Claude Code

  4. cunninghamcard-bit commented on Oct 20, 2026

    @cunninghamcard-bit
    ContributorAuthor

    Two core-level differences found while porting the @ai-sdk/xai@5.0.12 tests (#312):

    difference effect on the xAI tests how #312 handles it
    aimux-core VideoOperationStatus (aimux-core/src/video_model.rs:312) has only Pending and Completed; an error status is Err(AiMuxError), which carries no VideoResponse XaiVideoModel › doStatus › should return error status on expired also checks result.response (timestamp, modelId, headers) sub-feature, issue 276; the error text is still asserted
    aimux has no AI_StreamProviderError (ai@7.0.128 src/error/stream-provider-error.ts); an in-stream error event becomes AI_APICallError, with upstream's code in providerCode and the event type only in data 3 Responses cases compare the error part's type and code compared through a view that renames the two fields; message, statusCode, isRetryable and data match upstream as they are

    The two xAI behaviour fixes from the same port are #310 and #311 (registered in the #275 deviation list).


    Generated by Claude Code

  5. cunninghamcard-bit commented on Oct 20, 2026

    @cunninghamcard-bit
    ContributorAuthor

    错误体系和 cause(RFC-0047、#289、#290、#293)单独跟踪在 #327。


    Generated by Claude Code

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

    area:coreCore abstractions (aimux-core)enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions