Feature request: provider-native model listing, required-header validation, and non-chat endpoints (Anthropic / Gemini)
维护者通常 1 天内回复
@jpr5 已经在做这个了。
开始于 2026年10月12日。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 14/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- bun, typescript
- 领域
- api, testing-qa
调研方向
The payload names no source files, so start by locating how the existing GET /v1/models route and strict mode are handled in the aimock repository. The request bundles four separate features (provider-native model listings, required-header checks, extra endpoints, and cache usage fields), so the first step is to agree with maintainers on which part to take. Done means one scoped part works under strict mode with a test that fails without the change.
由索引模型根据 Issue 内容生成。
描述
Context
We use aimock (1.44.0, strict mode, in a Bun test suite) to test an app that talks to user-configured providers in four formats: OpenAI Chat Completions, OpenAI Responses, Anthropic Messages and Gemini. Generation goes through the Vercel AI SDK and aimock covers it well. The gaps we hit are the calls around generation, which our app makes with plain fetch.
A concrete miss: our model-discovery call to an Anthropic endpoint sent x-api-key but no anthropic-version. The real API answers that with
{"type":"error","error":{"type":"invalid_request_error","message":"anthropic-version: header is required"}}
(HTTP 400), but our aimock-backed tests passed, so we only found it with a real key.
What we would like
-
Provider-native model listing. Today
GET /v1/modelsreturns one OpenAI-shaped list ({object: "list", data: [{id, object: "model", owned_by}]}) to every client, and there is noGET /v1beta/models. It would help to have:- Anthropic
GET /v1/modelsin its own shape (data[{type: "model", id, display_name, created_at}],has_more,first_id,last_id), withlimit/after_idpaging, selected e.g. by the presence ofanthropic-versionorx-api-key. - Gemini
GET /v1beta/models(models[{name: "models/…", displayName, inputTokenLimit, outputTokenLimit, supportedGenerationMethods}],nextPageToken). - Paging that can be forced from fixtures or options (e.g. a small page size), so clients that ignore
has_more/nextPageTokenfail in tests.
- Anthropic
-
Required-header validation under strict mode. On Anthropic routes (
/v1/messages,/v1/models), reject a request withoutanthropic-versionwith the real 400 body above. More generally, strict mode could enforce each provider's documented required headers, since that is exactly the class of rule an SDK-based happy path never exercises. -
Other non-generation endpoints, so they can be tested next to chat:
- Anthropic
GET /v1/models/{model_id}andPOST /v1/messages/count_tokens. - Gemini
GET /v1beta/models/{model}andPOST /v1beta/models/{model}:countTokens.
- Anthropic
-
Anthropic prompt-cache usage in fixtures. As far as we can tell, an Anthropic fixture cannot return
cache_creation_input_tokens,cache_read_input_tokensor thecache_creation.ephemeral_5m_input_tokens/ephemeral_1h_input_tokensbreakdown. Being able to set these (or having replay serve recorded values) would let us test cost and context accounting for cached prompts without a live key.
Happy to provide more detail or test a pre-release. Thanks for aimock.
- 主要语言
- TypeScript
- 星标
- 979
- 派生
- 84
- 平均合并
- 1 天 5 小时
- 30 天内合并 PR
- 75
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
CopilotKit/aimock 的其他 Issue
-
难度 3/5 1-2 天 新手友好度 58/100
CopilotKit/aimock#549 · 1 条评论 ·
维护者通常 1 天内回复
-
Feature: model-generated files (inline images) in chat/responses turns可能已有人在做 @abhiaiyer91 于 4 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 35/100
CopilotKit/aimock#548 · 1 条评论 ·
维护者通常 1 天内回复
-
Feature: scriptable citations / annotations on text responses可能已有人在做 @abhiaiyer91 于 4 天前认领。 未关闭
难度 5/5 一周以上 新手友好度 25/100
CopilotKit/aimock#547 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 10/100
CopilotKit/aimock#289 ·
维护者通常 1 天内回复
查看 CopilotKit/aimock 的全部 Issue
相似的 Issue
-
Add: Pbs Kids未关闭check:passed streams:add
难度 2/5 1-3 小时 新手友好度 67/100
维护者通常 2 天内回复
-
maintanance
难度 2/5 1-3 小时 新手友好度 76/100
inmanta/web-console#7583 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 70/100
deltachat/deltachat-desktop#6881 · 1 条评论 ·
维护者通常 3 天内回复
-
[Bug Report][3.13.7] VDataTable with select-strategy="single" shows select-all checkbox in mobile mode可能已有人在做 @lazerg 今天认领。 未关闭S: triage
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
phivk/rubiks-lab#33 ·
维护者通常 1 天内回复