@bitkyc08/opencodex 2.55.0-preview.20260914 → 2.56.0
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/{index-DH2PUHqr.js → index-D4zuyIxQ.js} +1 -1
- package/gui/dist/index.html +1 -1
- package/package.json +2 -1
- package/src/adapters/base.ts +21 -0
- package/src/adapters/cursor/transport-retry.ts +46 -1
- package/src/adapters/cursor.ts +4 -0
- package/src/adapters/kiro/adapter.ts +42 -1
- package/src/adapters/kiro-retry.ts +23 -4
- package/src/adapters/openai-chat/errors.ts +116 -0
- package/src/adapters/openai-chat/messages.ts +346 -0
- package/src/adapters/openai-chat/passthrough.ts +146 -0
- package/src/adapters/openai-chat/response-events.ts +117 -0
- package/src/adapters/openai-chat/tool-call-validation.ts +200 -0
- package/src/adapters/openai-chat/tool-schema.ts +477 -0
- package/src/adapters/openai-chat/wire.ts +50 -0
- package/src/adapters/openai-chat.ts +33 -1445
- package/src/adapters/openai-responses/canonical-forward.ts +202 -0
- package/src/adapters/openai-responses/image-gen.ts +406 -0
- package/src/adapters/openai-responses/internal.ts +3 -0
- package/src/adapters/openai-responses/passthrough.ts +611 -0
- package/src/adapters/openai-responses/prompt-cache.ts +83 -0
- package/src/adapters/openai-responses/reasoning.ts +220 -0
- package/src/adapters/openai-responses/request-strips.ts +185 -0
- package/src/adapters/openai-responses/tool-output-recovery.ts +509 -0
- package/src/adapters/openai-responses/tool-schema.ts +293 -0
- package/src/adapters/openai-responses/web-search.ts +156 -0
- package/src/adapters/openai-responses.ts +4 -2625
- package/src/bridge/errors.ts +34 -0
- package/src/bridge/internal.ts +174 -0
- package/src/bridge/response-json.ts +624 -0
- package/src/bridge/sse.ts +1444 -0
- package/src/bridge.ts +5 -2204
- package/src/chat/inbound.ts +12 -1
- package/src/codex/account-lifecycle.ts +3 -0
- package/src/codex/account-store.ts +71 -9
- package/src/codex/auth-api/account-list.ts +507 -0
- package/src/codex/auth-api/http.ts +32 -0
- package/src/codex/auth-api/login-flow.ts +554 -0
- package/src/codex/auth-api/login-state.ts +64 -0
- package/src/codex/auth-api/main-account-probe.ts +331 -0
- package/src/codex/auth-api/pool-mode-gate.ts +274 -0
- package/src/codex/auth-api/pool-quota-probe.ts +512 -0
- package/src/codex/auth-api/reset-credit-service.ts +422 -0
- package/src/codex/auth-api/routes.ts +425 -0
- package/src/codex/auth-api/runtime-config.ts +48 -0
- package/src/codex/auth-api.ts +27 -3118
- package/src/codex/auth-context.ts +95 -28
- package/src/codex/catalog/auto-review.ts +507 -0
- package/src/codex/catalog/build-entries.ts +981 -0
- package/src/codex/catalog/combo-member.ts +375 -0
- package/src/codex/catalog/derive-entry.ts +229 -0
- package/src/codex/catalog/effort.ts +0 -1
- package/src/codex/catalog/gated-native-warn.ts +63 -0
- package/src/codex/catalog/gather-capture.ts +533 -0
- package/src/codex/catalog/model-hints.ts +691 -0
- package/src/codex/catalog/model-visibility.ts +304 -0
- package/src/codex/catalog/provider-fetch.ts +52 -2942
- package/src/codex/catalog/provider-models.ts +685 -0
- package/src/codex/catalog/restore.ts +132 -0
- package/src/codex/catalog/retained-sync.ts +706 -0
- package/src/codex/catalog/routed-gather.ts +858 -0
- package/src/codex/catalog/subagent-roster.ts +176 -0
- package/src/codex/catalog/sync.ts +52 -2698
- package/src/codex/inject/config-toml.ts +563 -0
- package/src/codex/inject/remove.ts +192 -0
- package/src/codex/inject/restore.ts +540 -0
- package/src/codex/inject/routing-classify.ts +109 -0
- package/src/codex/inject/routing-target.ts +125 -0
- package/src/codex/inject.ts +81 -1436
- package/src/codex/lineage.ts +458 -0
- package/src/codex/pool-refresh-backoff.ts +152 -0
- package/src/codex/routing/active-account.ts +194 -0
- package/src/codex/routing/cooldown-math.ts +275 -0
- package/src/codex/routing/health-store.ts +402 -0
- package/src/codex/routing/probe-lease.ts +358 -0
- package/src/codex/routing/selection.ts +703 -0
- package/src/codex/routing/thread-affinity.ts +538 -0
- package/src/codex/routing.ts +353 -2234
- package/src/codex/shim-fingerprint.ts +223 -0
- package/src/codex/shim-inspect.ts +175 -0
- package/src/codex/shim-probe.ts +367 -0
- package/src/codex/shim-restore-lock.ts +169 -0
- package/src/codex/shim-state-file.ts +151 -0
- package/src/codex/shim-templates.ts +265 -0
- package/src/codex/shim.ts +48 -1268
- package/src/config/diagnostics.ts +705 -0
- package/src/config/feature-flags.ts +55 -0
- package/src/config/live-reconcile.ts +403 -0
- package/src/config/load-degrade.ts +880 -0
- package/src/config/mutation-lock.ts +244 -0
- package/src/config/openai-tier-backup.ts +268 -0
- package/src/config/persist-unlocked.ts +92 -0
- package/src/config/proxy-env.ts +188 -0
- package/src/config/salvage.ts +244 -0
- package/src/config/schema/config-schema.ts +640 -0
- package/src/config/schema/leaf-validators.ts +855 -0
- package/src/config/warn-memo.ts +28 -0
- package/src/config.ts +234 -4481
- package/src/generated/compatibility-version.json +539 -39
- package/src/lib/request-execution-budget.ts +69 -20
- package/src/lib/spend-reservation-ledger.ts +940 -0
- package/src/lib/upstream-retry.ts +55 -11
- package/src/lib/workflow-budget.ts +553 -30
- package/src/providers/quota/account-cache.ts +441 -0
- package/src/providers/quota/antigravity.ts +295 -0
- package/src/providers/quota/report-cache.ts +320 -0
- package/src/providers/quota/vendor-probes-key.ts +1243 -0
- package/src/providers/quota/vendor-probes-oauth.ts +590 -0
- package/src/providers/quota.ts +324 -3079
- package/src/providers/registry/entries-core.ts +1221 -0
- package/src/providers/registry/entries-extended.ts +1204 -0
- package/src/providers/registry/model-seeds.ts +908 -0
- package/src/providers/registry/types.ts +352 -0
- package/src/providers/registry.ts +24 -3536
- package/src/responses/continuation-ownership.ts +29 -0
- package/src/responses/state/replay-fingerprint.ts +80 -0
- package/src/responses/state/snapshot-codec.ts +104 -0
- package/src/responses/state/spill-failure.ts +118 -0
- package/src/responses/state/spill-queue.ts +665 -0
- package/src/responses/state/temp-recovery.ts +257 -0
- package/src/responses/state.ts +82 -1143
- package/src/routing/identity-domains.ts +449 -0
- package/src/routing/probe-lease.ts +511 -0
- package/src/server/index/bounded-request.ts +88 -0
- package/src/server/index/live-sideband.ts +565 -0
- package/src/server/index/serve-options.ts +1766 -0
- package/src/server/index/startup-warnings.ts +213 -0
- package/src/server/index/websocket-handler.ts +335 -0
- package/src/server/index.ts +40 -2547
- package/src/server/management/route-registry.ts +26 -23
- package/src/server/management/shared.ts +8 -5
- package/src/server/management/workflow-budget-routes.ts +133 -0
- package/src/server/management-api.ts +12 -0
- package/src/server/request-log-conversation.ts +9 -7
- package/src/server/request-log.ts +245 -1
- package/src/server/responses/account-change-state.ts +233 -0
- package/src/server/responses/adapter-continuation.ts +514 -0
- package/src/server/responses/adapter-delivery.ts +214 -0
- package/src/server/responses/adapter-dispatch.ts +971 -0
- package/src/server/responses/compact.ts +59 -4
- package/src/server/responses/completion-policy.ts +33 -0
- package/src/server/responses/core-auth.ts +527 -0
- package/src/server/responses/core-codex-account.ts +859 -0
- package/src/server/responses/core-combo-failure.ts +210 -0
- package/src/server/responses/core-combo.ts +707 -0
- package/src/server/responses/core-errors.ts +152 -0
- package/src/server/responses/core-lifetime.ts +95 -0
- package/src/server/responses/core-normalize.ts +350 -0
- package/src/server/responses/core-opaque-recovery.ts +380 -0
- package/src/server/responses/core-options.ts +159 -0
- package/src/server/responses/core-replay.ts +225 -0
- package/src/server/responses/core.ts +192 -8893
- package/src/server/responses/passthrough-delivery.ts +856 -0
- package/src/server/responses/passthrough-dispatch.ts +1476 -0
- package/src/server/responses/passthrough-execution.ts +54 -0
- package/src/server/responses/request-prepare.ts +970 -0
- package/src/server/responses/request-send-budget.ts +164 -0
- package/src/server/responses/request-sidecar-auth.ts +149 -0
- package/src/server/responses/request-transport.ts +744 -0
- package/src/server/responses/response-effects.ts +157 -0
- package/src/server/responses/run-turn-execution.ts +448 -0
- package/src/server/responses/sidecar-execution.ts +469 -0
- package/src/server/responses-image-gen-repair.ts +1 -1
- package/src/server/workflow-refusal.ts +84 -0
- package/src/types/config.ts +30 -0
- package/src/usage/log.ts +146 -0
- package/src/usage/summary.ts +171 -21
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
import type { CodexAccountMode, FastWire, OcxProviderConfig } from "../../types";
|
|
2
|
+
import type { ProviderBaseUrlChoice } from "../base-url-choices";
|
|
3
|
+
|
|
4
|
+
export type ProviderAuthKind = "forward" | "oauth" | "key" | "local";
|
|
5
|
+
export type MetadataModelIdNormalize = "case-insensitive";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Wire protocol a client spoke when it reached the proxy. Chat and Anthropic surfaces
|
|
9
|
+
* translate into a Responses-shaped body and replay through `handleResponses`, so the
|
|
10
|
+
* original inbound has to travel with the request or the replay looks native.
|
|
11
|
+
*/
|
|
12
|
+
export type InboundWire = "responses" | "chat" | "anthropic";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* A per-model wire default: a bare string applies to every inbound, while the object
|
|
16
|
+
* form may scope the default to listed inbound protocols and authentication modes.
|
|
17
|
+
*/
|
|
18
|
+
export type ModelWireDefault = string | {
|
|
19
|
+
wire: string;
|
|
20
|
+
inbound: readonly InboundWire[];
|
|
21
|
+
authModes?: readonly ProviderAuthKind[];
|
|
22
|
+
/** Whether this registry-selected route may relay a caller-owned service_tier. */
|
|
23
|
+
forwardCallerServiceTier?: boolean;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export interface ResponsesTerminalRepairPolicy {
|
|
27
|
+
/** Quiet time after a structurally complete output graph before synthesizing completion. */
|
|
28
|
+
graceMs: number;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export type ProviderModelDiscoveryScalar = string | number | boolean;
|
|
32
|
+
|
|
33
|
+
export type ProviderModelDiscoveryPredicate =
|
|
34
|
+
| {
|
|
35
|
+
path: readonly string[];
|
|
36
|
+
equalsAny: readonly ProviderModelDiscoveryScalar[];
|
|
37
|
+
caseInsensitive?: boolean;
|
|
38
|
+
}
|
|
39
|
+
| {
|
|
40
|
+
path: readonly string[];
|
|
41
|
+
/**
|
|
42
|
+
* A string-valued upstream target uses substring matching; an array-valued target uses
|
|
43
|
+
* exact element matching. Use `equalsAny` when the string must match in full.
|
|
44
|
+
*/
|
|
45
|
+
containsAny: readonly ProviderModelDiscoveryScalar[];
|
|
46
|
+
caseInsensitive?: boolean;
|
|
47
|
+
}
|
|
48
|
+
| {
|
|
49
|
+
path: readonly string[];
|
|
50
|
+
/** Uses the same string-substring and array-element semantics as `containsAny`. */
|
|
51
|
+
containsAll: readonly ProviderModelDiscoveryScalar[];
|
|
52
|
+
caseInsensitive?: boolean;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export interface ProviderModelDiscoveryFilter {
|
|
56
|
+
/** Every predicate must match. */
|
|
57
|
+
allOf?: readonly ProviderModelDiscoveryPredicate[];
|
|
58
|
+
/** At least one predicate must match. */
|
|
59
|
+
anyOf?: readonly ProviderModelDiscoveryPredicate[];
|
|
60
|
+
/** No predicate may match. */
|
|
61
|
+
noneOf?: readonly ProviderModelDiscoveryPredicate[];
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
interface ProviderModelDiscoverySharedSpec {
|
|
65
|
+
/** Query parameters applied to the resolved discovery URL. */
|
|
66
|
+
query?: Readonly<Record<string, string>>;
|
|
67
|
+
/** Declarative eligibility rules evaluated against each untrusted model row. */
|
|
68
|
+
filter?: ProviderModelDiscoveryFilter;
|
|
69
|
+
/** Optional lower byte ceiling; the process-wide hard ceiling still wins. */
|
|
70
|
+
maxResponseBytes?: number;
|
|
71
|
+
/** Optional lower raw-row ceiling; the process-wide hard ceiling still wins. */
|
|
72
|
+
maxModels?: number;
|
|
73
|
+
/**
|
|
74
|
+
* If a valid extracted id starts with this prefix, strip it and re-validate the remainder.
|
|
75
|
+
* Empty/invalid remainders skip that row only.
|
|
76
|
+
*/
|
|
77
|
+
stripIdPrefix?: string;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
type ProviderModelDiscoveryLocation =
|
|
81
|
+
| {
|
|
82
|
+
/** Registry-owned absolute endpoint. Mutually exclusive with `path`. */
|
|
83
|
+
url: string;
|
|
84
|
+
path?: never;
|
|
85
|
+
}
|
|
86
|
+
| {
|
|
87
|
+
/** Resource path relative to baseUrl; query strings and fragments are disallowed. */
|
|
88
|
+
path: string;
|
|
89
|
+
url?: never;
|
|
90
|
+
}
|
|
91
|
+
| {
|
|
92
|
+
/** Keep the adapter-derived default discovery endpoint. */
|
|
93
|
+
url?: never;
|
|
94
|
+
path?: never;
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Trusted live-model discovery policy. This metadata is registry-only: it must never be copied
|
|
99
|
+
* into config.json, where a same-named custom provider could otherwise redirect a stored key.
|
|
100
|
+
*/
|
|
101
|
+
export type ProviderModelDiscoverySpec = ProviderModelDiscoverySharedSpec & ProviderModelDiscoveryLocation;
|
|
102
|
+
|
|
103
|
+
export interface ProviderRegistryEntry {
|
|
104
|
+
id: string;
|
|
105
|
+
label: string;
|
|
106
|
+
adapter: string;
|
|
107
|
+
baseUrl: string;
|
|
108
|
+
apiKeyTransport?: OcxProviderConfig["apiKeyTransport"];
|
|
109
|
+
alias?: string;
|
|
110
|
+
authKind: ProviderAuthKind;
|
|
111
|
+
codexAccountMode?: CodexAccountMode;
|
|
112
|
+
/** OAuth preset may explicitly honor a persisted API-key billing mode. */
|
|
113
|
+
allowKeyAuthOverride?: boolean;
|
|
114
|
+
allowPrivateNetworkByDefault?: boolean;
|
|
115
|
+
keyOptional?: boolean;
|
|
116
|
+
/**
|
|
117
|
+
* Registry-only key-login policy for public model catalogs that cannot authenticate a key.
|
|
118
|
+
* The dashboard flow then reports the key as unverifiable instead of a false positive.
|
|
119
|
+
*/
|
|
120
|
+
apiKeyValidation?: "unknown";
|
|
121
|
+
/**
|
|
122
|
+
* Free-tier pricing (no paid subscription required). Distinct from `keyOptional`:
|
|
123
|
+
* free tiers may still require an API key (e.g. NVIDIA NIM free credits).
|
|
124
|
+
*/
|
|
125
|
+
freeTier?: boolean;
|
|
126
|
+
allowBaseUrlOverride?: boolean;
|
|
127
|
+
/**
|
|
128
|
+
* Do not claim an existing same-named key provider whose fixed destination differs from this
|
|
129
|
+
* preset. Enable for newly promoted ids so an older custom key cannot be silently retargeted.
|
|
130
|
+
*/
|
|
131
|
+
preserveCustomDestination?: boolean;
|
|
132
|
+
/**
|
|
133
|
+
* Optional endpoint picker for providers with multiple official hosts
|
|
134
|
+
* (e.g. Qwen Cloud token plan vs pay-as-you-go). Requires `allowBaseUrlOverride`
|
|
135
|
+
* so the selected URL is honored at route time. A choice without `baseUrl` is "Custom".
|
|
136
|
+
*/
|
|
137
|
+
baseUrlChoices?: readonly ProviderBaseUrlChoice[];
|
|
138
|
+
/** Static headers merged into every upstream request for this provider. */
|
|
139
|
+
staticHeaders?: Record<string, string>;
|
|
140
|
+
modelSuffixBracketStrip?: boolean;
|
|
141
|
+
featured?: boolean;
|
|
142
|
+
/**
|
|
143
|
+
* Paid provider sponsorship under SPONSORS.md. `main` is reserved for model developers,
|
|
144
|
+
* `standard` for relays and gateways. The picker pins sponsor rows first (alphabetical among
|
|
145
|
+
* themselves) and labels them; nothing else reads this field. Routing, failover, quota, and
|
|
146
|
+
* defaults never consult it — that boundary is what SPONSORS.md promises users.
|
|
147
|
+
*/
|
|
148
|
+
sponsor?: { tier: "main" | "standard"; url: string };
|
|
149
|
+
dashboardPreset?: boolean;
|
|
150
|
+
note?: string;
|
|
151
|
+
dashboardUrl?: string;
|
|
152
|
+
defaultModel?: string;
|
|
153
|
+
models?: string[];
|
|
154
|
+
liveModels?: boolean;
|
|
155
|
+
/**
|
|
156
|
+
* Registry-only per-model wire defaults for mixed OpenAI-compatible gateways.
|
|
157
|
+
* These are intentionally not seeded into saved config: an explicit `modelAdapters`
|
|
158
|
+
* entry must remain distinguishable and must always win over a default.
|
|
159
|
+
*
|
|
160
|
+
* A bare string applies to every inbound protocol. The object form scopes the
|
|
161
|
+
* default to the inbound surfaces named in `inbound`, which is how a model that is
|
|
162
|
+
* native on two wires can serve each client on the wire it already speaks instead
|
|
163
|
+
* of paying a translation hop.
|
|
164
|
+
*/
|
|
165
|
+
modelWireDefaults?: Record<string, ModelWireDefault>;
|
|
166
|
+
/** Explicit Fast wire declaration; absence derives from the final model adapter. */
|
|
167
|
+
fastWire?: FastWire | null;
|
|
168
|
+
/**
|
|
169
|
+
* Registry-only per-model override for the upstream request shape used behind a
|
|
170
|
+
* Codex Responses WebSocket turn. `false` keeps the client-facing WebSocket but
|
|
171
|
+
* asks the upstream Responses endpoint for bounded JSON, which the bridge then
|
|
172
|
+
* reframes as Responses events. Use only for upstreams whose streaming response
|
|
173
|
+
* can omit or indefinitely delay the terminal event.
|
|
174
|
+
*/
|
|
175
|
+
modelResponsesUpstreamStreaming?: Record<string, boolean>;
|
|
176
|
+
/** Registry-only repair for a model whose native Responses stream may omit its terminal. */
|
|
177
|
+
modelResponsesTerminalRepair?: Record<string, ResponsesTerminalRepairPolicy>;
|
|
178
|
+
/**
|
|
179
|
+
* Registry-only client-facing item-id repair policy (#938), filled onto the
|
|
180
|
+
* runtime provider only when the user has no explicit policy (derive.ts);
|
|
181
|
+
* never seeded into saved config.
|
|
182
|
+
*/
|
|
183
|
+
responsesItemIdRepair?: {
|
|
184
|
+
message?: string[];
|
|
185
|
+
reasoning?: string[];
|
|
186
|
+
repairMissingTerminalIds?: boolean;
|
|
187
|
+
repairInvalidIds?: boolean;
|
|
188
|
+
};
|
|
189
|
+
/**
|
|
190
|
+
* Responses-API resource path for providers whose route is not `/v1/responses`.
|
|
191
|
+
* Unlike `modelWireDefaults` above, this IS seeded into saved config: it describes
|
|
192
|
+
* the provider's fixed endpoint rather than a default a user might want to override
|
|
193
|
+
* per model. DeepSeek documents `POST /responses` with no `/v1` segment.
|
|
194
|
+
*/
|
|
195
|
+
responsesPath?: string;
|
|
196
|
+
/**
|
|
197
|
+
* Relative send path for the `openai-chat` wire, seeded into saved config exactly like
|
|
198
|
+
* `responsesPath`. Needed when one upstream serves both wires under different prefixes,
|
|
199
|
+
* because a per-model wire override changes the adapter and not the base URL.
|
|
200
|
+
*/
|
|
201
|
+
chatCompletionsPath?: string;
|
|
202
|
+
/**
|
|
203
|
+
* Endpoints this entry used to live at, kept so a saved custom provider that still points
|
|
204
|
+
* at one keeps receiving this row's metadata through `registryEntryForProviderDestination`.
|
|
205
|
+
* Destination matching is by adapter plus normalized base URL, so moving a row's wire or
|
|
206
|
+
* prefix would otherwise orphan every config a user wrote against the old address.
|
|
207
|
+
*/
|
|
208
|
+
destinationAliases?: readonly { readonly baseUrl: string; readonly adapter: string }[];
|
|
209
|
+
/**
|
|
210
|
+
* Responses upstream that stores nothing server-side. Stateful request parameters
|
|
211
|
+
* are dropped and `store` is pinned false, and orphaned tool results left by a
|
|
212
|
+
* replay miss are repaired rather than forwarded.
|
|
213
|
+
*/
|
|
214
|
+
statelessResponses?: boolean;
|
|
215
|
+
/**
|
|
216
|
+
* Responses parser requires an unambiguous call batch and its matched result batch
|
|
217
|
+
* to stay contiguous. This is seeded/backfilled like other fixed wire capabilities.
|
|
218
|
+
*/
|
|
219
|
+
requiresAdjacentResponsesToolResults?: boolean;
|
|
220
|
+
/**
|
|
221
|
+
* When enabled, tool results that are present but empty are annotated on the wire.
|
|
222
|
+
* Seeded/backfilled like other fixed wire capabilities.
|
|
223
|
+
*/
|
|
224
|
+
annotateEmptyToolOutputs?: boolean;
|
|
225
|
+
/**
|
|
226
|
+
* Registry default for the provider's `service_tier` support; see
|
|
227
|
+
* `OcxProviderConfig.supportsServiceTier`. Registry-only: backfilled (never
|
|
228
|
+
* overriding) at enrich/route time and deliberately NOT seeded into saved
|
|
229
|
+
* config, so an explicit user value stays distinguishable from the default
|
|
230
|
+
* (and the canonical openai seed comparison keeps its exact key set).
|
|
231
|
+
*/
|
|
232
|
+
supportsServiceTier?: boolean;
|
|
233
|
+
/** Registry default for OpenAI extended hosted web_search field support. */
|
|
234
|
+
supportsOpenAiWebSearchToolFields?: boolean;
|
|
235
|
+
/** Registry default for native Responses custom-tool support. */
|
|
236
|
+
supportsResponsesCustomTools?: boolean;
|
|
237
|
+
/** Registry default for exact model service-tier capability; explicit config keys win. */
|
|
238
|
+
modelSupportsServiceTier?: Record<string, boolean>;
|
|
239
|
+
/**
|
|
240
|
+
* Registry-only service-tier defaults for an OAuth preset's explicit API-key transport.
|
|
241
|
+
* Applied only when `allowKeyAuthOverride` is true and the captured effective auth transport
|
|
242
|
+
* is key-based. Explicit provider config still wins field-by-field, including `false`.
|
|
243
|
+
*/
|
|
244
|
+
keyAuthServiceTier?: {
|
|
245
|
+
supportsServiceTier?: boolean;
|
|
246
|
+
modelSupportsServiceTier?: Record<string, boolean>;
|
|
247
|
+
chatServiceTier?: boolean;
|
|
248
|
+
};
|
|
249
|
+
/** Provider-specific copy for the Codex catalog's Fast tier. */
|
|
250
|
+
fastTierDescription?: string;
|
|
251
|
+
/**
|
|
252
|
+
* Registry-only destination guard for `modelSupportsServiceTier`. This scopes vendor evidence
|
|
253
|
+
* without changing provider ownership, routing, authentication, or config validation.
|
|
254
|
+
*/
|
|
255
|
+
modelServiceTierCapabilityBaseUrlGuard?: (baseUrl: string) => boolean;
|
|
256
|
+
/** Registry default for plaintext reasoning replay; see `OcxProviderConfig.preserveResponsesReasoningContent`. Registry-only like `supportsServiceTier`. */
|
|
257
|
+
preserveResponsesReasoningContent?: boolean;
|
|
258
|
+
/** Registry defaults for per-model Codex reasoning propagation; explicit user keys win during enrichment. */
|
|
259
|
+
modelSupportsReasoningSummaries?: Record<string, boolean>;
|
|
260
|
+
/** Registry defaults for per-model Codex Responses verbosity support. */
|
|
261
|
+
modelSupportsVerbosity?: Record<string, boolean>;
|
|
262
|
+
/**
|
|
263
|
+
* Registry default applied to EVERY model of this provider, including ids that arrive from
|
|
264
|
+
* live discovery after this table was written.
|
|
265
|
+
*
|
|
266
|
+
* `modelSupportsVerbosity` only covers the ids enumerated here, so a newly discovered model
|
|
267
|
+
* fell through and re-advertised a control the upstream accepts and ignores. Where the opt-out
|
|
268
|
+
* is a property of the provider's API rather than of one model, declare it here; a per-model
|
|
269
|
+
* entry still wins over it.
|
|
270
|
+
*/
|
|
271
|
+
supportsVerbosity?: boolean;
|
|
272
|
+
modelDiscovery?: ProviderModelDiscoverySpec;
|
|
273
|
+
contextWindow?: number;
|
|
274
|
+
modelContextWindows?: Record<string, number>;
|
|
275
|
+
/**
|
|
276
|
+
* Registry-supplied picker labels. Without these a routed row shows its raw slug,
|
|
277
|
+
* because `routedDisplayName` (codex/catalog/sync.ts) passes the slug through for every
|
|
278
|
+
* provider. An operator's `modelDisplayNames` still wins: derive only fills when absent.
|
|
279
|
+
*/
|
|
280
|
+
modelDisplayNames?: Record<string, string>;
|
|
281
|
+
modelInputModalities?: Record<string, string[]>;
|
|
282
|
+
defaultMaxOutputTokens?: number;
|
|
283
|
+
modelMaxOutputTokens?: Record<string, number>;
|
|
284
|
+
reasoningEfforts?: string[];
|
|
285
|
+
modelReasoningEfforts?: Record<string, string[]>;
|
|
286
|
+
modelDefaultReasoningEfforts?: Record<string, string>;
|
|
287
|
+
reasoningEffortMap?: Record<string, string>;
|
|
288
|
+
modelReasoningEffortMap?: Record<string, Record<string, string>>;
|
|
289
|
+
/**
|
|
290
|
+
* Registry-authoritative models that send OpenAI's direct `reasoning_effort` field.
|
|
291
|
+
* Runtime enrichment uses this to repair stale preset metadata that still classifies a model
|
|
292
|
+
* as a thinking-budget/toggle model. This is registry-only and is never persisted as user config.
|
|
293
|
+
*/
|
|
294
|
+
directReasoningEffortModels?: string[];
|
|
295
|
+
reasoningWireFormat?: OcxProviderConfig["reasoningWireFormat"];
|
|
296
|
+
noVisionModels?: string[];
|
|
297
|
+
noReasoningModels?: string[];
|
|
298
|
+
noTemperatureModels?: string[];
|
|
299
|
+
noTopPModels?: string[];
|
|
300
|
+
noPenaltyModels?: string[];
|
|
301
|
+
/**
|
|
302
|
+
* Registry-only seed for `OcxProviderConfig.noJsonSchemaModels`. Merged into the
|
|
303
|
+
* resolved provider at route time rather than persisted as user config, the same way
|
|
304
|
+
* `directReasoningEffortModels` above is registry-owned.
|
|
305
|
+
*/
|
|
306
|
+
noJsonSchemaModels?: string[];
|
|
307
|
+
/** Opt this provider into parallel tool calls (see OcxProviderConfig.parallelToolCalls). */
|
|
308
|
+
parallelToolCalls?: boolean;
|
|
309
|
+
/** Opt this provider into forwarding prompt_cache_key (OpenAI-specific; strict backends reject it). */
|
|
310
|
+
promptCacheKey?: boolean;
|
|
311
|
+
/**
|
|
312
|
+
* Opt-in: forward `service_tier` on the `/chat/completions` wire. Same hazard as
|
|
313
|
+
* `promptCacheKey` — an OpenAI-specific extension that strict gateways reject. Distinct from
|
|
314
|
+
* `supportsServiceTier`, which governs the Responses wire.
|
|
315
|
+
*/
|
|
316
|
+
chatServiceTier?: boolean;
|
|
317
|
+
/** OpenAI Chat EOF policy for gateways that omit terminal frames after complete tool calls. */
|
|
318
|
+
openaiChatEofTolerance?: boolean;
|
|
319
|
+
autoToolChoiceOnlyModels?: string[];
|
|
320
|
+
preserveReasoningContentModels?: string[];
|
|
321
|
+
requiresReasoningPlaceholderModels?: string[];
|
|
322
|
+
/**
|
|
323
|
+
* Opt this provider into visible thinking summaries (see OcxProviderConfig.showThinkingSummary).
|
|
324
|
+
*/
|
|
325
|
+
showThinkingSummary?: boolean;
|
|
326
|
+
reasoningSplitModels?: string[];
|
|
327
|
+
reasoningDetailsModels?: string[];
|
|
328
|
+
thinkingToggleModels?: string[];
|
|
329
|
+
thinkingBudgetModels?: string[];
|
|
330
|
+
escapeBuiltinToolNames?: boolean;
|
|
331
|
+
oauthId?: string;
|
|
332
|
+
virtualModels?: Record<string, { wireModelId: string; reasoningMode: "pro" }>;
|
|
333
|
+
modelMaxInputTokens?: Record<string, number>;
|
|
334
|
+
jawcodeBundle?: string;
|
|
335
|
+
extraMetadataAliases?: string[];
|
|
336
|
+
metadataModelIdNormalize?: MetadataModelIdNormalize;
|
|
337
|
+
googleMode?: "ai-studio" | "vertex" | "cloud-code-assist";
|
|
338
|
+
project?: string;
|
|
339
|
+
location?: string;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
export type ProviderConfigSeed = Pick<
|
|
343
|
+
OcxProviderConfig,
|
|
344
|
+
"adapter" | "baseUrl" | "apiKeyTransport" | "responsesPath" | "chatCompletionsPath" | "authMode" | "keyOptional" | "freeTier" | "modelSuffixBracketStrip" | "defaultModel" | "models"
|
|
345
|
+
| "liveModels" | "contextWindow" | "modelContextWindows" | "modelInputModalities"
|
|
346
|
+
| "modelDisplayNames"
|
|
347
|
+
| "modelMaxInputTokens" | "defaultMaxOutputTokens" | "modelMaxOutputTokens"
|
|
348
|
+
| "reasoningEfforts" | "modelReasoningEfforts" | "modelDefaultReasoningEfforts" | "reasoningEffortMap" | "modelReasoningEffortMap" | "reasoningWireFormat"
|
|
349
|
+
| "noVisionModels" | "noReasoningModels" | "noTemperatureModels" | "noTopPModels" | "noPenaltyModels"
|
|
350
|
+
| "autoToolChoiceOnlyModels" | "preserveReasoningContentModels" | "requiresReasoningPlaceholderModels" | "reasoningSplitModels" | "reasoningDetailsModels" | "thinkingToggleModels" | "thinkingBudgetModels" | "escapeBuiltinToolNames" | "openaiChatEofTolerance" | "showThinkingSummary"
|
|
351
|
+
| "googleMode" | "project" | "location" | "headers"
|
|
352
|
+
>;
|