betahi-copilot-bridge 0.20.0 → 0.20.1
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 +17 -0
- package/dist/main.js +11 -1
- package/dist/main.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -139,6 +139,18 @@ Minimal recommended config is:
|
|
|
139
139
|
}
|
|
140
140
|
```
|
|
141
141
|
|
|
142
|
+
For Claude Code 1M context, use the `-[1m]` display form in
|
|
143
|
+
`ANTHROPIC_MODEL`. Claude Code shows a 1M context window for this form, while
|
|
144
|
+
the bridge maps it to the real Copilot `-1m` model upstream:
|
|
145
|
+
|
|
146
|
+
```json
|
|
147
|
+
{
|
|
148
|
+
"env": {
|
|
149
|
+
"ANTHROPIC_MODEL": "claude-opus-4.7-[1m]",
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
```
|
|
153
|
+
|
|
142
154
|
Optional slot-specific:
|
|
143
155
|
|
|
144
156
|
```json
|
|
@@ -208,6 +220,11 @@ For Claude Opus 4.7, both Codex CLI and Claude Code can use
|
|
|
208
220
|
`claude-opus-4.7` with reasoning effort `high` or `xhigh`; the bridge routes the
|
|
209
221
|
request to the matching upstream reasoning variant.
|
|
210
222
|
|
|
223
|
+
For Claude Code settings, prefer `claude-opus-4.7-[1m]` or
|
|
224
|
+
`claude-opus-4.6-[1m]` when you want the CLI `/context` UI and the upstream
|
|
225
|
+
model to both use 1M context. Direct API clients can use
|
|
226
|
+
`claude-opus-4.7-1m` or `claude-opus-4.6-1m`.
|
|
227
|
+
|
|
211
228
|
### Gemini family — translated to chat completions
|
|
212
229
|
|
|
213
230
|
| Model | Aliases |
|
package/dist/main.js
CHANGED
|
@@ -1576,7 +1576,17 @@ const createAnthropicToolNameMapper = (tools, options = {}) => {
|
|
|
1576
1576
|
//#region src/bridges/claude/non-stream-translation.ts
|
|
1577
1577
|
const normalizeClaudeModelAlias = (model) => {
|
|
1578
1578
|
const trimmed = model.trim().toLowerCase();
|
|
1579
|
-
if (trimmed === "opus[1m]") return "claude-opus-4.
|
|
1579
|
+
if (trimmed === "opus[1m]") return "claude-opus-4.7-1m";
|
|
1580
|
+
const claudeOpusOneMillionMatch = trimmed.match(/^claude-opus-(\d)[.-](\d)(?:-\d{8})?-?\[1m\]$/);
|
|
1581
|
+
if (claudeOpusOneMillionMatch) {
|
|
1582
|
+
const [, major, minor] = claudeOpusOneMillionMatch;
|
|
1583
|
+
return `claude-opus-${major}.${minor}-1m`;
|
|
1584
|
+
}
|
|
1585
|
+
const claudeOpusOneMillionStrippedByClaudeCodeMatch = trimmed.match(/^claude-opus-(\d)[.-](\d)-$/);
|
|
1586
|
+
if (claudeOpusOneMillionStrippedByClaudeCodeMatch) {
|
|
1587
|
+
const [, major, minor] = claudeOpusOneMillionStrippedByClaudeCodeMatch;
|
|
1588
|
+
return `claude-opus-${major}.${minor}-1m`;
|
|
1589
|
+
}
|
|
1580
1590
|
const normalized = trimmed.replace(/\[1m\]$/, "");
|
|
1581
1591
|
const prefixed = normalized.startsWith("opus-") ? `claude-${normalized}` : normalized;
|
|
1582
1592
|
if (prefixed === "opus") return "claude-opus";
|