copilot-relay 0.3.3 → 0.3.4
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 +16 -11
- package/config.default.yaml +1 -1
- package/dist/main.js +13 -9
- package/dist/main.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -49,13 +49,14 @@ Routing:
|
|
|
49
49
|
| Requested model | Upstream model |
|
|
50
50
|
| --- | --- |
|
|
51
51
|
| contains `opus` | `claude-opus-5` |
|
|
52
|
-
| `gpt-
|
|
52
|
+
| `gpt-6-astra[1m]`, plain `gpt-6-astra`, or another non-Opus alias | `gpt-6-astra` |
|
|
53
53
|
|
|
54
|
-
The
|
|
55
|
-
changes Claude Code's client-side context budgeting
|
|
56
|
-
|
|
57
|
-
capacity.
|
|
58
|
-
|
|
54
|
+
The fresh-install default is `gpt-6-astra`, exposed to Claude Code as
|
|
55
|
+
`gpt-6-astra[1m]`. The selector changes Claude Code's client-side context budgeting
|
|
56
|
+
only; Copilot receives the canonical `gpt-6-astra` ID. It does not enlarge
|
|
57
|
+
upstream capacity. Existing `config.yaml` model choices are never migrated.
|
|
58
|
+
If your account cannot use Astra, startup fails explicitly; choose a model your
|
|
59
|
+
account supports rather than relying on an automatic fallback.
|
|
59
60
|
|
|
60
61
|
Claude Code can still show its built-in Haiku and Sonnet picker entries. The
|
|
61
62
|
managed `model` field sets the startup default but does not restrict
|
|
@@ -73,8 +74,8 @@ npx copilot-relay@latest stop
|
|
|
73
74
|
With `claudeSetup: true`, `start` manages `ANTHROPIC_BASE_URL`, a dummy
|
|
74
75
|
`ANTHROPIC_AUTH_TOKEN` when auth is absent, and the configured GPT default via
|
|
75
76
|
the top-level `model` field in `~/.claude/settings.json`. Exact
|
|
76
|
-
`gpt-5.6-sol`
|
|
77
|
-
`
|
|
77
|
+
`gpt-6-astra` and `gpt-5.6-sol` overrides are normalized to Claude-facing
|
|
78
|
+
`[1m]` identities; unrelated model choices are preserved.
|
|
78
79
|
|
|
79
80
|
## Config
|
|
80
81
|
|
|
@@ -90,12 +91,16 @@ logRetentionDays: 3
|
|
|
90
91
|
thinkEffort: max
|
|
91
92
|
upstreamTimeoutSeconds: 180
|
|
92
93
|
webSearchBackend:
|
|
94
|
+
gptModel: gpt-6-astra
|
|
95
|
+
opusModel: claude-opus-5
|
|
93
96
|
```
|
|
94
97
|
|
|
95
98
|
copilot-relay writes the resolved config back to this file, so every key is
|
|
96
99
|
present after the first start. Shipped defaults therefore apply to fresh
|
|
97
100
|
installs only — once a value is in your `config.yaml` it is never rewritten by
|
|
98
|
-
an upgrade. To pick up a changed default, edit the key yourself.
|
|
101
|
+
an upgrade. To pick up a changed default, edit the key yourself. See
|
|
102
|
+
[Configuration](wiki/EN-Configuration.md) / [配置说明](wiki/ZH-Configuration.md)
|
|
103
|
+
for live model discovery, compatible thinking efforts, and copy-paste updates.
|
|
99
104
|
|
|
100
105
|
`logLevel` controls verbosity:
|
|
101
106
|
|
|
@@ -137,7 +142,7 @@ copilot-relay 0.2.5
|
|
|
137
142
|
version 0.2.5
|
|
138
143
|
listening http://127.0.0.1:4142
|
|
139
144
|
health ok (9ms)
|
|
140
|
-
models gpt-
|
|
145
|
+
models gpt-6-astra[1m], claude-opus-5
|
|
141
146
|
upstream not checked (use --deep)
|
|
142
147
|
log ~/.copilot-relay/logs/copilot-relay.2026-07-25.log
|
|
143
148
|
config ~/.copilot-relay/config.yaml
|
|
@@ -150,7 +155,7 @@ copilot-relay 0.2.5
|
|
|
150
155
|
thinkEffort max
|
|
151
156
|
upstreamTimeoutSeconds 180
|
|
152
157
|
webSearchBackend (unset — uses gptModel)
|
|
153
|
-
gptModel gpt-
|
|
158
|
+
gptModel gpt-6-astra
|
|
154
159
|
opusModel claude-opus-5
|
|
155
160
|
host, port and claudeSetup take effect on restart; the rest hot-reload.
|
|
156
161
|
```
|
package/config.default.yaml
CHANGED
|
@@ -52,7 +52,7 @@ webSearchBackend:
|
|
|
52
52
|
# Model routing: requests containing "opus" use opusModel; all others use gptModel.
|
|
53
53
|
#
|
|
54
54
|
# Upstream Copilot model used for non-Opus requests.
|
|
55
|
-
gptModel: gpt-
|
|
55
|
+
gptModel: gpt-6-astra
|
|
56
56
|
|
|
57
57
|
# Upstream Copilot model used for requests containing "opus".
|
|
58
58
|
opusModel: claude-opus-5
|
package/dist/main.js
CHANGED
|
@@ -543,15 +543,19 @@ const runtimeState = {};
|
|
|
543
543
|
//#region src/lib/models.ts
|
|
544
544
|
const defaultReasoningEffort = "max";
|
|
545
545
|
const defaultModelRouting = {
|
|
546
|
-
gptModel: "gpt-
|
|
546
|
+
gptModel: "gpt-6-astra",
|
|
547
547
|
opusModel: "claude-opus-5"
|
|
548
548
|
};
|
|
549
549
|
const isReasoningEffort = (value) => value === "none" || value === "low" || value === "medium" || value === "high" || value === "xhigh" || value === "max";
|
|
550
|
-
const
|
|
551
|
-
const
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
const
|
|
550
|
+
const oneMillionContextModelPattern = /^(gpt-5\.6-sol|gpt-6-astra)(?:\[1m\])*$/i;
|
|
551
|
+
const normalizeOneMillionContextModel = (model) => {
|
|
552
|
+
return oneMillionContextModelPattern.exec(model)?.[1]?.toLowerCase();
|
|
553
|
+
};
|
|
554
|
+
const normalizeClaudeModelId = (model) => {
|
|
555
|
+
const normalized = normalizeOneMillionContextModel(model);
|
|
556
|
+
return normalized ? `${normalized}[1m]` : model;
|
|
557
|
+
};
|
|
558
|
+
const normalizeCopilotModelId = (model) => normalizeOneMillionContextModel(model) ?? model;
|
|
555
559
|
const getConfiguredModelRouting = () => runtimeState.modelRouting ?? defaultModelRouting;
|
|
556
560
|
const getModelRouting = () => {
|
|
557
561
|
const routing = getConfiguredModelRouting();
|
|
@@ -591,7 +595,7 @@ const logLevels = [
|
|
|
591
595
|
const defaultConfig = {
|
|
592
596
|
claudeSetup: true,
|
|
593
597
|
copilotBaseUrl: "https://api.githubcopilot.com",
|
|
594
|
-
gptModel: "gpt-
|
|
598
|
+
gptModel: "gpt-6-astra",
|
|
595
599
|
host: "127.0.0.1",
|
|
596
600
|
logLevel: "info",
|
|
597
601
|
logRetentionDays: 3,
|
|
@@ -1197,7 +1201,7 @@ const hasPrimaryModelOverride = (parsed, env) => typeof parsed.model === "string
|
|
|
1197
1201
|
/**
|
|
1198
1202
|
* Update `~/.claude/settings.json` so its env block points Claude Code at the
|
|
1199
1203
|
* running proxy. Preserves unrelated keys and model choices while normalizing
|
|
1200
|
-
* managed
|
|
1204
|
+
* managed one-million-context GPT overrides. Sets a dummy auth token only if absent.
|
|
1201
1205
|
*/
|
|
1202
1206
|
async function applyClaudeConfig(input) {
|
|
1203
1207
|
const { configPath: configPath$1, baseUrl, gptModel } = input;
|
|
@@ -1387,7 +1391,7 @@ const fetchCopilot = async (provider, path$1, init, options = {}) => {
|
|
|
1387
1391
|
|
|
1388
1392
|
//#endregion
|
|
1389
1393
|
//#region src/copilot/responses.ts
|
|
1390
|
-
const responsesOnlyModelPattern = /^(?:gpt-5\.5|gpt-5\.6)(?:-|$)/i;
|
|
1394
|
+
const responsesOnlyModelPattern = /^(?:gpt-5\.5|gpt-5\.6|gpt-6-astra)(?:-|$)/i;
|
|
1391
1395
|
function shouldUseResponsesApiForModel(model) {
|
|
1392
1396
|
return responsesOnlyModelPattern.test(model);
|
|
1393
1397
|
}
|