@bitkyc08/opencodex 2.100.4 → 2.100.5-preview.20261118.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/gui/dist/assets/{App-DcpyI78f.js → App-BiOGtxDS.js} +21 -21
- package/gui/dist/assets/{Tray-CzjPJprT.js → Tray-BwsMejUO.js} +1 -1
- package/gui/dist/assets/{brand-mark-BTIi7e69.js → brand-mark-BY1dgACL.js} +1 -1
- package/gui/dist/assets/index-CwHSKMdG.js +138 -0
- package/gui/dist/assets/{segment-thumb-features-Bn6Y-g3R.js → segment-thumb-features-Bds9Hb_7.js} +1 -1
- package/gui/dist/classic/assets/{App-eYJAyNHM.js → App-CGLOiqQL.js} +20 -20
- package/gui/dist/classic/assets/{Tray-xHMYxLkV.js → Tray-Da4r2O70.js} +1 -1
- package/gui/dist/classic/assets/index-CvoKXKL9.js +138 -0
- package/gui/dist/classic/assets/{quota-summary-DyzHlkFl.js → quota-summary-DvqzfCmr.js} +1 -1
- package/gui/dist/classic/index.html +1 -1
- package/gui/dist/index.html +1 -1
- package/native/ocx-child/src/link_ws.rs +24 -19
- package/native/ocx-child/src/link_ws_frame.rs +136 -50
- package/package.json +3 -3
- package/src/adapters/anthropic-input-schema.ts +270 -0
- package/src/adapters/anthropic.ts +1 -63
- package/src/adapters/command-code-tool-text.ts +9 -1
- package/src/adapters/command-code.ts +18 -2
- package/src/adapters/devin/cloud-direct/chat.ts +24 -0
- package/src/adapters/devin/live-models.ts +11 -1
- package/src/adapters/kiro/reasoning.ts +3 -0
- package/src/adapters/kiro-tools.ts +14 -9
- package/src/adapters/openai-responses/passthrough.ts +3 -1
- package/src/adapters/openai-responses/request-strips.ts +1 -0
- package/src/adapters/tool-catalog-nudge.ts +1 -1
- package/src/claude/chat-tool-dispatch.ts +4 -1
- package/src/cli/logout-command.ts +23 -4
- package/src/cli/provider.ts +3 -2
- package/src/client/connect.ts +10 -2
- package/src/clients/config-export.ts +12 -7
- package/src/codex/account-lifecycle.ts +3 -1
- package/src/codex/catalog/metadata.ts +8 -0
- package/src/codex/catalog/native-models.ts +16 -6
- package/src/codex/catalog/pinned-models.ts +1 -0
- package/src/codex/catalog/provider-models.ts +5 -5
- package/src/codex/catalog-auto-refresh.ts +13 -2
- package/src/codex/config-drift-heal.ts +40 -12
- package/src/codex/config-write-lock.ts +39 -1
- package/src/codex/data/roster-pinned-models.json +346 -1
- package/src/codex/inject/config-write-section.ts +39 -1
- package/src/codex/inject/plan.ts +10 -8
- package/src/codex/inject/remove.ts +21 -19
- package/src/codex/inject/restore.ts +5 -1
- package/src/codex/inject-coordination.ts +58 -7
- package/src/codex/inject.ts +10 -12
- package/src/codex/journal-config-restore.ts +42 -0
- package/src/codex/journal.ts +62 -8
- package/src/codex/main-account.ts +7 -2
- package/src/codex/native-main-credentials.ts +11 -5
- package/src/combos/failover.ts +183 -0
- package/src/config/subagent-models.ts +20 -12
- package/src/generated/compatibility-version.json +99 -83
- package/src/generated/model-metadata.ts +3 -3
- package/src/lib/client-error-body.ts +6 -0
- package/src/lib/developer-role-rejection.ts +15 -0
- package/src/lib/upstream-retry.ts +1 -1
- package/src/messaging/remote-ports.ts +22 -10
- package/src/oauth/credential-siblings.ts +32 -0
- package/src/oauth/generic-account-failover.ts +25 -13
- package/src/oauth/index.ts +22 -14
- package/src/oauth/store.ts +38 -7
- package/src/providers/anthropic-reset-grants.ts +4 -0
- package/src/providers/claude-cli-usage.ts +2 -0
- package/src/providers/codebuddy-models.ts +11 -0
- package/src/providers/google-vertex-model-discovery.ts +43 -14
- package/src/providers/kiro-models.ts +5 -0
- package/src/providers/registry/entries-core.ts +9 -3
- package/src/providers/registry/entries-extended.ts +20 -9
- package/src/providers/registry/model-seeds.ts +4 -1
- package/src/providers/stale-context-window-migration.ts +2 -0
- package/src/responses/citation-markers.ts +26 -23
- package/src/server/management/link-enrollment.ts +3 -3
- package/src/server/management/link-route-request.ts +11 -5
- package/src/server/management/oauth-account-routes.ts +21 -8
- package/src/server/management/provider-credential-release.ts +44 -0
- package/src/server/management/provider-routes.ts +8 -8
- package/src/server/management/usage-aggregate-cache.ts +6 -3
- package/src/server/messages-native.ts +16 -2
- package/src/server/request-log-conversation.ts +6 -2
- package/src/server/request-log-failure-detail.ts +26 -9
- package/src/server/responses/adapter-continuation.ts +59 -25
- package/src/server/responses/adapter-dispatch.ts +8 -8
- package/src/server/responses/codex-tool-catalog.ts +47 -10
- package/src/server/responses/combo-session-recall.ts +26 -1
- package/src/server/responses/combo-stream-preflight.ts +35 -26
- package/src/server/responses/core-combo-failure.ts +6 -0
- package/src/server/responses/core-combo-native.ts +2 -1
- package/src/server/responses/core-combo.ts +43 -19
- package/src/server/responses/core-options.ts +2 -0
- package/src/server/responses/input-admission.ts +41 -3
- package/src/server/responses/request-send-budget.ts +1 -1
- package/src/server/responses/request-transport.ts +10 -2
- package/src/server/responses/sidecar-execution.ts +6 -4
- package/src/service/windows-checked-stop-live.ts +28 -5
- package/src/types/request.ts +4 -3
- package/src/usage/expected-prices.ts +35 -0
- package/src/usage/ledger-scanner.ts +44 -10
- package/src/web-search/loop.ts +20 -2
- package/src/web-search/parse.ts +2 -12
- package/src/web-search/sources.ts +13 -0
- package/gui/dist/assets/index-DVgU6S3y.js +0 -138
- package/gui/dist/classic/assets/index-DSaVRW4F.js +0 -138
package/src/oauth/index.ts
CHANGED
|
@@ -57,6 +57,7 @@ import { DSH_ACCOUNT_AUTH } from "./dsh";
|
|
|
57
57
|
import { loginOrcaRouter, orcaRouterInferenceBaseUrl, refreshOrcaRouterKey } from "./orcarouter";
|
|
58
58
|
import { ANTIGRAVITY_DISCOVERY_UA } from "../adapters/google-antigravity-wire";
|
|
59
59
|
import { deriveOAuthDefaultModel, deriveOAuthProviderConfig } from "../providers/derive";
|
|
60
|
+
import { isOAuthCredentialSiblingOf, oauthCredentialSlot } from "./credential-siblings";
|
|
60
61
|
import { apiKeyPoolEntryId, sanitizeApiKeyValue } from "../providers/api-keys";
|
|
61
62
|
import { preservableApiKeyPool } from "./api-key-pool-preserve";
|
|
62
63
|
import { effectiveGoogleMode, getProviderRegistryEntry, mergeRegistryStaticHeaders, providerMatchesRegistryTransport } from "../providers/registry";
|
|
@@ -208,6 +209,8 @@ export interface LoginOpts {
|
|
|
208
209
|
flow?: ChatGPTLoginFlow;
|
|
209
210
|
/** Code-display login: no callback server; completes from a pasted code (needs `codeRedirectUri`). */
|
|
210
211
|
codeMode?: boolean;
|
|
212
|
+
/** Publish this sibling row (see credential-siblings.ts) instead of the login's own row. */
|
|
213
|
+
publishRow?: string;
|
|
211
214
|
}
|
|
212
215
|
|
|
213
216
|
export interface LoginFlowLifecycle {
|
|
@@ -559,9 +562,9 @@ export function observeActiveOAuthAccessToken(
|
|
|
559
562
|
const authStore = normalizeAuthStoreBuffer(authStoreBuffer);
|
|
560
563
|
if (authStore.kind === "absent") return { kind: "missing" };
|
|
561
564
|
if (authStore.kind === "malformed") return { kind: "malformed" };
|
|
562
|
-
if (!isOAuthProvider(provider)) return { kind: "unsupported" };
|
|
565
|
+
if (!isOAuthProvider(oauthCredentialSlot(provider))) return { kind: "unsupported" };
|
|
563
566
|
|
|
564
|
-
const accountSet = authStore.store[provider];
|
|
567
|
+
const accountSet = authStore.store[oauthCredentialSlot(provider)];
|
|
565
568
|
const account = accountSet?.accounts.find(candidate => candidate.id === accountSet.activeAccountId);
|
|
566
569
|
if (!account) return { kind: "missing" };
|
|
567
570
|
if (account.paused === true) return { kind: "paused" };
|
|
@@ -590,6 +593,9 @@ async function resolveAccessSnapshotForAccount(
|
|
|
590
593
|
authorityCurrent?: () => boolean,
|
|
591
594
|
retryCancelledDiscovery = true,
|
|
592
595
|
): Promise<OAuthAccessSnapshot> {
|
|
596
|
+
// A sibling row resolves, refreshes and single-flights under its owner's login, then keeps its own label.
|
|
597
|
+
const slot = oauthCredentialSlot(provider);
|
|
598
|
+
if (slot !== provider) return { ...await resolveAccessSnapshotForAccount(slot, accountId, rejectedGeneration, requireUsableAccount, oauthProvider === provider ? slot : oauthProvider, authorityCurrent, retryCancelledDiscovery), provider };
|
|
593
599
|
const def = OAUTH_PROVIDERS[oauthProvider];
|
|
594
600
|
if (!def) throw new UnsupportedOAuthProviderError(oauthProvider);
|
|
595
601
|
// One store read answers both questions. A caller that opts in gets the account REJECTED
|
|
@@ -1532,16 +1538,16 @@ const OAUTH_LOGIN_OWNED_PROVIDER_FIELDS = [
|
|
|
1532
1538
|
] as const satisfies readonly (keyof OcxProviderConfig)[];
|
|
1533
1539
|
|
|
1534
1540
|
/** Add/refresh only an OAuth provider's login-owned config fields (does not persist). */
|
|
1535
|
-
export function upsertOAuthProvider(config: OcxConfig, provider: string): void {
|
|
1541
|
+
export function upsertOAuthProvider(config: OcxConfig, provider: string, row = provider): void {
|
|
1536
1542
|
assertAnthropicInstanceLoginConfig(config, provider);
|
|
1537
1543
|
if (provider === "chatgpt") return;
|
|
1538
1544
|
const def = OAUTH_PROVIDERS[provider];
|
|
1539
|
-
if (!def) return;
|
|
1545
|
+
if (!def || (row !== provider && !isOAuthCredentialSiblingOf(row, provider))) { if (def) throw new UnsupportedOAuthProviderError(row); return; }
|
|
1540
1546
|
if (provider === GOOGLE_ANTIGRAVITY_PROVIDER) migrateLegacyAntigravityStaticCatalog(config);
|
|
1541
|
-
const namespaceCollision = codexAccountNamespaceProviderCollisionError(config.codexAccountNamespaces,
|
|
1547
|
+
const namespaceCollision = codexAccountNamespaceProviderCollisionError(config.codexAccountNamespaces, row);
|
|
1542
1548
|
if (namespaceCollision) throw new OAuthProviderNamespaceCollisionError(namespaceCollision);
|
|
1543
|
-
const existing = config.providers[
|
|
1544
|
-
const providerConfig = def.resolveProviderConfig?.(config) ?? def.providerConfig;
|
|
1549
|
+
const existing = config.providers[row];
|
|
1550
|
+
const providerConfig = row !== provider ? oauthConfig(row) : def.resolveProviderConfig?.(config) ?? def.providerConfig;
|
|
1545
1551
|
// Clone operator state, including xAI wire choices and their migration version.
|
|
1546
1552
|
const next: OcxProviderConfig = structuredClone(existing ?? providerConfig);
|
|
1547
1553
|
for (const field of OAUTH_LOGIN_OWNED_PROVIDER_FIELDS) {
|
|
@@ -1568,7 +1574,7 @@ export function upsertOAuthProvider(config: OcxConfig, provider: string): void {
|
|
|
1568
1574
|
delete next.apiKey;
|
|
1569
1575
|
delete next.apiKeyPool;
|
|
1570
1576
|
delete (next as unknown as Record<string, unknown>).azureCredential;
|
|
1571
|
-
if (existing && getProviderRegistryEntry(
|
|
1577
|
+
if (existing && getProviderRegistryEntry(row)?.allowKeyAuthOverride === true) {
|
|
1572
1578
|
// Retain stored key billing intent without resolving env references in the login process.
|
|
1573
1579
|
// An explicit OAuth choice stays OAuth even when usable key material is retained.
|
|
1574
1580
|
// Shared sanitizeApiKeyValue trim / no-CRLF checks from api-key pool writes.
|
|
@@ -1591,8 +1597,8 @@ export function upsertOAuthProvider(config: OcxConfig, provider: string): void {
|
|
|
1591
1597
|
if (previousModeAllowsKey) next.authMode = "key";
|
|
1592
1598
|
}
|
|
1593
1599
|
}
|
|
1594
|
-
initializeProviderModelSelection(
|
|
1595
|
-
config.providers[
|
|
1600
|
+
initializeProviderModelSelection(row, next, existing, config);
|
|
1601
|
+
config.providers[row] = next;
|
|
1596
1602
|
}
|
|
1597
1603
|
|
|
1598
1604
|
interface RunLoginDeps {
|
|
@@ -1618,6 +1624,8 @@ export async function runLogin(
|
|
|
1618
1624
|
): Promise<OAuthCredentials> {
|
|
1619
1625
|
const def = OAUTH_PROVIDERS[provider];
|
|
1620
1626
|
if (!def) throw new UnsupportedOAuthProviderError(provider);
|
|
1627
|
+
const row = opts?.publishRow ?? provider;
|
|
1628
|
+
if (row !== provider && !isOAuthCredentialSiblingOf(row, provider)) throw new UnsupportedOAuthProviderError(row);
|
|
1621
1629
|
const loadLatestConfig = deps.loadConfig ?? loadConfig;
|
|
1622
1630
|
const saveLatestConfig = deps.saveConfig ?? saveConfig;
|
|
1623
1631
|
const initialBConfigState = provider === "anthropic2" ? observeInitialConfigState() : undefined;
|
|
@@ -1635,7 +1643,7 @@ export async function runLogin(
|
|
|
1635
1643
|
assertAnthropicInstanceLoginConfig(preflightConfig, provider);
|
|
1636
1644
|
const namespaceCollision = codexAccountNamespaceProviderCollisionError(
|
|
1637
1645
|
preflightConfig.codexAccountNamespaces,
|
|
1638
|
-
|
|
1646
|
+
row,
|
|
1639
1647
|
);
|
|
1640
1648
|
if (namespaceCollision) throw new OAuthProviderNamespaceCollisionError(namespaceCollision);
|
|
1641
1649
|
}
|
|
@@ -1663,7 +1671,7 @@ export async function runLogin(
|
|
|
1663
1671
|
// credential write is handled again below before the latest row is re-upserted.
|
|
1664
1672
|
if (provider !== "chatgpt") {
|
|
1665
1673
|
const preCommitConfig = loadLatestConfig();
|
|
1666
|
-
upsertOAuthProvider(preCommitConfig, provider);
|
|
1674
|
+
upsertOAuthProvider(preCommitConfig, provider, row);
|
|
1667
1675
|
}
|
|
1668
1676
|
if (opts?.reauthAccountId) {
|
|
1669
1677
|
const existing = getAccountCredential(provider, opts.reauthAccountId);
|
|
@@ -1728,12 +1736,12 @@ export async function runLogin(
|
|
|
1728
1736
|
const latestConfig = loadLatestConfig();
|
|
1729
1737
|
const lateCollision = codexAccountNamespaceProviderCollisionError(
|
|
1730
1738
|
latestConfig.codexAccountNamespaces,
|
|
1731
|
-
|
|
1739
|
+
row,
|
|
1732
1740
|
);
|
|
1733
1741
|
if (lateCollision) {
|
|
1734
1742
|
throw new OAuthProviderPublicationError();
|
|
1735
1743
|
}
|
|
1736
|
-
upsertOAuthProvider(latestConfig, provider);
|
|
1744
|
+
upsertOAuthProvider(latestConfig, provider, row);
|
|
1737
1745
|
saveLatestConfig(latestConfig);
|
|
1738
1746
|
}
|
|
1739
1747
|
}
|
package/src/oauth/store.ts
CHANGED
|
@@ -29,6 +29,8 @@ import { normalizeWorkBuddyMetadata } from "../providers/workbuddy";
|
|
|
29
29
|
import { findKiroAccountForLogin, withRetainedKiroUser } from "./kiro-account-identity";
|
|
30
30
|
import { isAnthropicInstanceId, type AnthropicInstanceId } from "../providers/anthropic-instance-id";
|
|
31
31
|
import { assertNoCrossAnthropicRegistration, assertAnthropicCredentialSource, assertAnthropicInstanceLoginConfig } from "./store-anthropic-instance";
|
|
32
|
+
// A sibling row (Kimi (Responses)) addresses its owner's slot in every account-set API below.
|
|
33
|
+
import { oauthCredentialSiblingsOf, oauthCredentialSlot } from "./credential-siblings";
|
|
32
34
|
import { createHash, randomUUID } from "node:crypto";
|
|
33
35
|
import { chmodSync, closeSync, constants as fsConstants, copyFileSync, existsSync, fstatSync, lstatSync, mkdirSync, openSync, readFileSync, statSync, unlinkSync, writeFileSync } from "node:fs";
|
|
34
36
|
import { join } from "node:path";
|
|
@@ -930,7 +932,7 @@ export function mutateStore<T>(fn:(store:AuthStore)=>T|Promise<T>, retainedValue
|
|
|
930
932
|
|
|
931
933
|
/** The ACTIVE account's credential for a provider (what requests should use). */
|
|
932
934
|
export function getCredential(provider: string): OAuthCredentials | null {
|
|
933
|
-
const set = loadAuthStore()[provider];
|
|
935
|
+
const set = loadAuthStore()[oauthCredentialSlot(provider)];
|
|
934
936
|
if (!set) return null;
|
|
935
937
|
return set.accounts.find(a => a.id === set.activeAccountId)?.credential ?? null;
|
|
936
938
|
}
|
|
@@ -965,6 +967,7 @@ export async function saveCredentialWithReceipt(
|
|
|
965
967
|
cred: OAuthCredentials,
|
|
966
968
|
opts: { preserveIdentityless?: boolean; assertBeforePersist?: () => void } = {},
|
|
967
969
|
): Promise<OAuthCredentialWriteReceipt | null> {
|
|
970
|
+
provider = oauthCredentialSlot(provider);
|
|
968
971
|
if (isAnthropicInstanceId(provider)) assertAnthropicCredentialSource(provider, cred);
|
|
969
972
|
const safe = normalizeCredential(cred);
|
|
970
973
|
if (!safe) return null;
|
|
@@ -1124,6 +1127,7 @@ export async function saveCredential(
|
|
|
1124
1127
|
cred: OAuthCredentials,
|
|
1125
1128
|
opts: { preserveIdentityless?: boolean; assertBeforePersist?: () => void } = {},
|
|
1126
1129
|
): Promise<OAuthCredentialWriteReceipt | null> {
|
|
1130
|
+
provider = oauthCredentialSlot(provider);
|
|
1127
1131
|
return await saveCredentialWithReceipt(provider, cred, opts);
|
|
1128
1132
|
}
|
|
1129
1133
|
|
|
@@ -1218,6 +1222,7 @@ export async function upsertCredentialByIdentity(
|
|
|
1218
1222
|
provider: string,
|
|
1219
1223
|
cred: OAuthCredentials,
|
|
1220
1224
|
): Promise<"inserted" | "updated"> {
|
|
1225
|
+
provider = oauthCredentialSlot(provider);
|
|
1221
1226
|
if (isAnthropicInstanceId(provider)) assertAnthropicCredentialSource(provider, cred);
|
|
1222
1227
|
const safe = normalizeCredential(cred);
|
|
1223
1228
|
if (!safe || (!safe.accountId && !safe.email)) {
|
|
@@ -1269,6 +1274,7 @@ export async function upsertCredentialByIdentity(
|
|
|
1269
1274
|
* Deciding inside the mutation is the only place the answer is true when it is returned.
|
|
1270
1275
|
*/
|
|
1271
1276
|
export async function removeCredential(provider: string): Promise<"removed" | "not-found"> {
|
|
1277
|
+
provider = oauthCredentialSlot(provider);
|
|
1272
1278
|
return await mutateStore(store => {
|
|
1273
1279
|
const set = store[provider];
|
|
1274
1280
|
if (!set) return "not-found" as const;
|
|
@@ -1288,11 +1294,11 @@ export async function removeCredential(provider: string): Promise<"removed" | "n
|
|
|
1288
1294
|
// ---------------------------------------------------------------------------
|
|
1289
1295
|
|
|
1290
1296
|
export function getAccountSet(provider: string): ProviderAccountSet | null {
|
|
1291
|
-
return loadAuthStore()[provider] ?? null;
|
|
1297
|
+
return loadAuthStore()[oauthCredentialSlot(provider)] ?? null;
|
|
1292
1298
|
}
|
|
1293
1299
|
|
|
1294
1300
|
export function listAccounts(provider: string): ProviderAccount[] {
|
|
1295
|
-
return loadAuthStore()[provider]?.accounts ?? [];
|
|
1301
|
+
return loadAuthStore()[oauthCredentialSlot(provider)]?.accounts ?? [];
|
|
1296
1302
|
}
|
|
1297
1303
|
|
|
1298
1304
|
export function listLiveOAuthAccountKeys(
|
|
@@ -1300,14 +1306,14 @@ export function listLiveOAuthAccountKeys(
|
|
|
1300
1306
|
): ReadonlySet<string> {
|
|
1301
1307
|
const keys = new Set<string>();
|
|
1302
1308
|
for (const [provider, accountSet] of Object.entries(loadAuthStore())) {
|
|
1303
|
-
if (!providerNames.has(provider)) continue;
|
|
1309
|
+
if (!providerNames.has(provider) && !oauthCredentialSiblingsOf(provider).some(row => providerNames.has(row))) continue;
|
|
1304
1310
|
for (const account of accountSet.accounts) keys.add(`${provider}\0${account.id}`);
|
|
1305
1311
|
}
|
|
1306
1312
|
return keys;
|
|
1307
1313
|
}
|
|
1308
1314
|
|
|
1309
1315
|
export function getAccountCredential(provider: string, accountId: string): OAuthCredentials | null {
|
|
1310
|
-
return loadAuthStore()[provider]?.accounts.find(a => a.id === accountId)?.credential ?? null;
|
|
1316
|
+
return loadAuthStore()[oauthCredentialSlot(provider)]?.accounts.find(a => a.id === accountId)?.credential ?? null;
|
|
1311
1317
|
}
|
|
1312
1318
|
|
|
1313
1319
|
/**
|
|
@@ -1321,6 +1327,7 @@ export function getAccountCredentialWithStatus(
|
|
|
1321
1327
|
provider: string,
|
|
1322
1328
|
accountId: string,
|
|
1323
1329
|
): { credential: OAuthCredentials; needsReauth: boolean; paused: boolean } | null {
|
|
1330
|
+
provider = oauthCredentialSlot(provider);
|
|
1324
1331
|
const account = loadAuthStore()[provider]?.accounts.find(a => a.id === accountId);
|
|
1325
1332
|
if (!account?.credential) return null;
|
|
1326
1333
|
return {
|
|
@@ -1344,6 +1351,7 @@ export async function saveAccountCredential(
|
|
|
1344
1351
|
*/
|
|
1345
1352
|
opts: { assertBeforePersist?: () => void; rotateLoginId?: boolean; clearAutomaticPause?: boolean } = {},
|
|
1346
1353
|
): Promise<boolean> {
|
|
1354
|
+
provider = oauthCredentialSlot(provider);
|
|
1347
1355
|
if (isAnthropicInstanceId(provider)) assertAnthropicCredentialSource(provider, cred);
|
|
1348
1356
|
const safe = normalizeCredential(cred);
|
|
1349
1357
|
if (!safe) return false;
|
|
@@ -1402,6 +1410,7 @@ export async function commitOAuthAccountSelection(
|
|
|
1402
1410
|
requireUsableAccount?: boolean;
|
|
1403
1411
|
} = {},
|
|
1404
1412
|
): Promise<OAuthAccountSelection | null> {
|
|
1413
|
+
provider = oauthCredentialSlot(provider);
|
|
1405
1414
|
// Snapshot caller-owned options before waiting for the serialized writer.
|
|
1406
1415
|
const expected = options.expectedSelection ? { ...options.expectedSelection } : undefined;
|
|
1407
1416
|
const { expectedCredentialGeneration, requireUsableAccount } = options;
|
|
@@ -1433,6 +1442,7 @@ export async function setActiveAccount(provider: string, accountId: string): Pro
|
|
|
1433
1442
|
}
|
|
1434
1443
|
|
|
1435
1444
|
export async function setAccountAlias(provider: string, accountId: string, alias: string | undefined): Promise<boolean> {
|
|
1445
|
+
provider = oauthCredentialSlot(provider);
|
|
1436
1446
|
return await mutateStore(store => {
|
|
1437
1447
|
const account = store[provider]?.accounts.find(a => a.id === accountId);
|
|
1438
1448
|
if (!account) return false;
|
|
@@ -1498,6 +1508,7 @@ export async function setAccountPaused(
|
|
|
1498
1508
|
/** Resume only while the pause and credential are the ones a health check observed (#8398). */
|
|
1499
1509
|
resumeGuard?: { generation: string; pauseRevision: string | undefined },
|
|
1500
1510
|
): Promise<SetAccountPausedResult> {
|
|
1511
|
+
provider = oauthCredentialSlot(provider);
|
|
1501
1512
|
const result = await mutateStore(store => {
|
|
1502
1513
|
const set = store[provider];
|
|
1503
1514
|
const account = set?.accounts.find(candidate => candidate.id === accountId);
|
|
@@ -1558,6 +1569,7 @@ export async function setAccountPaused(
|
|
|
1558
1569
|
|
|
1559
1570
|
/** Remove one account by id; active removal promotes the first usable survivor when available. */
|
|
1560
1571
|
export async function removeAccount(provider: string, accountId: string): Promise<boolean> {
|
|
1572
|
+
provider = oauthCredentialSlot(provider);
|
|
1561
1573
|
const removed = await mutateStore(store => {
|
|
1562
1574
|
const set = store[provider];
|
|
1563
1575
|
if (!set) return false;
|
|
@@ -1589,6 +1601,7 @@ export async function replaceProviderAccountSet(
|
|
|
1589
1601
|
provider: string,
|
|
1590
1602
|
set: ProviderAccountSet | null,
|
|
1591
1603
|
): Promise<void> {
|
|
1604
|
+
provider = oauthCredentialSlot(provider);
|
|
1592
1605
|
await mutateStore(store => {
|
|
1593
1606
|
if (!set || set.accounts.length === 0) {
|
|
1594
1607
|
const cleared = store[provider] !== undefined;
|
|
@@ -1618,6 +1631,23 @@ export async function replaceProviderAccountSet(
|
|
|
1618
1631
|
|
|
1619
1632
|
export type ProviderCredentialRekeyOutcome = "moved" | "absent" | "conflict";
|
|
1620
1633
|
|
|
1634
|
+
/**
|
|
1635
|
+
* Clear `provider`'s login slot unless `retain()` reports that a remaining row still signs in
|
|
1636
|
+
* through it. `retain` runs inside the serialized store write, so a row published while this
|
|
1637
|
+
* release waited is seen before the credential is removed. Returns whether a slot was cleared.
|
|
1638
|
+
*/
|
|
1639
|
+
export async function releaseProviderAccountSetUnlessRetained(
|
|
1640
|
+
provider: string,
|
|
1641
|
+
retain: () => boolean,
|
|
1642
|
+
): Promise<"released" | "retained"> {
|
|
1643
|
+
provider = oauthCredentialSlot(provider);
|
|
1644
|
+
return mutateStore<"released" | "retained">(store => {
|
|
1645
|
+
if (retain()) return "retained";
|
|
1646
|
+
delete store[provider];
|
|
1647
|
+
return "released";
|
|
1648
|
+
}, [provider], { scrubLegacyBackup: outcome => outcome === "released" ? [provider] : [] });
|
|
1649
|
+
}
|
|
1650
|
+
|
|
1621
1651
|
/**
|
|
1622
1652
|
* Move a provider's whole account set to a different provider key.
|
|
1623
1653
|
*
|
|
@@ -1656,6 +1686,7 @@ export async function markAccountNeedsReauth(
|
|
|
1656
1686
|
reason?: "verify_account",
|
|
1657
1687
|
writerGeneration = captureConfigGeneration(),
|
|
1658
1688
|
): Promise<void> {
|
|
1689
|
+
provider = oauthCredentialSlot(provider);
|
|
1659
1690
|
if (writerGeneration < lastReconciledGeneration && !liveOAuthAccountKeys.has(oauthAccountKey(provider, accountId))) return;
|
|
1660
1691
|
await mutateStore(store => {
|
|
1661
1692
|
const account = store[provider]?.accounts.find(a => a.id === accountId);
|
|
@@ -1670,10 +1701,10 @@ export async function markAccountNeedsReauth(
|
|
|
1670
1701
|
}, [provider, accountId]);
|
|
1671
1702
|
}
|
|
1672
1703
|
|
|
1673
|
-
export async function mergeAccountCredential(provider:string,accountId:string,credential:OAuthCredentials,opts:{expectedGeneration?:string;afterPrePersistRead?:()=>void|Promise<void>;assertOwnership?: (store: AuthStore) => void;keepReauthMarkedAfterDispatch?:boolean}={}):Promise<{superseded:false}|{superseded:true;stored:OAuthCredentials}>{const safe=normalizeCredential(credential);if(!safe)throw new Error("Refusing to persist invalid OAuth credential");if(isAnthropicInstanceId(provider))assertAnthropicCredentialSource(provider,safe);return await mutateStore(async store=>{await opts.afterPrePersistRead?.();const account=store[provider]?.accounts.find(x=>x.id===accountId);if(!account)throw new Error(`OAuth account disappeared before persist: ${provider}`);if(opts.expectedGeneration!==undefined&&credentialGeneration(account.credential)!==opts.expectedGeneration)return{superseded:true,stored:account.credential};opts.assertOwnership?.(store);account.credential=safe;delete account.refreshAttentionGeneration;if(account.needsReauthReason!=="verify_account"&&!(opts.keepReauthMarkedAfterDispatch&&account.needsReauth)){delete account.needsReauth;delete account.needsReauthReason;}return{superseded:false};},[provider,accountId,safe,opts.expectedGeneration]);}
|
|
1704
|
+
export async function mergeAccountCredential(provider:string,accountId:string,credential:OAuthCredentials,opts:{expectedGeneration?:string;afterPrePersistRead?:()=>void|Promise<void>;assertOwnership?: (store: AuthStore) => void;keepReauthMarkedAfterDispatch?:boolean}={}):Promise<{superseded:false}|{superseded:true;stored:OAuthCredentials}>{provider=oauthCredentialSlot(provider);const safe=normalizeCredential(credential);if(!safe)throw new Error("Refusing to persist invalid OAuth credential");if(isAnthropicInstanceId(provider))assertAnthropicCredentialSource(provider,safe);return await mutateStore(async store=>{await opts.afterPrePersistRead?.();const account=store[provider]?.accounts.find(x=>x.id===accountId);if(!account)throw new Error(`OAuth account disappeared before persist: ${provider}`);if(opts.expectedGeneration!==undefined&&credentialGeneration(account.credential)!==opts.expectedGeneration)return{superseded:true,stored:account.credential};opts.assertOwnership?.(store);account.credential=safe;delete account.refreshAttentionGeneration;if(account.needsReauthReason!=="verify_account"&&!(opts.keepReauthMarkedAfterDispatch&&account.needsReauth)){delete account.needsReauth;delete account.needsReauthReason;}return{superseded:false};},[provider,accountId,safe,opts.expectedGeneration]);}
|
|
1674
1705
|
// A late refresh failure must not change an operator-paused account's health. Check under
|
|
1675
1706
|
// the mutation lock, not before awaiting it, so a concurrent pause cannot be overwritten.
|
|
1676
|
-
export async function markAccountNeedsReauthIfGeneration(provider:string,accountId:string,generation:string,writerGeneration=captureConfigGeneration(),reason?:"verify_account",isCurrent?:(store:AuthStore)=>boolean):Promise<boolean>{const key=oauthAccountKey(provider,accountId);if(writerGeneration<lastReconciledGeneration&&!liveOAuthAccountKeys.has(key))return false;return await mutateStore(store=>{const account=store[provider]?.accounts.find(x=>x.id===accountId);if(!account?.credential||account.paused||credentialGeneration(account.credential)!==generation)return false;if(writerGeneration<lastReconciledGeneration&&!liveOAuthAccountKeys.has(key))return false;if(isCurrent&&!isCurrent(store))return false;account.needsReauth=true;if(reason==="verify_account")account.needsReauthReason=reason;return true;},[provider,accountId,generation]);}
|
|
1707
|
+
export async function markAccountNeedsReauthIfGeneration(provider:string,accountId:string,generation:string,writerGeneration=captureConfigGeneration(),reason?:"verify_account",isCurrent?:(store:AuthStore)=>boolean):Promise<boolean>{provider=oauthCredentialSlot(provider);const key=oauthAccountKey(provider,accountId);if(writerGeneration<lastReconciledGeneration&&!liveOAuthAccountKeys.has(key))return false;return await mutateStore(store=>{const account=store[provider]?.accounts.find(x=>x.id===accountId);if(!account?.credential||account.paused||credentialGeneration(account.credential)!==generation)return false;if(writerGeneration<lastReconciledGeneration&&!liveOAuthAccountKeys.has(key))return false;if(isCurrent&&!isCurrent(store))return false;account.needsReauth=true;if(reason==="verify_account")account.needsReauthReason=reason;return true;},[provider,accountId,generation]);}
|
|
1677
1708
|
|
|
1678
1709
|
/** Attention is projected only; refresh selection continues to use the stored terminal flag. */
|
|
1679
1710
|
export function accountNeedsReauthForStatus(provider: string, account: ProviderAccount, now = Date.now()): boolean {
|
|
@@ -234,6 +234,8 @@ async function getAccountJson(path: string, options: AnthropicAccountRequestOpti
|
|
|
234
234
|
try {
|
|
235
235
|
response = await fetchImpl(`${options.origin ?? ANTHROPIC_API_ORIGIN}${path}`, {
|
|
236
236
|
method: "GET",
|
|
237
|
+
// A redirect must never carry the bearer to another host.
|
|
238
|
+
redirect: "error",
|
|
237
239
|
headers: accountHeaders(options.accessToken, false),
|
|
238
240
|
signal: readSignal(options.signal, READ_TIMEOUT_MS),
|
|
239
241
|
});
|
|
@@ -296,6 +298,8 @@ export async function claimAnthropicResetGrant(options: AnthropicResetClaimOptio
|
|
|
296
298
|
try {
|
|
297
299
|
response = await fetchImpl(url, {
|
|
298
300
|
method: "POST",
|
|
301
|
+
// A refused 307/308 lands in the unknown-outcome catch below instead of re-posting the claim.
|
|
302
|
+
redirect: "error",
|
|
299
303
|
headers: accountHeaders(options.accessToken, true),
|
|
300
304
|
body: JSON.stringify({
|
|
301
305
|
program: ANTHROPIC_RESET_GRANT_PROGRAM,
|
|
@@ -36,6 +36,8 @@ export interface AnthropicUsageProbe {
|
|
|
36
36
|
|
|
37
37
|
export async function probeAnthropicUsageQuota(accessToken: string): Promise<AnthropicUsageProbe> {
|
|
38
38
|
const response = await fetch("https://api.anthropic.com/api/oauth/usage", {
|
|
39
|
+
// Like the profile probe: a redirect must never carry the bearer to another host.
|
|
40
|
+
redirect: "error",
|
|
39
41
|
headers: {
|
|
40
42
|
Accept: "application/json, text/plain, */*",
|
|
41
43
|
"Content-Type": "application/json",
|
|
@@ -32,6 +32,9 @@ export const CODEBUDDY_GLOBAL_MODELS = [
|
|
|
32
32
|
"gpt-6.1-sol",
|
|
33
33
|
// 261027 preemptive: GPT-6.1 Terra (mirrors CodeBuddy's GPT-6.1 Sol seed; provider listing unverified).
|
|
34
34
|
"gpt-6.1-terra",
|
|
35
|
+
// 261118 preemptive: GPT-6.2 Sol and Astra (mirror CodeBuddy's GPT-6.1 Sol seed; provider listing unverified).
|
|
36
|
+
"gpt-6.2-sol",
|
|
37
|
+
"gpt-6.2-astra",
|
|
35
38
|
"gpt-5.5",
|
|
36
39
|
"gpt-5.4",
|
|
37
40
|
"gpt-5.3-codex",
|
|
@@ -85,6 +88,8 @@ export const CODEBUDDY_GLOBAL_MODEL_CONTEXT_WINDOWS: Record<string, number> = {
|
|
|
85
88
|
"gpt-6-luna": 1_000_000,
|
|
86
89
|
"gpt-6.1-sol": 1_000_000,
|
|
87
90
|
"gpt-6.1-terra": 1_000_000,
|
|
91
|
+
"gpt-6.2-sol": 1_000_000,
|
|
92
|
+
"gpt-6.2-astra": 1_000_000,
|
|
88
93
|
"gpt-5.5": 1_000_000,
|
|
89
94
|
"gpt-5.4": 272_000,
|
|
90
95
|
"gpt-5.3-codex": 272_000,
|
|
@@ -109,6 +114,8 @@ export const CODEBUDDY_GLOBAL_MODEL_MAX_OUTPUT_TOKENS: Record<string, number> =
|
|
|
109
114
|
"gpt-6-luna": 128_000,
|
|
110
115
|
"gpt-6.1-sol": 128_000,
|
|
111
116
|
"gpt-6.1-terra": 128_000,
|
|
117
|
+
"gpt-6.2-sol": 128_000,
|
|
118
|
+
"gpt-6.2-astra": 128_000,
|
|
112
119
|
"gpt-5.5": 72_000,
|
|
113
120
|
"gpt-5.4": 128_000,
|
|
114
121
|
"gpt-5.3-codex": 128_000,
|
|
@@ -129,6 +136,8 @@ export const CODEBUDDY_GLOBAL_MODEL_REASONING_EFFORTS: Record<string, string[]>
|
|
|
129
136
|
"gpt-6-luna": ["low", "medium", "high", "xhigh"],
|
|
130
137
|
"gpt-6.1-sol": ["low", "medium", "high", "xhigh"],
|
|
131
138
|
"gpt-6.1-terra": ["low", "medium", "high", "xhigh"],
|
|
139
|
+
"gpt-6.2-sol": ["low", "medium", "high", "xhigh"],
|
|
140
|
+
"gpt-6.2-astra": ["low", "medium", "high", "xhigh"],
|
|
132
141
|
"glm-5.3": ["low", "high", "max"],
|
|
133
142
|
"glm-5.2": ["high", "xhigh"],
|
|
134
143
|
};
|
|
@@ -141,6 +150,8 @@ export const CODEBUDDY_GLOBAL_MODEL_DEFAULT_REASONING_EFFORTS: Record<string, st
|
|
|
141
150
|
"gpt-6-luna": "high",
|
|
142
151
|
"gpt-6.1-sol": "high",
|
|
143
152
|
"gpt-6.1-terra": "high",
|
|
153
|
+
"gpt-6.2-sol": "high",
|
|
154
|
+
"gpt-6.2-astra": "high",
|
|
144
155
|
"glm-5.3": "high",
|
|
145
156
|
"glm-5.2": "high",
|
|
146
157
|
};
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
} from "../lib/gcp-adc";
|
|
9
9
|
import type { OcxProviderConfig } from "../types";
|
|
10
10
|
import { resolveProviderApiKey } from "./api-key-resolve";
|
|
11
|
+
import { googleVertexLocationConfigError } from "./google-vertex-location";
|
|
11
12
|
import { captureVertexAmbientKey } from "./vertex-environment-authority";
|
|
12
13
|
import { extractGoogleAiStudioModelItems } from "./google-ai-studio-model-discovery";
|
|
13
14
|
import {
|
|
@@ -33,6 +34,22 @@ const VERTEX_GENERATIVE_MODEL_ID = /^(?:gemini|gemma)-/i;
|
|
|
33
34
|
const VERTEX_NON_CHAT_SKU = /(?:^|-)embedding(?:-|$)|-tts(?:-|$)|-transcribe(?:-|$)|(?:^|-)live(?:-|$)/i;
|
|
34
35
|
const VERTEX_TRAILING_API_VERSION = /\/v1(?:beta1?)?$/i;
|
|
35
36
|
|
|
37
|
+
/** The same Google authorities inference constructs; a base URL never grants credential access. */
|
|
38
|
+
function vertexDiscoveryOrigin(value: string): string | undefined {
|
|
39
|
+
try {
|
|
40
|
+
const url = new URL(value);
|
|
41
|
+
if (url.protocol !== "https:" || url.username || url.password || url.port || url.hash) return undefined;
|
|
42
|
+
const host = "aiplatform.googleapis.com";
|
|
43
|
+
if (url.hostname === host) return url.origin;
|
|
44
|
+
const suffix = `-${host}`;
|
|
45
|
+
if (url.hostname.endsWith(suffix)
|
|
46
|
+
&& googleVertexLocationConfigError(url.hostname.slice(0, -suffix.length)) === null) return url.origin;
|
|
47
|
+
} catch {
|
|
48
|
+
// An invalid destination is unavailable discovery, without resolving a credential.
|
|
49
|
+
}
|
|
50
|
+
return undefined;
|
|
51
|
+
}
|
|
52
|
+
|
|
36
53
|
/** Time budget for one Vertex discovery: ADC token resolution, then every follow-up page. */
|
|
37
54
|
export const VERTEX_DISCOVERY_TIMEOUT_MS = 8_000;
|
|
38
55
|
/** Request ceiling for one listing, first page included (pageSize=300, so 1,500 rows). */
|
|
@@ -150,9 +167,10 @@ export function resolveObservedVertexDiscoveryToken(provider: OcxProviderConfig)
|
|
|
150
167
|
|
|
151
168
|
/** The passive gather's credential with its authority bound, for the same send-time checks. */
|
|
152
169
|
export function resolveObservedVertexDiscoveryAuth(provider: OcxProviderConfig): VertexDiscoveryAuth | undefined {
|
|
153
|
-
|
|
170
|
+
const origin = vertexDiscoveryOrigin(provider.baseUrl);
|
|
171
|
+
if (!origin || provider.authMode === "forward" || isVertexApiKeyPoolPaused(provider)) return undefined;
|
|
154
172
|
const selection = selectVertexDiscoveryCredential(provider);
|
|
155
|
-
return selection.kind === "api-key" ? apiKeyDiscoveryAuth(selection) : undefined;
|
|
173
|
+
return selection.kind === "api-key" ? apiKeyDiscoveryAuth(selection, origin) : undefined;
|
|
156
174
|
}
|
|
157
175
|
|
|
158
176
|
/**
|
|
@@ -175,10 +193,10 @@ function sameVertexSelection(left: VertexDiscoveryCredential, right: VertexDisco
|
|
|
175
193
|
* observed when it was read (`captureVertexAmbientKey`, the record inference binds), so an A→B→A
|
|
176
194
|
* change of the variable invalidates it even though the bytes match again.
|
|
177
195
|
*/
|
|
178
|
-
function apiKeyDiscoveryAuth(selection: { key: string | undefined; ambient?: true }): VertexDiscoveryAuth | undefined {
|
|
196
|
+
function apiKeyDiscoveryAuth(selection: { key: string | undefined; ambient?: true }, origin: string): VertexDiscoveryAuth | undefined {
|
|
179
197
|
if (!selection.key) return undefined;
|
|
180
198
|
const auth: VertexDiscoveryAuth = { token: selection.key, kind: "api-key" };
|
|
181
|
-
if (selection.ambient) bindVertexRequestAuthority(auth,
|
|
199
|
+
if (selection.ambient) bindVertexRequestAuthority(auth, origin, selection.key, { ambientKey: captureVertexAmbientKey(selection.key) });
|
|
182
200
|
return auth;
|
|
183
201
|
}
|
|
184
202
|
|
|
@@ -199,9 +217,10 @@ export async function resolveVertexDiscoveryAuth(
|
|
|
199
217
|
signal: AbortSignal = vertexDiscoveryDeadline(),
|
|
200
218
|
options: { forceExchange?: boolean } = {},
|
|
201
219
|
): Promise<VertexDiscoveryAuth | undefined> {
|
|
202
|
-
|
|
220
|
+
const origin = vertexDiscoveryOrigin(provider.baseUrl);
|
|
221
|
+
if (!origin || provider.authMode === "forward" || isVertexApiKeyPoolPaused(provider)) return undefined;
|
|
203
222
|
const selection = selectVertexDiscoveryCredential(provider);
|
|
204
|
-
if (selection.kind === "api-key") return apiKeyDiscoveryAuth(selection);
|
|
223
|
+
if (selection.kind === "api-key") return apiKeyDiscoveryAuth(selection, origin);
|
|
205
224
|
let authority: Awaited<ReturnType<typeof getVertexAccessTokenWithAuthority>>;
|
|
206
225
|
try {
|
|
207
226
|
const markerAccount = gcpCredentialMarkerAccount(selection.marker);
|
|
@@ -213,9 +232,10 @@ export async function resolveVertexDiscoveryAuth(
|
|
|
213
232
|
} catch {
|
|
214
233
|
return undefined;
|
|
215
234
|
}
|
|
216
|
-
if (
|
|
235
|
+
if (origin !== vertexDiscoveryOrigin(provider.baseUrl)
|
|
236
|
+
|| !sameVertexSelection(selection, selectVertexDiscoveryCredential(provider))) return undefined;
|
|
217
237
|
const auth: VertexDiscoveryAuth = { token: authority.token, kind: "adc", ...(selection.marker ? { marker: selection.marker } : {}) };
|
|
218
|
-
bindVertexRequestAuthority(auth,
|
|
238
|
+
bindVertexRequestAuthority(auth, origin, `Bearer ${authority.token}`, {
|
|
219
239
|
source: authority.source,
|
|
220
240
|
generation: authority.generation,
|
|
221
241
|
...(authority.markerAccount ? { markerAccount: authority.markerAccount } : {}),
|
|
@@ -232,7 +252,8 @@ export async function resolveVertexDiscoveryToken(
|
|
|
232
252
|
}
|
|
233
253
|
|
|
234
254
|
/**
|
|
235
|
-
* Send-time check, run before every discovery request (`beforeSend`): the
|
|
255
|
+
* Send-time check, run before every discovery request (`beforeSend`): the actual URL stays on the
|
|
256
|
+
* approved Google origin, and the row still selects the
|
|
236
257
|
* credential this token came from, an ADC token's source and generation are still current (the
|
|
237
258
|
* check inference runs before dispatch), and the outgoing headers carry it in that scheme's header
|
|
238
259
|
* and not the other one. Any change cancels the send, first page and follow-up pages alike, so a
|
|
@@ -242,11 +263,14 @@ export function vertexDiscoveryAuthIsCurrent(
|
|
|
242
263
|
provider: OcxProviderConfig,
|
|
243
264
|
auth: VertexDiscoveryAuth,
|
|
244
265
|
headers: Record<string, string>,
|
|
266
|
+
url: string,
|
|
245
267
|
): boolean {
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
268
|
+
const origin = vertexDiscoveryOrigin(provider.baseUrl);
|
|
269
|
+
if (!origin || vertexDiscoveryOrigin(url) !== origin
|
|
270
|
+
|| provider.authMode === "forward" || isVertexApiKeyPoolPaused(provider)) return false;
|
|
271
|
+
// Recheck ADC source/generation and the ambient-key generation after destination admission,
|
|
272
|
+
// before comparing the current selection, exactly as inference checks them.
|
|
273
|
+
if (!vertexRequestAuthorityIsCurrent(auth, origin)) return false;
|
|
250
274
|
const current = selectVertexDiscoveryCredential(provider);
|
|
251
275
|
const issued: VertexDiscoveryCredential = auth.kind === "api-key"
|
|
252
276
|
? { kind: "api-key", key: auth.token }
|
|
@@ -273,6 +297,11 @@ export function buildVertexModelsDiscoveryRequest(
|
|
|
273
297
|
resolveUrl: (defaultUrl: string) => string,
|
|
274
298
|
): { url: string; headers: Record<string, string> } {
|
|
275
299
|
const base = effectiveProvider.baseUrl.replace(/\/+$/, "").replace(VERTEX_TRAILING_API_VERSION, "");
|
|
300
|
+
// Keep a credential-free request available for catalog capture/fallback, but never attach
|
|
301
|
+
// a Google credential to a destination outside the origin admitted before resolution.
|
|
302
|
+
const url = resolveUrl(`${base}/v1beta1/publishers/google/models?pageSize=300`);
|
|
303
|
+
const origin = vertexDiscoveryOrigin(effectiveProvider.baseUrl);
|
|
304
|
+
if (!origin || vertexDiscoveryOrigin(url) !== origin) return { url, headers };
|
|
276
305
|
if (usesVertexApiKeyForDiscovery(effectiveProvider)) {
|
|
277
306
|
if (apiKey) headers["x-goog-api-key"] = apiKey;
|
|
278
307
|
} else {
|
|
@@ -287,7 +316,7 @@ export function buildVertexModelsDiscoveryRequest(
|
|
|
287
316
|
// Vertex ModelGardenService.ListPublisherModels enforces a maximum pageSize of 300
|
|
288
317
|
// (values > 300 return HTTP 400 INVALID_ARGUMENT); later pages follow nextPageToken.
|
|
289
318
|
return {
|
|
290
|
-
url
|
|
319
|
+
url,
|
|
291
320
|
headers,
|
|
292
321
|
};
|
|
293
322
|
}
|
|
@@ -12,6 +12,9 @@ export const KIRO_MODELS = [
|
|
|
12
12
|
"gpt-6.1-sol",
|
|
13
13
|
// 261027 preemptive: GPT-6.1 Terra (mirrors Kiro's GPT-6.1 Sol seed; provider listing unverified).
|
|
14
14
|
"gpt-6.1-terra",
|
|
15
|
+
// 261118 preemptive: GPT-6.2 Sol and Astra (mirror Kiro's GPT-6.1 Sol seed; provider listing unverified).
|
|
16
|
+
"gpt-6.2-sol",
|
|
17
|
+
"gpt-6.2-astra",
|
|
15
18
|
// Listed on kiro.dev/docs/models (2026-10-24).
|
|
16
19
|
"claude-sonnet-5.5",
|
|
17
20
|
"claude-sonnet-5",
|
|
@@ -47,6 +50,8 @@ export const KIRO_MODEL_CONTEXT_WINDOWS: Record<string, number> = {
|
|
|
47
50
|
"gpt-6-luna": 272_000,
|
|
48
51
|
"gpt-6.1-sol": 272_000,
|
|
49
52
|
"gpt-6.1-terra": 272_000,
|
|
53
|
+
"gpt-6.2-sol": 272_000,
|
|
54
|
+
"gpt-6.2-astra": 272_000,
|
|
50
55
|
"claude-sonnet-5.5": 1_000_000,
|
|
51
56
|
"claude-sonnet-5": 1_000_000,
|
|
52
57
|
"claude-opus-5.5": 1_000_000,
|
|
@@ -277,7 +277,7 @@ export const PROVIDER_REGISTRY_CORE: readonly ProviderRegistryEntry[] = [
|
|
|
277
277
|
// only the old devin entry carried. Degraded-mode seed only either way —
|
|
278
278
|
// `liveModels` discovers the account's real roster.
|
|
279
279
|
// 261027 preemptive: GPT-6.1 Terra (same degraded seed policy as GPT-6.1 Sol).
|
|
280
|
-
models: ["swe-2", "swe-1-7", "gpt-5-6-sol", "gpt-6-astra", "gpt-6-1-sol", "gpt-6-1-terra", "gpt-6-sol", "gpt-6-luna", "claude-opus-5-5", "claude-opus-5", "claude-fable-5-2", "claude-fable-5-1", "claude-sonnet-5-5", "claude-haiku-5-5", "claude-sonnet-5", "glm-5-3", "kimi-k3", "gemini-3-8-flash", "grok-4-6", "grok-4-7", "swe-1-7-lightning", "gpt-5-6-luna", "gpt-5-6-terra", "claude-opus-4-8", "glm-5-2", "kimi-k2-7", "grok-4-5"],
|
|
280
|
+
models: ["swe-2", "swe-1-7", "gpt-5-6-sol", "gpt-6-astra", "gpt-6-2-sol", "gpt-6-2-astra", "gpt-6-1-sol", "gpt-6-1-terra", "gpt-6-sol", "gpt-6-luna", "claude-opus-5-5", "claude-opus-5", "claude-fable-5-2", "claude-fable-5-1", "claude-sonnet-5-5", "claude-haiku-5-5", "claude-sonnet-5", "glm-5-3", "kimi-k3", "gemini-3-8-flash", "grok-4-6", "grok-4-7", "swe-1-7-lightning", "gpt-5-6-luna", "gpt-5-6-terra", "claude-opus-4-8", "glm-5-2", "kimi-k2-7", "grok-4-5"],
|
|
281
281
|
liveModels: true,
|
|
282
282
|
defaultModel: "swe-2",
|
|
283
283
|
modelContextWindows: DEVIN_MODEL_CONTEXT_WINDOWS,
|
|
@@ -672,8 +672,11 @@ export const PROVIDER_REGISTRY_CORE: readonly ProviderRegistryEntry[] = [
|
|
|
672
672
|
// its matching result (#4726); the flag is live on this wire.
|
|
673
673
|
requiresAdjacentResponsesToolResults: true,
|
|
674
674
|
featured: false,
|
|
675
|
-
//
|
|
676
|
-
//
|
|
675
|
+
// Listed in the add-provider picker (#8087). It is not an OAUTH_PROVIDERS login, so the
|
|
676
|
+
// Accounts tab still draws Kimi once; the row signs in through src/oauth/credential-siblings.ts.
|
|
677
|
+
dashboardPreset: true,
|
|
678
|
+
// Shares the kimi OAuth account: OAUTH_CREDENTIAL_SIBLINGS maps this row to the kimi
|
|
679
|
+
// auth-store slot, so adding this preset after logging into kimi needs no second login.
|
|
677
680
|
oauthId: "kimi",
|
|
678
681
|
jawcodeBundle: "moonshot",
|
|
679
682
|
note: "Same Kimi account login, routed over the OpenAI Responses wire. Thinking content stays encrypted server-side; tool calls and results stay visible. Chat wire remains the default preset for transparency.",
|
|
@@ -1127,6 +1130,9 @@ export const PROVIDER_REGISTRY_CORE: readonly ProviderRegistryEntry[] = [
|
|
|
1127
1130
|
// Listed 2026-09-29 as an OpenAI-backed route like GPT-6 Sol.
|
|
1128
1131
|
"openai/gpt-6.1-sol": true,
|
|
1129
1132
|
"openai/gpt-6.1-terra": true,
|
|
1133
|
+
// Listed 2026-11-18 as OpenAI-backed routes like GPT-6.1 Sol.
|
|
1134
|
+
"openai/gpt-6.2-sol": true,
|
|
1135
|
+
"openai/gpt-6.2-astra": true,
|
|
1130
1136
|
},
|
|
1131
1137
|
// Deliberately no OpenRouter route pin: it bills the endpoint actually used and reports the
|
|
1132
1138
|
// actual service_tier. B0 confirmation therefore owns downgrade safety. Forcing `only` plus
|