@jeffreycao/copilot-api 1.14.22 → 1.14.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -0
- package/README.zh-CN.md +12 -0
- package/dist/main.js +1 -1
- package/dist/{server-1bRJXXHH.js → server-D8An7dpg.js} +2 -1
- package/dist/server-D8An7dpg.js.map +1 -0
- package/dist/{start-Bdhmu5Js.js → start-C1hWSQR4.js} +2 -2
- package/dist/{start-Bdhmu5Js.js.map → start-C1hWSQR4.js.map} +1 -1
- package/package.json +1 -1
- package/dist/server-1bRJXXHH.js.map +0 -1
package/README.md
CHANGED
|
@@ -330,6 +330,18 @@ enabled = false
|
|
|
330
330
|
> This configuration is specific to Codex and the GitHub Copilot provider. `name` must be set to `"OpenAI"`. It can help mitigate Codex local compact cache miss issues.
|
|
331
331
|
> If you are using the codex provider, it is recommended to set `base_url` to `"http://localhost:4141/codex"`.
|
|
332
332
|
|
|
333
|
+
When Codex uses the top-level GitHub Copilot route with `approvals_reviewer = "auto_review"`, map its internal review model to a Responses-capable Copilot model in the gateway's `config.json`:
|
|
334
|
+
|
|
335
|
+
```json
|
|
336
|
+
{
|
|
337
|
+
"modelMappings": {
|
|
338
|
+
"codex-auto-review": "gpt-5.6-luna"
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
This mapping only applies to the top-level GitHub Copilot route. Provider-scoped routes do not use `modelMappings`, so the built-in `/codex` provider continues to handle `codex-auto-review` natively.
|
|
344
|
+
|
|
333
345
|
## GPT Tool Search
|
|
334
346
|
|
|
335
347
|
For GPT Responses models such as `gpt-5.4+`, this AI gateway can expose Responses `tool_search` through a small MCP bridge. The same bridge can be used by Claude Code and opencode, as long as the client loads MCP servers and sends Anthropic Messages traffic through this gateway.
|
package/README.zh-CN.md
CHANGED
|
@@ -332,6 +332,18 @@ enabled = false
|
|
|
332
332
|
> 此配置仅限于 Codex 与 GitHub Copilot provider。`name` 一定要配置为 `"OpenAI"`。它可以缓解 Codex local compact 不命中缓存的问题。
|
|
333
333
|
> 如果使用 codex provider,建议将 `base_url` 配置为 `"http://localhost:4141/codex"`。
|
|
334
334
|
|
|
335
|
+
当 Codex 通过顶层 GitHub Copilot 路由并设置 `approvals_reviewer = "auto_review"` 时,可在网关的 `config.json` 中将内部审核模型映射到一个支持 Responses API 的 Copilot 模型:
|
|
336
|
+
|
|
337
|
+
```json
|
|
338
|
+
{
|
|
339
|
+
"modelMappings": {
|
|
340
|
+
"codex-auto-review": "gpt-5.6-luna"
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
该映射只作用于顶层 GitHub Copilot 路由。provider-scoped 路由不会使用 `modelMappings`,因此内置 `/codex` provider 仍会原生处理 `codex-auto-review`。
|
|
346
|
+
|
|
335
347
|
## GPT Tool Search
|
|
336
348
|
|
|
337
349
|
对于 `gpt-5.4+` 这类 GPT Responses 模型,这个 AI gateway 可以通过一个很小的 MCP bridge 暴露 Responses `tool_search`。Claude Code 和 opencode 都可以使用同一个 bridge,前提是客户端会加载 MCP server,并且 Anthropic Messages 流量会经过这个 AI gateway。
|
package/dist/main.js
CHANGED
|
@@ -25,7 +25,7 @@ bindElectronFetch();
|
|
|
25
25
|
const { auth } = await import("./auth-CitK8MfX.js");
|
|
26
26
|
const { debug } = await import("./debug-6pwRAzyw.js");
|
|
27
27
|
const { mcp } = await import("./mcp-BG6fpi6q.js");
|
|
28
|
-
const { start } = await import("./start-
|
|
28
|
+
const { start } = await import("./start-C1hWSQR4.js");
|
|
29
29
|
await runMain(defineCommand({
|
|
30
30
|
meta: {
|
|
31
31
|
name: "copilot-api",
|
|
@@ -2500,6 +2500,7 @@ function handleAssistantMessage(message, modelId, capabilities) {
|
|
|
2500
2500
|
role: "assistant",
|
|
2501
2501
|
content: mapContent(message.content)
|
|
2502
2502
|
}];
|
|
2503
|
+
if (message.content.length === 0) return [];
|
|
2503
2504
|
const toolUseBlocks = message.content.filter((block) => block.type === "tool_use");
|
|
2504
2505
|
let thinkingBlocks = message.content.filter((block) => block.type === "thinking");
|
|
2505
2506
|
if (modelId.startsWith("claude")) thinkingBlocks = thinkingBlocks.filter((b) => b.thinking && b.thinking !== "Thinking..." && b.signature && !b.signature.includes("@"));
|
|
@@ -7258,4 +7259,4 @@ server.route("/:provider/images", providerImageRoutes);
|
|
|
7258
7259
|
//#endregion
|
|
7259
7260
|
export { server };
|
|
7260
7261
|
|
|
7261
|
-
//# sourceMappingURL=server-
|
|
7262
|
+
//# sourceMappingURL=server-D8An7dpg.js.map
|