@cmmd-center/forge 0.13.94 → 0.13.95
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/dist/bin.cjs +126 -29
- package/dist/bin.mjs +151 -54
- package/dist/client/assets/{CanvasPanel-By1TNSCJ.js → CanvasPanel-BsTCRB1I.js} +2 -2
- package/dist/client/assets/{CompositeItem-B4KFI6uM.js → CompositeItem-DNkNENOR.js} +2 -2
- package/dist/client/assets/{DiffPanel-W2IJB2F9.js → DiffPanel-CAkf79MN.js} +2 -2
- package/dist/client/assets/{DiffPanel.logic-D-ynbsKZ.js → DiffPanel.logic-B9IU5Q5Q.js} +2 -2
- package/dist/client/assets/{DiffWorkerPoolProvider-h4bACnie.js → DiffWorkerPoolProvider-BaJzbqHW.js} +2 -2
- package/dist/client/assets/{PullRequestCodePanel-Bphx591a.js → PullRequestCodePanel-ItXVNv0A.js} +2 -2
- package/dist/client/assets/{Virtualizer-BGM8Aavb.js → Virtualizer-D6N688Z0.js} +2 -2
- package/dist/client/assets/{WorkerPoolContext-dJEWASlP.js → WorkerPoolContext-Q7KzTxot.js} +31 -31
- package/dist/client/assets/{canvasStateStore-DoXLRnB-.js → canvasStateStore-Dl3vO1ug.js} +2 -2
- package/dist/client/assets/{cmmdAuthRedirect-DJMI3b92.js → cmmdAuthRedirect-DCgS12fq.js} +2 -2
- package/dist/client/assets/{index-_uhZ-JUt.js → index-CuTM56F9.js} +60 -60
- package/dist/client/assets/{popover-DlZTqPIV.js → popover-C9fxnFA4.js} +2 -2
- package/dist/client/assets/{src-1F7f5y9L.js → src-DFTFXdyK.js} +2 -2
- package/dist/client/assets/{toggle-BwedUJ-z.js → toggle-Ks6yUkoN.js} +2 -2
- package/dist/client/index.html +10 -10
- package/dist/forge-build.json +1 -1
- package/dist/{open-yHTUkd2Y.mjs → open-2-reBrpv.mjs} +3 -3
- package/package.json +1 -1
package/dist/bin.cjs
CHANGED
|
@@ -23003,6 +23003,25 @@ const ProviderUnavailableDetail = require_Schema$1.Literals([
|
|
|
23003
23003
|
"reconnect-required"
|
|
23004
23004
|
]);
|
|
23005
23005
|
/**
|
|
23006
|
+
* Whether the check behind this snapshot's `installed`/`status`/`auth`/`models`
|
|
23007
|
+
* fields actually completed (`confirmed`), or a probe failed, timed out, or
|
|
23008
|
+
* errored before it could answer (`could-not-check`). Absent means the
|
|
23009
|
+
* snapshot predates this field and carries no opinion either way.
|
|
23010
|
+
*
|
|
23011
|
+
* Deliberately not a new `ProviderUnavailableReason` member, and not folded
|
|
23012
|
+
* into `ProviderUnavailableDetail`. That union is the wire vocabulary a
|
|
23013
|
+
* separate CMMD receiver already validates with a `.strict()` schema (see
|
|
23014
|
+
* `docs/adr/withheld-providers-carry-their-reason.md`), and a value that
|
|
23015
|
+
* receiver has never heard of fails the whole snapshot, which its outbox then
|
|
23016
|
+
* retries forever. A brand new field costs a receiver that has never heard of
|
|
23017
|
+
* it nothing: Effect Schema drops an unrecognized struct property instead of
|
|
23018
|
+
* failing the decode, and `serializeProviderCatalog`
|
|
23019
|
+
* (`apps/server/src/runtimeReplication/providerCatalog.ts`) never copies this
|
|
23020
|
+
* field to that wire in the first place, so the CMMD-facing shape does not
|
|
23021
|
+
* change at all.
|
|
23022
|
+
*/
|
|
23023
|
+
const ProviderAvailabilityCheck = require_Schema$1.Literals(["confirmed", "could-not-check"]);
|
|
23024
|
+
/**
|
|
23006
23025
|
* Whether the provider CLI honours the credential-directory variable, as this
|
|
23007
23026
|
* Environment's probe found. `inconclusive` is a probe that ran and could not
|
|
23008
23027
|
* tell. It is not `unsupported`, and it is never reported as `supported`. The
|
|
@@ -23059,6 +23078,8 @@ const ServerProvider = require_Schema$1.Struct({
|
|
|
23059
23078
|
availability: require_Schema$1.optional(ProviderAvailability),
|
|
23060
23079
|
unavailableReason: require_Schema$1.optional(ProviderUnavailableReason),
|
|
23061
23080
|
unavailableDetail: require_Schema$1.optional(ProviderUnavailableDetail),
|
|
23081
|
+
availabilityCheck: require_Schema$1.optional(ProviderAvailabilityCheck),
|
|
23082
|
+
lastConfirmedAt: require_Schema$1.optional(IsoDateTime),
|
|
23062
23083
|
credentialDirectory: require_Schema$1.optional(ProviderCredentialDirectoryAnswer),
|
|
23063
23084
|
credentialStore: require_Schema$1.optional(ProviderCredentialStore),
|
|
23064
23085
|
slashCommands: require_Schema$1.ArraySchema(ServerProviderSlashCommand).pipe(require_Schema$1.withDecodingDefault(require_Schema$1.succeed([]))),
|
|
@@ -66311,7 +66332,7 @@ function normalizeNumberish(value) {
|
|
|
66311
66332
|
}
|
|
66312
66333
|
//#endregion
|
|
66313
66334
|
//#region package.json
|
|
66314
|
-
var version$1 = "0.13.
|
|
66335
|
+
var version$1 = "0.13.95";
|
|
66315
66336
|
//#endregion
|
|
66316
66337
|
//#region src/sentry.ts
|
|
66317
66338
|
const SERVER_APP_NAME = "forge-server";
|
|
@@ -212603,6 +212624,17 @@ function isCommandMissingCause(error) {
|
|
|
212603
212624
|
const lower = error.message.toLowerCase();
|
|
212604
212625
|
return lower.includes("enoent") || lower.includes("notfound");
|
|
212605
212626
|
}
|
|
212627
|
+
/**
|
|
212628
|
+
* The one thing a spawn failure answers for sure when it is command-missing
|
|
212629
|
+
* shaped: the binary is not there. Any other spawn failure (a permissions
|
|
212630
|
+
* error, a crashed shell, a Sprite freeze mid-spawn) never actually asked the
|
|
212631
|
+
* CLI anything, so it is not evidence the binary is missing (forge#3588).
|
|
212632
|
+
* Shared by every provider Layer's version-probe failure branch so the
|
|
212633
|
+
* classification reads the same way everywhere it is made.
|
|
212634
|
+
*/
|
|
212635
|
+
function availabilityCheckForSpawnFailure(commandMissing) {
|
|
212636
|
+
return commandMissing ? "confirmed" : "could-not-check";
|
|
212637
|
+
}
|
|
212606
212638
|
const spawnAndCollect = (binaryPath, command) => require_Schema$1.gen(function* () {
|
|
212607
212639
|
const child = yield* (yield* require_NodeTerminal.ChildProcessSpawner).spawn(command);
|
|
212608
212640
|
const [stdout, stderr, exitCode] = yield* require_Schema$1.all([
|
|
@@ -212709,6 +212741,7 @@ function buildServerProvider(input) {
|
|
|
212709
212741
|
auth: input.probe.auth,
|
|
212710
212742
|
checkedAt: input.checkedAt,
|
|
212711
212743
|
...input.probe.message ? { message: input.probe.message } : {},
|
|
212744
|
+
...input.probe.availabilityCheck ? { availabilityCheck: input.probe.availabilityCheck } : {},
|
|
212712
212745
|
models: input.models,
|
|
212713
212746
|
slashCommands: [...input.slashCommands ?? []],
|
|
212714
212747
|
skills: [...withForgeBuiltInSkills(input.skills)]
|
|
@@ -214793,19 +214826,29 @@ const makeManagedServerProvider = require_Schema$1.fn("makeManagedServerProvider
|
|
|
214793
214826
|
});
|
|
214794
214827
|
yield* require_Path.runForEach(input.streamSettings, (nextSettings) => require_Schema$1.asVoid(applySnapshot(nextSettings))).pipe(require_Schema$1.forkScoped);
|
|
214795
214828
|
const refreshFailureCount = yield* require_HttpServer.make$3(0);
|
|
214829
|
+
const QUICK_RETRY_MS = 5e3;
|
|
214830
|
+
const MAX_QUICK_RETRIES = 3;
|
|
214831
|
+
const quickRetriesSoFar = yield* require_HttpServer.make$3(0);
|
|
214796
214832
|
yield* require_Schema$1.forever(require_Schema$1.gen(function* () {
|
|
214797
214833
|
const failureCount = yield* require_HttpServer.get$1(refreshFailureCount);
|
|
214834
|
+
const quickRetriesDone = yield* require_HttpServer.get$1(quickRetriesSoFar);
|
|
214798
214835
|
const baseMs = 6e4;
|
|
214799
214836
|
const backoffMs = Math.min(baseMs * Math.pow(2, failureCount), 3e5);
|
|
214800
|
-
|
|
214837
|
+
const delayMs = quickRetriesDone > 0 ? QUICK_RETRY_MS : backoffMs;
|
|
214838
|
+
yield* require_Schema$1.sleep(require_Schema$1.millis(delayMs));
|
|
214801
214839
|
const result = yield* refreshSnapshot().pipe(require_Schema$1.tapError((e) => require_Schema$1.sync(() => captureServerError(e))), require_Schema$1.exit);
|
|
214802
214840
|
if (require_Schema$1.isFailure(result)) {
|
|
214803
214841
|
yield* require_HttpServer.update(refreshFailureCount, (n) => Math.min(n + 1, 4));
|
|
214842
|
+
yield* require_HttpServer.set(quickRetriesSoFar, 0);
|
|
214804
214843
|
yield* require_Schema$1.logInfo("Provider refresh failed, backing off", {
|
|
214805
214844
|
failureCount: failureCount + 1,
|
|
214806
214845
|
nextDelayMs: Math.min(baseMs * Math.pow(2, failureCount + 1), 3e5)
|
|
214807
214846
|
});
|
|
214808
|
-
} else
|
|
214847
|
+
} else {
|
|
214848
|
+
yield* require_HttpServer.set(refreshFailureCount, 0);
|
|
214849
|
+
const keepRetryingQuickly = result.value.availabilityCheck === "could-not-check" && quickRetriesDone < MAX_QUICK_RETRIES;
|
|
214850
|
+
yield* require_HttpServer.set(quickRetriesSoFar, keepRetryingQuickly ? quickRetriesDone + 1 : 0);
|
|
214851
|
+
}
|
|
214809
214852
|
})).pipe(require_Schema$1.forkScoped);
|
|
214810
214853
|
return {
|
|
214811
214854
|
getSnapshot: input.getSettings.pipe(require_Schema$1.flatMap(applySnapshot), require_Schema$1.tapError(require_Schema$1.logError), require_Schema$1.orDie),
|
|
@@ -215458,7 +215501,8 @@ function buildClaudeProviderFromAuthProbe(input) {
|
|
|
215458
215501
|
version: input.parsedVersion,
|
|
215459
215502
|
status: "warning",
|
|
215460
215503
|
auth: { status: "unknown" },
|
|
215461
|
-
message: error instanceof Error ? `Could not verify Claude authentication status: ${error.message}.` : "Could not verify Claude authentication status."
|
|
215504
|
+
message: error instanceof Error ? `Could not verify Claude authentication status: ${error.message}.` : "Could not verify Claude authentication status.",
|
|
215505
|
+
availabilityCheck: "could-not-check"
|
|
215462
215506
|
}
|
|
215463
215507
|
});
|
|
215464
215508
|
}
|
|
@@ -215479,7 +215523,8 @@ function buildClaudeProviderFromAuthProbe(input) {
|
|
|
215479
215523
|
status: "warning",
|
|
215480
215524
|
auth: { status: "unknown" },
|
|
215481
215525
|
message: "Could not verify Claude authentication status. Timed out while running command."
|
|
215482
|
-
}
|
|
215526
|
+
},
|
|
215527
|
+
availabilityCheck: "could-not-check"
|
|
215483
215528
|
}
|
|
215484
215529
|
});
|
|
215485
215530
|
const parsed = parseClaudeAuthStatusFromOutput(input.authProbe.success.value, { proxiedCredential: input.provenance.credentialScope === "proxied" });
|
|
@@ -215498,7 +215543,8 @@ function buildClaudeProviderFromAuthProbe(input) {
|
|
|
215498
215543
|
...input.authMetadata ? input.authMetadata : {},
|
|
215499
215544
|
provenance: input.provenance
|
|
215500
215545
|
},
|
|
215501
|
-
...parsed.message ? { message: parsed.message } : {}
|
|
215546
|
+
...parsed.message ? { message: parsed.message } : {},
|
|
215547
|
+
availabilityCheck: "confirmed"
|
|
215502
215548
|
}
|
|
215503
215549
|
});
|
|
215504
215550
|
}
|
|
@@ -215564,7 +215610,8 @@ function claudeVersionProbeTimeoutProvider(input) {
|
|
|
215564
215610
|
version: null,
|
|
215565
215611
|
status: "error",
|
|
215566
215612
|
auth: { status: "unknown" },
|
|
215567
|
-
message: "Claude Agent CLI is installed but failed to run. Timed out while running command."
|
|
215613
|
+
message: "Claude Agent CLI is installed but failed to run. Timed out while running command.",
|
|
215614
|
+
availabilityCheck: "could-not-check"
|
|
215568
215615
|
}
|
|
215569
215616
|
});
|
|
215570
215617
|
}
|
|
@@ -215596,7 +215643,8 @@ const nativeClaudeProviderStatus = require_Schema$1.fn("nativeClaudeProviderStat
|
|
|
215596
215643
|
status: usable ? "authenticated" : "unauthenticated",
|
|
215597
215644
|
provenance: input.provenance
|
|
215598
215645
|
},
|
|
215599
|
-
...usable ? {} : { message: claudeNativeCredentialUnusableMessage() }
|
|
215646
|
+
...usable ? {} : { message: claudeNativeCredentialUnusableMessage() },
|
|
215647
|
+
availabilityCheck: "confirmed"
|
|
215600
215648
|
}
|
|
215601
215649
|
});
|
|
215602
215650
|
});
|
|
@@ -215642,23 +215690,26 @@ const checkClaudeProviderStatus = require_Schema$1.fn("checkClaudeProviderStatus
|
|
|
215642
215690
|
version: null,
|
|
215643
215691
|
status: "warning",
|
|
215644
215692
|
auth: { status: "unknown" },
|
|
215645
|
-
message: "Claude is disabled in Forge settings."
|
|
215693
|
+
message: "Claude is disabled in Forge settings.",
|
|
215694
|
+
availabilityCheck: "confirmed"
|
|
215646
215695
|
}
|
|
215647
215696
|
});
|
|
215648
215697
|
const versionProbe = yield* runClaudeCommand(["--version"]).pipe(require_Schema$1.timeoutOption(CLAUDE_VERSION_PROBE_TIMEOUT_MS), require_Schema$1.result);
|
|
215649
215698
|
if (require_Schema$1.isFailure$1(versionProbe)) {
|
|
215650
215699
|
const error = versionProbe.failure;
|
|
215700
|
+
const commandMissing = isCommandMissingCause(error);
|
|
215651
215701
|
return buildServerProvider({
|
|
215652
215702
|
provider: PROVIDER$12,
|
|
215653
215703
|
enabled: claudeSettings.enabled,
|
|
215654
215704
|
checkedAt,
|
|
215655
215705
|
models: fallbackModels,
|
|
215656
215706
|
probe: {
|
|
215657
|
-
installed: !
|
|
215707
|
+
installed: !commandMissing,
|
|
215658
215708
|
version: null,
|
|
215659
215709
|
status: "error",
|
|
215660
215710
|
auth: { status: "unknown" },
|
|
215661
|
-
message:
|
|
215711
|
+
message: commandMissing ? "Claude Agent CLI (`claude`) is not installed or not on PATH." : `Failed to execute Claude Agent CLI health check: ${error instanceof Error ? error.message : String(error)}.`,
|
|
215712
|
+
availabilityCheck: availabilityCheckForSpawnFailure(commandMissing)
|
|
215662
215713
|
}
|
|
215663
215714
|
});
|
|
215664
215715
|
}
|
|
@@ -215681,7 +215732,8 @@ const checkClaudeProviderStatus = require_Schema$1.fn("checkClaudeProviderStatus
|
|
|
215681
215732
|
version: parsedVersion,
|
|
215682
215733
|
status: "error",
|
|
215683
215734
|
auth: { status: "unknown" },
|
|
215684
|
-
message: detail ? `Claude Agent CLI is installed but failed to run. ${detail}` : "Claude Agent CLI is installed but failed to run."
|
|
215735
|
+
message: detail ? `Claude Agent CLI is installed but failed to run. ${detail}` : "Claude Agent CLI is installed but failed to run.",
|
|
215736
|
+
availabilityCheck: "confirmed"
|
|
215685
215737
|
}
|
|
215686
215738
|
});
|
|
215687
215739
|
}
|
|
@@ -237826,23 +237878,26 @@ const checkCodexProviderStatus = require_Schema$1.fn("checkCodexProviderStatus")
|
|
|
237826
237878
|
status: "unknown",
|
|
237827
237879
|
provenance
|
|
237828
237880
|
},
|
|
237829
|
-
message: "Codex is disabled in Forge settings."
|
|
237881
|
+
message: "Codex is disabled in Forge settings.",
|
|
237882
|
+
availabilityCheck: "confirmed"
|
|
237830
237883
|
}
|
|
237831
237884
|
});
|
|
237832
237885
|
const versionProbe = yield* runCodexCommand(["--version"]).pipe(require_Schema$1.timeoutOption(CODEX_VERSION_PROBE_TIMEOUT_MS), require_Schema$1.result);
|
|
237833
237886
|
if (require_Schema$1.isFailure$1(versionProbe)) {
|
|
237834
237887
|
const error = versionProbe.failure;
|
|
237888
|
+
const commandMissing = isCommandMissingCause(error);
|
|
237835
237889
|
return buildServerProvider({
|
|
237836
237890
|
provider: PROVIDER$4,
|
|
237837
237891
|
enabled: codexSettings.enabled,
|
|
237838
237892
|
checkedAt,
|
|
237839
237893
|
models: fallbackModels,
|
|
237840
237894
|
probe: {
|
|
237841
|
-
installed: !
|
|
237895
|
+
installed: !commandMissing,
|
|
237842
237896
|
version: null,
|
|
237843
237897
|
status: "error",
|
|
237844
237898
|
auth: { status: "unknown" },
|
|
237845
|
-
message:
|
|
237899
|
+
message: commandMissing ? "Codex CLI (`codex`) is not installed or not on PATH." : `Failed to execute Codex CLI health check: ${error.message}.`,
|
|
237900
|
+
availabilityCheck: availabilityCheckForSpawnFailure(commandMissing)
|
|
237846
237901
|
}
|
|
237847
237902
|
});
|
|
237848
237903
|
}
|
|
@@ -237856,7 +237911,8 @@ const checkCodexProviderStatus = require_Schema$1.fn("checkCodexProviderStatus")
|
|
|
237856
237911
|
version: null,
|
|
237857
237912
|
status: "error",
|
|
237858
237913
|
auth: { status: "unknown" },
|
|
237859
|
-
message: "Codex CLI is installed but failed to run. Timed out while running command."
|
|
237914
|
+
message: "Codex CLI is installed but failed to run. Timed out while running command.",
|
|
237915
|
+
availabilityCheck: "could-not-check"
|
|
237860
237916
|
}
|
|
237861
237917
|
});
|
|
237862
237918
|
const version = versionProbe.success.value;
|
|
@@ -237873,7 +237929,8 @@ const checkCodexProviderStatus = require_Schema$1.fn("checkCodexProviderStatus")
|
|
|
237873
237929
|
version: parsedVersion,
|
|
237874
237930
|
status: "error",
|
|
237875
237931
|
auth: { status: "unknown" },
|
|
237876
|
-
message: detail ? `Codex CLI is installed but failed to run. ${detail}` : "Codex CLI is installed but failed to run."
|
|
237932
|
+
message: detail ? `Codex CLI is installed but failed to run. ${detail}` : "Codex CLI is installed but failed to run.",
|
|
237933
|
+
availabilityCheck: "confirmed"
|
|
237877
237934
|
}
|
|
237878
237935
|
});
|
|
237879
237936
|
}
|
|
@@ -237887,7 +237944,8 @@ const checkCodexProviderStatus = require_Schema$1.fn("checkCodexProviderStatus")
|
|
|
237887
237944
|
version: parsedVersion,
|
|
237888
237945
|
status: "error",
|
|
237889
237946
|
auth: { status: "unknown" },
|
|
237890
|
-
message: formatCodexCliUpgradeMessage(parsedVersion)
|
|
237947
|
+
message: formatCodexCliUpgradeMessage(parsedVersion),
|
|
237948
|
+
availabilityCheck: "confirmed"
|
|
237891
237949
|
}
|
|
237892
237950
|
});
|
|
237893
237951
|
const skills = (resolveSkills ? yield* resolveSkills({
|
|
@@ -237912,7 +237970,8 @@ const checkCodexProviderStatus = require_Schema$1.fn("checkCodexProviderStatus")
|
|
|
237912
237970
|
version: parsedVersion,
|
|
237913
237971
|
status: "ready",
|
|
237914
237972
|
auth: { status: "unknown" },
|
|
237915
|
-
message: "Using a custom Codex model provider; OpenAI login check skipped."
|
|
237973
|
+
message: "Using a custom Codex model provider; OpenAI login check skipped.",
|
|
237974
|
+
availabilityCheck: "confirmed"
|
|
237916
237975
|
}
|
|
237917
237976
|
});
|
|
237918
237977
|
const authProbe = yield* runCodexCommand(["login", "status"]).pipe(require_Schema$1.timeoutOption(CODEX_AUTH_PROBE_TIMEOUT_MS), require_Schema$1.result);
|
|
@@ -237934,7 +237993,8 @@ const checkCodexProviderStatus = require_Schema$1.fn("checkCodexProviderStatus")
|
|
|
237934
237993
|
version: parsedVersion,
|
|
237935
237994
|
status: "warning",
|
|
237936
237995
|
auth: { status: "unknown" },
|
|
237937
|
-
message: `Could not verify Codex authentication status: ${error.message}
|
|
237996
|
+
message: `Could not verify Codex authentication status: ${error.message}.`,
|
|
237997
|
+
availabilityCheck: "could-not-check"
|
|
237938
237998
|
}
|
|
237939
237999
|
});
|
|
237940
238000
|
}
|
|
@@ -237949,7 +238009,8 @@ const checkCodexProviderStatus = require_Schema$1.fn("checkCodexProviderStatus")
|
|
|
237949
238009
|
version: parsedVersion,
|
|
237950
238010
|
status: "warning",
|
|
237951
238011
|
auth: { status: "unknown" },
|
|
237952
|
-
message: "Codex authentication status check did not respond in time. The agent can still run; refresh the provider from Settings to retry."
|
|
238012
|
+
message: "Codex authentication status check did not respond in time. The agent can still run; refresh the provider from Settings to retry.",
|
|
238013
|
+
availabilityCheck: "could-not-check"
|
|
237953
238014
|
}
|
|
237954
238015
|
});
|
|
237955
238016
|
const parsed = parseAuthStatusFromOutput(authProbe.success.value);
|
|
@@ -237976,7 +238037,8 @@ const checkCodexProviderStatus = require_Schema$1.fn("checkCodexProviderStatus")
|
|
|
237976
238037
|
...accountEmail ? { accountLabel: accountEmail } : {}
|
|
237977
238038
|
}
|
|
237978
238039
|
},
|
|
237979
|
-
...parsed.message ? { message: parsed.message } : {}
|
|
238040
|
+
...parsed.message ? { message: parsed.message } : {},
|
|
238041
|
+
availabilityCheck: "confirmed"
|
|
237980
238042
|
}
|
|
237981
238043
|
});
|
|
237982
238044
|
});
|
|
@@ -296699,6 +296761,31 @@ const loadProviders = (codexProvider, claudeProvider, ollamaProvider, cmmdProvid
|
|
|
296699
296761
|
opencodeProvider.getSnapshot
|
|
296700
296762
|
], { concurrency: "unbounded" });
|
|
296701
296763
|
const haveProvidersChanged = (previousProviders, nextProviders) => !require_Schema$1.equals(previousProviders, nextProviders);
|
|
296764
|
+
/**
|
|
296765
|
+
* Keep publishing a previous good reading, marked stale, across a probe that
|
|
296766
|
+
* could not check rather than replacing it with a false "not on this
|
|
296767
|
+
* environment" (forge#3588).
|
|
296768
|
+
*
|
|
296769
|
+
* A Sprite freezes the cgroup about a second after the last inbound request,
|
|
296770
|
+
* so a probe already in flight at the freeze resumes into a timeout that
|
|
296771
|
+
* proves nothing: `checkCodexProviderStatus`/`checkClaudeProviderStatus` mark
|
|
296772
|
+
* exactly that shape `availabilityCheck: "could-not-check"`. When the last
|
|
296773
|
+
* thing this registry confirmed for the same provider was available, this
|
|
296774
|
+
* keeps publishing THAT reading rather than the fresh could-not-check one,
|
|
296775
|
+
* stamped stale with the time it was last confirmed. A provider with no prior
|
|
296776
|
+
* confirmed reading, or one whose previous reading was itself withheld, has
|
|
296777
|
+
* nothing to carry forward, so the fresh (still unavailable) reading stands.
|
|
296778
|
+
*/
|
|
296779
|
+
function carryForwardStaleReading(incoming, previous) {
|
|
296780
|
+
if (incoming.availabilityCheck !== "could-not-check") return incoming;
|
|
296781
|
+
if (previous === void 0 || previous.availability !== "available") return incoming;
|
|
296782
|
+
return {
|
|
296783
|
+
...previous,
|
|
296784
|
+
checkedAt: incoming.checkedAt,
|
|
296785
|
+
availabilityCheck: "could-not-check",
|
|
296786
|
+
lastConfirmedAt: previous.lastConfirmedAt ?? previous.checkedAt
|
|
296787
|
+
};
|
|
296788
|
+
}
|
|
296702
296789
|
const ProviderRegistryLive = require_Schema$1.effect(ProviderRegistry, require_Schema$1.gen(function* () {
|
|
296703
296790
|
const config = yield* ServerConfig;
|
|
296704
296791
|
const codexProvider = yield* CodexProvider;
|
|
@@ -296737,15 +296824,25 @@ const ProviderRegistryLive = require_Schema$1.effect(ProviderRegistry, require_S
|
|
|
296737
296824
|
error
|
|
296738
296825
|
})), require_Schema$1.ignore);
|
|
296739
296826
|
const upsertProviders = require_Schema$1.fn("upsertProviders")(function* (incomingProviders, options) {
|
|
296740
|
-
const
|
|
296741
|
-
const [previousProviders, providers] = yield* require_HttpServer.modify(providersRef, (previousProviders) => {
|
|
296742
|
-
const
|
|
296743
|
-
|
|
296827
|
+
const withAvailability = incomingProviders.map((provider) => withProviderAvailability(provider));
|
|
296828
|
+
const [previousProviders, providers, resolvedProviders] = yield* require_HttpServer.modify(providersRef, (previousProviders) => {
|
|
296829
|
+
const previousByKind = new Map(previousProviders.map((provider) => [provider.provider, provider]));
|
|
296830
|
+
const mergedProviders = new Map(previousByKind);
|
|
296831
|
+
const resolvedProviders = [];
|
|
296832
|
+
for (const provider of withAvailability) {
|
|
296833
|
+
const resolved = carryForwardStaleReading(provider, previousByKind.get(provider.provider));
|
|
296834
|
+
resolvedProviders.push(resolved);
|
|
296835
|
+
mergedProviders.set(provider.provider, resolved);
|
|
296836
|
+
}
|
|
296744
296837
|
const providers = orderProviderSnapshots([...mergedProviders.values()]);
|
|
296745
|
-
return [[
|
|
296838
|
+
return [[
|
|
296839
|
+
previousProviders,
|
|
296840
|
+
providers,
|
|
296841
|
+
resolvedProviders
|
|
296842
|
+
], providers];
|
|
296746
296843
|
});
|
|
296747
296844
|
if (haveProvidersChanged(previousProviders, providers)) {
|
|
296748
|
-
yield* require_Schema$1.forEach(
|
|
296845
|
+
yield* require_Schema$1.forEach(resolvedProviders, persistProvider, {
|
|
296749
296846
|
concurrency: "unbounded",
|
|
296750
296847
|
discard: true
|
|
296751
296848
|
});
|
|
@@ -299788,7 +299885,7 @@ function resolveBuildCommitFromEnv(env) {
|
|
|
299788
299885
|
* environment descriptor down instead of reporting an honest "unknown".
|
|
299789
299886
|
*/
|
|
299790
299887
|
function readBakedBuildCommit() {
|
|
299791
|
-
return "
|
|
299888
|
+
return "88bc45ce168df8c9acf36ad6734d8a66bcb353ec";
|
|
299792
299889
|
}
|
|
299793
299890
|
async function resolveServerBuildCommit(input) {
|
|
299794
299891
|
if (isFullCommitSha(input.baked)) return input.baked;
|