@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/web-search/loop.ts
CHANGED
|
@@ -12,7 +12,7 @@ import type { AttemptRecoveryKind } from "../usage/log";
|
|
|
12
12
|
import { isTruncatedStopReason } from "../responses/truncated-stop-reason";
|
|
13
13
|
import { bridgeToResponsesSSE } from "../bridge";
|
|
14
14
|
import { guardEmptyToolCatalogStream, type ClientToolCatalogRestriction } from "../lib/empty-tool-catalog";
|
|
15
|
-
import { mergeUsage } from "../server/responses/empty-completion-guard";
|
|
15
|
+
import { emptyCompletionRetryFailedEvent, mergeUsage } from "../server/responses/empty-completion-guard";
|
|
16
16
|
import { markSidecarContextOverflow, sidecarLoopTerminalEvent, upstreamErrorCode, type SidecarLoopFailure } from "../server/responses/context-overflow";
|
|
17
17
|
import { markVerifiedModelNotInPlanResponse, MODEL_NOT_IN_PLAN_CODE, UNDECLARED_TOOL_CALL_ERROR_CODE, verifiedPlanRefusalMessage } from "../lib/errors";
|
|
18
18
|
import { runWebSearch, type SidecarOutcome, type SidecarOutcomeRecorder, type SidecarSettings } from "./executor";
|
|
@@ -358,6 +358,8 @@ function loopFailure(e: LoopError): SidecarLoopFailure {
|
|
|
358
358
|
*/
|
|
359
359
|
export interface WebSearchLoopDeps {
|
|
360
360
|
parsed: OcxParsedRequest;
|
|
361
|
+
/** The global emptyCompletionRetry opt-in; the loop applies it only to final openai-chat iterations. */
|
|
362
|
+
emptyCompletionRetry?: boolean;
|
|
361
363
|
advisor?: AdvisorSidecarStep;
|
|
362
364
|
/** Chat delivery only; never copied into parsed generation options. */
|
|
363
365
|
chatRawReasoningVisible?: boolean;
|
|
@@ -514,8 +516,12 @@ export async function runWithWebSearch(deps: WebSearchLoopDeps): Promise<Respons
|
|
|
514
516
|
|
|
515
517
|
// Hard iteration bound (termination safety net); forceAnswer normally ends the loop sooner.
|
|
516
518
|
// One iteration beyond the forced answer is reserved for its empty-answer recovery below.
|
|
519
|
+
// An authorized Chat empty-completion retry adds its own iteration (see completionRetries in the
|
|
520
|
+
// loop bound), so ordinary iterations, including repeat placeholders for a failed query that never
|
|
521
|
+
// advance searchesExecuted, cannot use up the slot the retry needs.
|
|
517
522
|
const HARD_CAP = maxSearches + 3 + (deps.advisor ? MAX_ADVISOR_CONTINUATIONS_PER_REQUEST : 0);
|
|
518
523
|
let emptyAnswerRetries = 0;
|
|
524
|
+
let completionRetries = 0;
|
|
519
525
|
// Every iteration re-sends the full context, but only the last one's terminal reaches the bridge.
|
|
520
526
|
// Search-calling passes and the discarded empty forced answer are summed here and added to what
|
|
521
527
|
// onUsage reports, so the request log meters what was actually sent. The client-facing terminal
|
|
@@ -1166,7 +1172,7 @@ export async function runWithWebSearch(deps: WebSearchLoopDeps): Promise<Respons
|
|
|
1166
1172
|
async function* produce(): AsyncGenerator<AdapterEvent> {
|
|
1167
1173
|
let prepared = firstPrepared;
|
|
1168
1174
|
try {
|
|
1169
|
-
for (let i = 0; i < HARD_CAP; i++) {
|
|
1175
|
+
for (let i = 0; i < HARD_CAP + completionRetries; i++) {
|
|
1170
1176
|
const forceAnswer = searchesExecuted >= maxSearches;
|
|
1171
1177
|
try {
|
|
1172
1178
|
// First loop turn reuses the eager HEADERS. Subsequent header acquisitions run here.
|
|
@@ -1191,6 +1197,18 @@ export async function runWithWebSearch(deps: WebSearchLoopDeps): Promise<Respons
|
|
|
1191
1197
|
&& !split.passthrough.some(event => event.type === "incomplete" || event.type === "error"
|
|
1192
1198
|
|| (event.type === "done" && isTruncatedStopReason(event.stopReason)));
|
|
1193
1199
|
if (!shouldLoop) {
|
|
1200
|
+
// Validate every final Chat iteration, even when no search was called. Retry
|
|
1201
|
+
// only this model leg: already executed search results stay in messages.
|
|
1202
|
+
const final = split.passthrough.find(event => event.type === "done");
|
|
1203
|
+
if (deps.emptyCompletionRetry && !forceAnswer && adapter.name === "openai-chat"
|
|
1204
|
+
&& final?.type === "done" && !isTruncatedStopReason(final.stopReason)
|
|
1205
|
+
&& !split.passthrough.some(event => event.type === "error" || event.type === "incomplete")
|
|
1206
|
+
&& !signal.aborted && !split.hasMalformedToolCall && !split.hasRealToolCall
|
|
1207
|
+
&& split.streamedPassthroughCount === 0 && !hasVisibleAssistantText(split.passthrough)) {
|
|
1208
|
+
hiddenUsage = mergeUsage(hiddenUsage, final.usage);
|
|
1209
|
+
if (completionRetries++ === 0) { yield { type: "heartbeat" }; continue; }
|
|
1210
|
+
throw new LoopError(502, "Provider completed without usable output after one retry", emptyCompletionRetryFailedEvent());
|
|
1211
|
+
}
|
|
1194
1212
|
// #1001: a forced-answer pass that ends `done` must have produced
|
|
1195
1213
|
// usable output — never a malformed tool call, and never silence.
|
|
1196
1214
|
if (forceAnswer) {
|
package/src/web-search/parse.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { sseFieldValue } from "../lib/sse-decoder";
|
|
2
2
|
import {
|
|
3
3
|
appendSafeWebSearchSource,
|
|
4
|
+
fillMissingWebSearchSourceTitle,
|
|
4
5
|
safeWebSearchSources,
|
|
5
6
|
type SafeWebSearchSource,
|
|
6
7
|
} from "./sources";
|
|
@@ -323,7 +324,7 @@ export const MAX_SIDECAR_DECODED_CHARS = 64 * 1024;
|
|
|
323
324
|
function collectAnnotation(ann: AnnotationLike | undefined, sources: WebSearchSource[], seen: Set<string>): void {
|
|
324
325
|
if (!ann || ann.type !== "url_citation" || typeof ann.url !== "string") return;
|
|
325
326
|
if (seen.has(ann.url)) {
|
|
326
|
-
|
|
327
|
+
fillMissingWebSearchSourceTitle(sources, ann.url, ann.title);
|
|
327
328
|
return;
|
|
328
329
|
}
|
|
329
330
|
if (appendSafeWebSearchSource(sources, {
|
|
@@ -332,17 +333,6 @@ function collectAnnotation(ann: AnnotationLike | undefined, sources: WebSearchSo
|
|
|
332
333
|
})) seen.add(ann.url);
|
|
333
334
|
}
|
|
334
335
|
|
|
335
|
-
function fillMissingTitle(sources: WebSearchSource[], url: string, title: unknown): void {
|
|
336
|
-
if (title === undefined) return;
|
|
337
|
-
const index = sources.findIndex(source => source.url === url);
|
|
338
|
-
if (index < 0 || sources[index]!.title !== undefined) return;
|
|
339
|
-
const candidate = sources.map((source, at) => at === index ? { url, title } : source);
|
|
340
|
-
// Re-run the shared checks: an invalid title is dropped, and a title that would push the
|
|
341
|
-
// list past its byte cap drops a source, so either outcome leaves the list unchanged.
|
|
342
|
-
const checked = safeWebSearchSources(candidate);
|
|
343
|
-
if (checked.length === sources.length && checked[index]!.title !== undefined) sources[index] = checked[index]!;
|
|
344
|
-
}
|
|
345
|
-
|
|
346
336
|
/**
|
|
347
337
|
* Hosted web_search (gpt-mini) rarely emits structured `url_citation` annotations; instead it ends
|
|
348
338
|
* its answer with a markdown `Sources:` section. Extract sources from that TRAILING section only
|
|
@@ -52,6 +52,19 @@ export function appendSafeWebSearchSource(target: SafeWebSearchSource[], source:
|
|
|
52
52
|
return true;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
+
/** Fill one validated citation's missing title without rebuilding or revalidating its peers. */
|
|
56
|
+
export function fillMissingWebSearchSourceTitle(target: SafeWebSearchSource[], url: string, value: unknown): void {
|
|
57
|
+
const title = safeTitle(value);
|
|
58
|
+
if (title === undefined) return;
|
|
59
|
+
const index = target.findIndex(source => source.url === url);
|
|
60
|
+
if (index < 0 || target[index]!.title !== undefined) return;
|
|
61
|
+
const previous = target[index]!;
|
|
62
|
+
const next = { url: previous.url, title };
|
|
63
|
+
const delta = serializedSourceBytes(next) - serializedSourceBytes(previous);
|
|
64
|
+
const usedBytes = target.reduce((sum, source) => sum + serializedSourceBytes(source), 0);
|
|
65
|
+
if (usedBytes + delta <= MAX_WEB_SEARCH_SOURCE_BYTES) target[index] = next;
|
|
66
|
+
}
|
|
67
|
+
|
|
55
68
|
export function safeWebSearchSources(sources: unknown): SafeWebSearchSource[] {
|
|
56
69
|
if (!Array.isArray(sources)) return [];
|
|
57
70
|
const safe: SafeWebSearchSource[] = [];
|