@oscharko-dev/keiko 1.3.4 → 1.3.5

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.
Files changed (193) hide show
  1. package/README.md +10 -0
  2. package/dist/ui/csp-hashes.json +6 -6
  3. package/dist/ui/static/404.html +1 -1
  4. package/dist/ui/static/__next.__PAGE__.txt +6 -6
  5. package/dist/ui/static/__next._full.txt +6 -6
  6. package/dist/ui/static/__next._index.txt +1 -1
  7. package/dist/ui/static/__next._tree.txt +1 -1
  8. package/dist/ui/static/_next/static/chunks/0-i2xjcha5mb7.js +1 -0
  9. package/dist/ui/static/_next/static/chunks/{2au392b0y1-e5.js → 1buzq8xbrkl5r.js} +1 -1
  10. package/dist/ui/static/_next/static/chunks/{2cr_43y_421vg.js → 28jbqfl7obckb.js} +1 -1
  11. package/dist/ui/static/_next/static/chunks/{33j1k7syz5_95.js → 2qrbagnu1-dgt.js} +1 -1
  12. package/dist/ui/static/_next/static/chunks/2svyhwq3u6czg.js +1 -0
  13. package/dist/ui/static/_next/static/chunks/{1-fpfnm1iv6q0.js → 35ha_z9n1aouj.js} +1 -1
  14. package/dist/ui/static/_next/static/chunks/{1hv5i64znwlbu.js → 3ktuwnqu-kln5.js} +1 -1
  15. package/dist/ui/static/_next/static/chunks/3w2jrdn8n3a_q.js +1 -0
  16. package/dist/ui/static/_not-found/__next._full.txt +1 -1
  17. package/dist/ui/static/_not-found/__next._index.txt +1 -1
  18. package/dist/ui/static/_not-found/__next._not-found.__PAGE__.txt +1 -1
  19. package/dist/ui/static/_not-found/__next._tree.txt +1 -1
  20. package/dist/ui/static/_not-found.html +1 -1
  21. package/dist/ui/static/_not-found.txt +1 -1
  22. package/dist/ui/static/atlassian-connectors/__next._full.txt +1 -1
  23. package/dist/ui/static/atlassian-connectors/__next._index.txt +1 -1
  24. package/dist/ui/static/atlassian-connectors/__next._tree.txt +1 -1
  25. package/dist/ui/static/atlassian-connectors/__next.atlassian-connectors.__PAGE__.txt +1 -1
  26. package/dist/ui/static/atlassian-connectors.html +1 -1
  27. package/dist/ui/static/atlassian-connectors.txt +1 -1
  28. package/dist/ui/static/index.html +1 -1
  29. package/dist/ui/static/index.txt +6 -6
  30. package/dist/ui/static/launch/__next._full.txt +6 -6
  31. package/dist/ui/static/launch/__next._index.txt +1 -1
  32. package/dist/ui/static/launch/__next._tree.txt +1 -1
  33. package/dist/ui/static/launch/__next.launch.__PAGE__.txt +6 -6
  34. package/dist/ui/static/launch.html +1 -1
  35. package/dist/ui/static/launch.txt +6 -6
  36. package/dist/ui/static/local-knowledge/__next._full.txt +6 -6
  37. package/dist/ui/static/local-knowledge/__next._index.txt +1 -1
  38. package/dist/ui/static/local-knowledge/__next._tree.txt +1 -1
  39. package/dist/ui/static/local-knowledge/__next.local-knowledge.__PAGE__.txt +6 -6
  40. package/dist/ui/static/local-knowledge/capsule/__next._full.txt +1 -1
  41. package/dist/ui/static/local-knowledge/capsule/__next._index.txt +1 -1
  42. package/dist/ui/static/local-knowledge/capsule/__next._tree.txt +1 -1
  43. package/dist/ui/static/local-knowledge/capsule/__next.local-knowledge.capsule.__PAGE__.txt +1 -1
  44. package/dist/ui/static/local-knowledge/capsule.html +1 -1
  45. package/dist/ui/static/local-knowledge/capsule.txt +1 -1
  46. package/dist/ui/static/local-knowledge.html +1 -1
  47. package/dist/ui/static/local-knowledge.txt +6 -6
  48. package/node_modules/@oscharko-dev/keiko-activity-log/dist/reader/support-code-inventory.generated.d.ts +5 -0
  49. package/node_modules/@oscharko-dev/keiko-activity-log/dist/reader/support-code-inventory.generated.d.ts.map +1 -1
  50. package/node_modules/@oscharko-dev/keiko-activity-log/dist/reader/support-code-inventory.generated.js +6 -0
  51. package/node_modules/@oscharko-dev/keiko-activity-log/dist/reader/support-registry-history.generated.d.ts +23 -16
  52. package/node_modules/@oscharko-dev/keiko-activity-log/dist/reader/support-registry-history.generated.d.ts.map +1 -1
  53. package/node_modules/@oscharko-dev/keiko-activity-log/dist/reader/support-registry-history.generated.js +25 -17
  54. package/node_modules/@oscharko-dev/keiko-activity-log/package.json +3 -3
  55. package/node_modules/@oscharko-dev/keiko-cli/package.json +15 -15
  56. package/node_modules/@oscharko-dev/keiko-connectors/dist/version.d.ts +1 -1
  57. package/node_modules/@oscharko-dev/keiko-connectors/dist/version.js +1 -1
  58. package/node_modules/@oscharko-dev/keiko-connectors/package.json +3 -3
  59. package/node_modules/@oscharko-dev/keiko-contracts/dist/activity-log-failure-class-contracts.d.ts +4 -4
  60. package/node_modules/@oscharko-dev/keiko-contracts/dist/activity-log-failure-class-contracts.d.ts.map +1 -1
  61. package/node_modules/@oscharko-dev/keiko-contracts/dist/activity-log-failure-class-contracts.js +0 -4
  62. package/node_modules/@oscharko-dev/keiko-contracts/dist/activity-log-failure-class-coverage.generated.json +1 -49
  63. package/node_modules/@oscharko-dev/keiko-contracts/dist/activity-log-identity.generated.d.ts +1 -1
  64. package/node_modules/@oscharko-dev/keiko-contracts/dist/activity-log-identity.generated.js +1 -1
  65. package/node_modules/@oscharko-dev/keiko-contracts/dist/activity-log-operation-surfaces.generated.json +0 -1
  66. package/node_modules/@oscharko-dev/keiko-contracts/dist/activity-log-operations.generated.d.ts +0 -42
  67. package/node_modules/@oscharko-dev/keiko-contracts/dist/activity-log-operations.generated.d.ts.map +1 -1
  68. package/node_modules/@oscharko-dev/keiko-contracts/dist/activity-log-operations.generated.js +0 -43
  69. package/node_modules/@oscharko-dev/keiko-contracts/dist/coding-workbench.d.ts.map +1 -1
  70. package/node_modules/@oscharko-dev/keiko-contracts/dist/version.d.ts +2 -2
  71. package/node_modules/@oscharko-dev/keiko-contracts/dist/version.js +2 -2
  72. package/node_modules/@oscharko-dev/keiko-contracts/package.json +1 -1
  73. package/node_modules/@oscharko-dev/keiko-evaluations/package.json +9 -9
  74. package/node_modules/@oscharko-dev/keiko-evidence/dist/version.d.ts +1 -1
  75. package/node_modules/@oscharko-dev/keiko-evidence/dist/version.js +1 -1
  76. package/node_modules/@oscharko-dev/keiko-evidence/package.json +4 -4
  77. package/node_modules/@oscharko-dev/keiko-git/dist/version.d.ts +1 -1
  78. package/node_modules/@oscharko-dev/keiko-git/dist/version.js +1 -1
  79. package/node_modules/@oscharko-dev/keiko-git/package.json +1 -1
  80. package/node_modules/@oscharko-dev/keiko-harness/dist/version.d.ts +1 -1
  81. package/node_modules/@oscharko-dev/keiko-harness/dist/version.js +1 -1
  82. package/node_modules/@oscharko-dev/keiko-harness/package.json +7 -7
  83. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/version.d.ts +1 -1
  84. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/version.js +1 -1
  85. package/node_modules/@oscharko-dev/keiko-local-knowledge/package.json +5 -5
  86. package/node_modules/@oscharko-dev/keiko-mcp/package.json +3 -3
  87. package/node_modules/@oscharko-dev/keiko-memory-capture/dist/version.d.ts +1 -1
  88. package/node_modules/@oscharko-dev/keiko-memory-capture/dist/version.js +1 -1
  89. package/node_modules/@oscharko-dev/keiko-memory-capture/package.json +3 -3
  90. package/node_modules/@oscharko-dev/keiko-memory-consolidation/dist/version.d.ts +1 -1
  91. package/node_modules/@oscharko-dev/keiko-memory-consolidation/dist/version.js +1 -1
  92. package/node_modules/@oscharko-dev/keiko-memory-consolidation/package.json +3 -3
  93. package/node_modules/@oscharko-dev/keiko-memory-governance/dist/version.d.ts +1 -1
  94. package/node_modules/@oscharko-dev/keiko-memory-governance/dist/version.js +1 -1
  95. package/node_modules/@oscharko-dev/keiko-memory-governance/package.json +3 -3
  96. package/node_modules/@oscharko-dev/keiko-memory-retrieval/dist/version.d.ts +1 -1
  97. package/node_modules/@oscharko-dev/keiko-memory-retrieval/dist/version.js +1 -1
  98. package/node_modules/@oscharko-dev/keiko-memory-retrieval/package.json +3 -3
  99. package/node_modules/@oscharko-dev/keiko-memory-vault/dist/version.d.ts +1 -1
  100. package/node_modules/@oscharko-dev/keiko-memory-vault/dist/version.js +1 -1
  101. package/node_modules/@oscharko-dev/keiko-memory-vault/package.json +3 -3
  102. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/http.d.ts +1 -0
  103. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/http.d.ts.map +1 -1
  104. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/http.js +43 -4
  105. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/rerank-adapter.d.ts +3 -0
  106. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/rerank-adapter.d.ts.map +1 -1
  107. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/rerank-adapter.js +5 -2
  108. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/version.d.ts +1 -1
  109. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/version.js +1 -1
  110. package/node_modules/@oscharko-dev/keiko-model-gateway/package.json +4 -4
  111. package/node_modules/@oscharko-dev/keiko-quality-intelligence/package.json +3 -3
  112. package/node_modules/@oscharko-dev/keiko-sandbox/package.json +2 -2
  113. package/node_modules/@oscharko-dev/keiko-sdk/package.json +9 -9
  114. package/node_modules/@oscharko-dev/keiko-security/dist/version.d.ts +1 -1
  115. package/node_modules/@oscharko-dev/keiko-security/dist/version.js +1 -1
  116. package/node_modules/@oscharko-dev/keiko-security/package.json +2 -2
  117. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/devLaneRuntimeProcessBackend.d.ts.map +1 -1
  118. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/devLaneRuntimeProcessBackend.js +10 -13
  119. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/nativeRuntimeProcessBackend.d.ts.map +1 -1
  120. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/nativeRuntimeProcessBackend.js +4 -2
  121. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/productionCodingRuntimeResolver.d.ts.map +1 -1
  122. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/productionCodingRuntimeResolver.js +15 -1
  123. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/productionRuntimeWorkspaceAuthority.d.ts +1 -0
  124. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/productionRuntimeWorkspaceAuthority.d.ts.map +1 -1
  125. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/runtimeGatewayProcessSandbox.d.ts +8 -0
  126. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/runtimeGatewayProcessSandbox.d.ts.map +1 -1
  127. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/runtimeGatewayProcessSandbox.js +10 -0
  128. package/node_modules/@oscharko-dev/keiko-server/dist/coding-sidecar-gateway.d.ts +8 -0
  129. package/node_modules/@oscharko-dev/keiko-server/dist/coding-sidecar-gateway.d.ts.map +1 -1
  130. package/node_modules/@oscharko-dev/keiko-server/dist/coding-sidecar-gateway.js +125 -31
  131. package/node_modules/@oscharko-dev/keiko-server/dist/deps.d.ts.map +1 -1
  132. package/node_modules/@oscharko-dev/keiko-server/dist/deps.js +12 -3
  133. package/node_modules/@oscharko-dev/keiko-server/dist/gateway-readiness.d.ts +21 -11
  134. package/node_modules/@oscharko-dev/keiko-server/dist/gateway-readiness.d.ts.map +1 -1
  135. package/node_modules/@oscharko-dev/keiko-server/dist/gateway-readiness.js +126 -206
  136. package/node_modules/@oscharko-dev/keiko-server/dist/gateway-setup.d.ts.map +1 -1
  137. package/node_modules/@oscharko-dev/keiko-server/dist/gateway-setup.js +18 -7
  138. package/node_modules/@oscharko-dev/keiko-server/dist/gateway-startup.d.ts.map +1 -1
  139. package/node_modules/@oscharko-dev/keiko-server/dist/gateway-startup.js +8 -5
  140. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-rerank-facade.d.ts.map +1 -1
  141. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-rerank-facade.js +7 -0
  142. package/node_modules/@oscharko-dev/keiko-server/dist/memory-embedding.d.ts +2 -1
  143. package/node_modules/@oscharko-dev/keiko-server/dist/memory-embedding.d.ts.map +1 -1
  144. package/node_modules/@oscharko-dev/keiko-server/dist/memory-embedding.js +10 -5
  145. package/node_modules/@oscharko-dev/keiko-server/package.json +24 -24
  146. package/node_modules/@oscharko-dev/keiko-tool-catalog/package.json +3 -3
  147. package/node_modules/@oscharko-dev/keiko-tools/dist/version.d.ts +1 -1
  148. package/node_modules/@oscharko-dev/keiko-tools/dist/version.js +1 -1
  149. package/node_modules/@oscharko-dev/keiko-tools/package.json +7 -7
  150. package/node_modules/@oscharko-dev/keiko-verification/package.json +5 -5
  151. package/node_modules/@oscharko-dev/keiko-workflows/package.json +10 -10
  152. package/node_modules/@oscharko-dev/keiko-workspace/dist/version.d.ts +1 -1
  153. package/node_modules/@oscharko-dev/keiko-workspace/dist/version.js +1 -1
  154. package/node_modules/@oscharko-dev/keiko-workspace/package.json +3 -3
  155. package/package.json +28 -28
  156. package/release-impact.catalog.json +66 -0
  157. package/vendor/oscharko-dev-keiko-activity-log-1.3.5.tgz +0 -0
  158. package/vendor/{oscharko-dev-keiko-cli-1.3.4.tgz → oscharko-dev-keiko-cli-1.3.5.tgz} +0 -0
  159. package/vendor/{oscharko-dev-keiko-connectors-1.3.4.tgz → oscharko-dev-keiko-connectors-1.3.5.tgz} +0 -0
  160. package/vendor/oscharko-dev-keiko-contracts-1.3.5.tgz +0 -0
  161. package/vendor/{oscharko-dev-keiko-evaluations-1.3.4.tgz → oscharko-dev-keiko-evaluations-1.3.5.tgz} +0 -0
  162. package/vendor/{oscharko-dev-keiko-evidence-1.3.4.tgz → oscharko-dev-keiko-evidence-1.3.5.tgz} +0 -0
  163. package/vendor/{oscharko-dev-keiko-git-1.3.4.tgz → oscharko-dev-keiko-git-1.3.5.tgz} +0 -0
  164. package/vendor/{oscharko-dev-keiko-harness-1.3.4.tgz → oscharko-dev-keiko-harness-1.3.5.tgz} +0 -0
  165. package/vendor/{oscharko-dev-keiko-local-knowledge-1.3.4.tgz → oscharko-dev-keiko-local-knowledge-1.3.5.tgz} +0 -0
  166. package/vendor/{oscharko-dev-keiko-mcp-1.3.4.tgz → oscharko-dev-keiko-mcp-1.3.5.tgz} +0 -0
  167. package/vendor/{oscharko-dev-keiko-memory-capture-1.3.4.tgz → oscharko-dev-keiko-memory-capture-1.3.5.tgz} +0 -0
  168. package/vendor/{oscharko-dev-keiko-memory-consolidation-1.3.4.tgz → oscharko-dev-keiko-memory-consolidation-1.3.5.tgz} +0 -0
  169. package/vendor/{oscharko-dev-keiko-memory-governance-1.3.4.tgz → oscharko-dev-keiko-memory-governance-1.3.5.tgz} +0 -0
  170. package/vendor/{oscharko-dev-keiko-memory-retrieval-1.3.4.tgz → oscharko-dev-keiko-memory-retrieval-1.3.5.tgz} +0 -0
  171. package/vendor/{oscharko-dev-keiko-memory-vault-1.3.4.tgz → oscharko-dev-keiko-memory-vault-1.3.5.tgz} +0 -0
  172. package/vendor/oscharko-dev-keiko-model-gateway-1.3.5.tgz +0 -0
  173. package/vendor/{oscharko-dev-keiko-quality-intelligence-1.3.4.tgz → oscharko-dev-keiko-quality-intelligence-1.3.5.tgz} +0 -0
  174. package/vendor/{oscharko-dev-keiko-sandbox-1.3.4.tgz → oscharko-dev-keiko-sandbox-1.3.5.tgz} +0 -0
  175. package/vendor/oscharko-dev-keiko-sdk-1.3.5.tgz +0 -0
  176. package/vendor/{oscharko-dev-keiko-security-1.3.4.tgz → oscharko-dev-keiko-security-1.3.5.tgz} +0 -0
  177. package/vendor/oscharko-dev-keiko-server-1.3.5.tgz +0 -0
  178. package/vendor/{oscharko-dev-keiko-tool-catalog-1.3.4.tgz → oscharko-dev-keiko-tool-catalog-1.3.5.tgz} +0 -0
  179. package/vendor/{oscharko-dev-keiko-tools-1.3.4.tgz → oscharko-dev-keiko-tools-1.3.5.tgz} +0 -0
  180. package/vendor/{oscharko-dev-keiko-verification-1.3.4.tgz → oscharko-dev-keiko-verification-1.3.5.tgz} +0 -0
  181. package/vendor/{oscharko-dev-keiko-workflows-1.3.4.tgz → oscharko-dev-keiko-workflows-1.3.5.tgz} +0 -0
  182. package/vendor/{oscharko-dev-keiko-workspace-1.3.4.tgz → oscharko-dev-keiko-workspace-1.3.5.tgz} +0 -0
  183. package/dist/ui/static/_next/static/chunks/0_djzjuth9fin.js +0 -1
  184. package/dist/ui/static/_next/static/chunks/1fcza2wdia5qm.js +0 -1
  185. package/dist/ui/static/_next/static/chunks/3vhvlyplc36t6.js +0 -1
  186. package/vendor/oscharko-dev-keiko-activity-log-1.3.4.tgz +0 -0
  187. package/vendor/oscharko-dev-keiko-contracts-1.3.4.tgz +0 -0
  188. package/vendor/oscharko-dev-keiko-model-gateway-1.3.4.tgz +0 -0
  189. package/vendor/oscharko-dev-keiko-sdk-1.3.4.tgz +0 -0
  190. package/vendor/oscharko-dev-keiko-server-1.3.4.tgz +0 -0
  191. /package/dist/ui/static/_next/static/{Ytdn01XusgvfUzdjNVXIY → DvyH4zbpyM3K-9QY4w0ah}/_buildManifest.js +0 -0
  192. /package/dist/ui/static/_next/static/{Ytdn01XusgvfUzdjNVXIY → DvyH4zbpyM3K-9QY4w0ah}/_clientMiddlewareManifest.js +0 -0
  193. /package/dist/ui/static/_next/static/{Ytdn01XusgvfUzdjNVXIY → DvyH4zbpyM3K-9QY4w0ah}/_ssgManifest.js +0 -0
@@ -167,35 +167,6 @@ const GATEWAY_READINESS_BUSY_RETAINED_OPERATION = defineActivityLogOperation({
167
167
  proofIds: ["gateway.readiness.busy-retained.line"],
168
168
  releaseImpact: "patch",
169
169
  });
170
- // #4103 (owner decision 2026-10-29): background readiness probes run only while a model is in use.
171
- // A verified model without a conversation request for `CONVERSATION_RENEWAL_IDLE_MS` is no longer
172
- // renewed (ready) or recovered (failed); this line records the pause, so a timeline shows why
173
- // the model's next request verifies it on demand. `idleMs` is absent when the model was never used
174
- // since its configuration was applied.
175
- const GATEWAY_READINESS_RENEWAL_PAUSED_OPERATION = defineActivityLogOperation({
176
- contractKind: "activity-log-operation",
177
- schemaVersion: 1,
178
- op: "gateway.readiness.renewal.paused",
179
- category: "gateway",
180
- owner: "keiko-server",
181
- emitter: "gateway-readiness.logConversationRenewalPaused",
182
- fields: {
183
- ...GATEWAY_READINESS_MODEL_ID_FIELDS,
184
- paused: {
185
- type: "string",
186
- dataClass: "closed-enum",
187
- required: true,
188
- values: ["renewal", "recovery"],
189
- },
190
- idleMs: { type: "integer", dataClass: "duration", required: false },
191
- },
192
- causal: "correlation",
193
- lifecycle: "state",
194
- analyzerProjection: "timeline",
195
- failureClasses: ["gateway-readiness"],
196
- proofIds: ["gateway.readiness.renewal.paused.line"],
197
- releaseImpact: "patch",
198
- });
199
170
  // Every readiness check a person starts in the settings dialog. The Coding Workbench's automatic
200
171
  // run and the on-demand probe a conversation entry point runs keep the automatic operations
201
172
  // (`gateway.readiness.automatic.*`). Only the automatic run used to leave a line, so a check run
@@ -609,6 +580,9 @@ async function probeConfiguredEmbedding(deps, config, provider, correlationId) {
609
580
  ...(deps.gatewayReadinessSignal === undefined ? {} : { signal: deps.gatewayReadinessSignal }),
610
581
  timeoutMs: provider.timeoutMs,
611
582
  egress: config.egress,
583
+ // Every retry and failure line of this probe is recorded under its correlation.
584
+ log: deps.activityLog ?? processServerLogSink(),
585
+ logContext: { correlationId },
612
586
  });
613
587
  settleGatewayProbeSpend(reservation, undefined);
614
588
  if (!outcome.ok) {
@@ -1498,7 +1472,9 @@ function reconcileContextWindowReadiness(deps, report, correlationId) {
1498
1472
  const WORKBENCH_REPROBE_COOLDOWN_MS = 6 * 60 * 60 * 1_000;
1499
1473
  // #3591 (1.1.7): a probe the gateway never answered is not a verdict. It used to hold the six-hour
1500
1474
  // cooldown, so one slow answer at peak load locked the Workbench out with no operator remedy but
1501
- // a restart. An inconclusive run is retried on the next Workbench read after this much quiet.
1475
+ // a restart. An inconclusive run is checked again when someone asks — the Workbench opening or a
1476
+ // model chosen in its picker, a page load, a restart — never by a passive read or a timer
1477
+ // (customer 1.3.4); this much quiet only absorbs a burst of such requests.
1502
1478
  export const WORKBENCH_INCONCLUSIVE_REPROBE_COOLDOWN_MS = 60_000;
1503
1479
  const workbenchProbes = new Map();
1504
1480
  // ONE run at a time. Persisting a conclusion bumps the configuration generation, and a readiness
@@ -1557,17 +1533,14 @@ export async function initializeLiteLlmCodingReadiness(deps, correlationId) {
1557
1533
  if (config === undefined)
1558
1534
  return;
1559
1535
  const targets = liteLlmWorkbenchProbeTargets(config);
1560
- await Promise.all(targets.map((target) => enqueueWorkbenchProbe(deps, config, target, correlationId, "startup")));
1536
+ await Promise.all(targets.map((target) => enqueueWorkbenchProbe(deps, config, target, correlationId, "startup", {
1537
+ retryUnanswered: true,
1538
+ })));
1561
1539
  }
1562
1540
  function liteLlmWorkbenchProbeTargets(config) {
1563
1541
  return workbenchProbeTargets(config).filter((target) => config.providers.find((candidate) => candidate.modelId === target.modelId)?.tokenCounter ===
1564
1542
  "litellm");
1565
1543
  }
1566
- export function isLiteLlmCodingReadinessPending(deps) {
1567
- const config = deps.gatewayConfig?.current();
1568
- return (config?.providers.some((provider) => provider.tokenCounter === "litellm" &&
1569
- isCodingWorkbenchProbePending(config, provider.modelId)) ?? false);
1570
- }
1571
1544
  function workbenchProbeTargets(config) {
1572
1545
  return listConfiguredCapabilities(config).flatMap((capability) => {
1573
1546
  const need = workbenchProbesNeeded(capability);
@@ -1575,28 +1548,27 @@ function workbenchProbeTargets(config) {
1575
1548
  });
1576
1549
  }
1577
1550
  // Keyed by the deployment's identity, not the configuration generation: every conclusion this
1578
- // persists bumps the generation, which would otherwise lift the cooldown of every other model.
1551
+ // persists bumps the generation, which would otherwise lift the cooldown of every other model and
1552
+ // repeat the startup check of every model that did not answer (customer 1.3.4).
1579
1553
  // The configured timeout is part of the key (#3591): an operator who raises it after a timed-out
1580
1554
  // probe has changed what the probe can prove and gets a fresh attempt at once.
1581
- function workbenchProbeKey(config, modelId) {
1555
+ function deploymentProbeKey(config, modelId) {
1582
1556
  const provider = config.providers.find((candidate) => candidate.modelId === modelId);
1583
1557
  return provider === undefined
1584
1558
  ? modelId
1585
1559
  : `${toolCallingConfigurationFingerprint(provider)}:${String(provider.timeoutMs)}`;
1586
1560
  }
1587
1561
  /**
1588
- * Whether the Workbench's automatic verification of this model is still open: the probe is
1589
- * running, or it ended without a verdict (the gateway never answered) and runs again after its
1590
- * short cooldown. Only a verdict — proven or refuted — closes it, so a Workbench that re-reads its
1591
- * profile while this holds keeps reading until the gateway has actually answered.
1562
+ * Whether the Workbench's automatic verification of this model is running right now: queued or in
1563
+ * flight. A probe the gateway never answered is settled: nothing runs until someone asks again, so
1564
+ * the Workbench never shows a check that is not happening (customer 1.3.4).
1592
1565
  */
1593
1566
  export function isCodingWorkbenchProbePending(config, modelId) {
1594
1567
  const model = listConfiguredCapabilities(config).find((candidate) => candidate.id === modelId);
1595
1568
  if (model === undefined || model.toolCallingVerification?.status === "unsupported")
1596
1569
  return false;
1597
- const entry = workbenchProbes.get(workbenchProbeKey(config, modelId));
1598
- return (entry !== undefined &&
1599
- (!entry.settled || entry.outcome === "inconclusive" || entry.outcome === "stale"));
1570
+ const entry = workbenchProbes.get(deploymentProbeKey(config, modelId));
1571
+ return entry !== undefined && !entry.settled;
1600
1572
  }
1601
1573
  /**
1602
1574
  * Whether the server is renewing this chat model's tool-call proof right now (#3905): the proof
@@ -1614,6 +1586,19 @@ export function isToolCallingRenewalPending(config, modelId) {
1614
1586
  codingWorkbenchModelEligibility(model) === "tool-calling-unverified" &&
1615
1587
  isCodingWorkbenchProbePending(config, modelId));
1616
1588
  }
1589
+ /**
1590
+ * Whether the latest Workbench verification of this model ended without an answer from the gateway
1591
+ * (a timeout, a busy or unreachable gateway). That is no verdict: the model is neither proven nor
1592
+ * refuted, and it is checked again when someone asks.
1593
+ */
1594
+ export function isCodingWorkbenchProbeUnanswered(config, modelId) {
1595
+ const entry = workbenchProbes.get(deploymentProbeKey(config, modelId));
1596
+ return entry?.settled === true && entry.outcome === "inconclusive";
1597
+ }
1598
+ /** Whether any model the Workbench could still elect ended its latest verification unanswered. */
1599
+ export function isAnyCodingWorkbenchProbeUnanswered(config) {
1600
+ return config.providers.some((provider) => isCodingWorkbenchProbeUnanswered(config, provider.modelId));
1601
+ }
1617
1602
  /** Whether any model the Workbench could still elect has its verification open. */
1618
1603
  export function isAnyCodingWorkbenchProbePending(config) {
1619
1604
  return config.providers.some((provider) => isCodingWorkbenchProbePending(config, provider.modelId));
@@ -1664,10 +1649,22 @@ async function runWorkbenchProbe(deps, target, correlationId, trigger) {
1664
1649
  return "inconclusive";
1665
1650
  }
1666
1651
  }
1667
- function enqueueWorkbenchProbe(deps, config, target, correlationId, trigger, prioritized = false) {
1668
- const key = workbenchProbeKey(config, target.modelId);
1652
+ // A passive read runs a model's first probe, a stale one and a verdict past its cooldown; only a
1653
+ // request that asks retries a probe the gateway never answered.
1654
+ function workbenchProbeDue(entry, retryUnanswered) {
1655
+ if (!entry.settled)
1656
+ return false;
1657
+ if (entry.outcome === "stale")
1658
+ return true;
1659
+ if (entry.outcome === "inconclusive" && !retryUnanswered)
1660
+ return false;
1661
+ return Date.now() - entry.at >= entry.cooldownMs;
1662
+ }
1663
+ function enqueueWorkbenchProbe(deps, config, target, correlationId, trigger, request = {}) {
1664
+ const prioritized = request.prioritized ?? false;
1665
+ const key = deploymentProbeKey(config, target.modelId);
1669
1666
  const known = workbenchProbes.get(key);
1670
- if (known !== undefined && (!known.settled || Date.now() - known.at < known.cooldownMs)) {
1667
+ if (known !== undefined && !workbenchProbeDue(known, request.retryUnanswered ?? false)) {
1671
1668
  known.prioritized ||= prioritized;
1672
1669
  return known.promise;
1673
1670
  }
@@ -1700,6 +1697,8 @@ function createWorkbenchProbeEntry(deps, target, correlationId, trigger, priorit
1700
1697
  entry.at = Date.now();
1701
1698
  entry.cooldownMs = workbenchProbeCooldownMs(outcome);
1702
1699
  finish();
1700
+ if (outcome === "stale")
1701
+ requeueStaleWorkbenchProbe(deps, target.modelId, correlationId, trigger);
1703
1702
  },
1704
1703
  prioritized,
1705
1704
  running: false,
@@ -1709,6 +1708,17 @@ function createWorkbenchProbeEntry(deps, target, correlationId, trigger, priorit
1709
1708
  };
1710
1709
  return entry;
1711
1710
  }
1711
+ // The configuration changed under a proof that succeeded: that change is the reason to prove the
1712
+ // model again, at once and once, never a timer.
1713
+ function requeueStaleWorkbenchProbe(deps, modelId, correlationId, trigger) {
1714
+ const config = deps.gatewayConfig?.current();
1715
+ const target = config === undefined
1716
+ ? undefined
1717
+ : workbenchProbeTargets(config).find((candidate) => candidate.modelId === modelId);
1718
+ if (config === undefined || target === undefined)
1719
+ return;
1720
+ void enqueueWorkbenchProbe(deps, config, target, correlationId, trigger);
1721
+ }
1712
1722
  function workbenchProbeCooldownMs(outcome) {
1713
1723
  if (outcome === "stale")
1714
1724
  return 0;
@@ -1750,7 +1760,7 @@ function performNextWorkbenchProbe(resolve, reject) {
1750
1760
  })
1751
1761
  .catch(reject);
1752
1762
  }
1753
- export async function ensureCodingWorkbenchContextWindows(deps, electedModelId, correlationId) {
1763
+ export async function ensureCodingWorkbenchContextWindows(deps, electedModelId, correlationId, retryUnanswered = false) {
1754
1764
  const config = deps.gatewayConfig?.current();
1755
1765
  if (config === undefined)
1756
1766
  return;
@@ -1765,7 +1775,10 @@ export async function ensureCodingWorkbenchContextWindows(deps, electedModelId,
1765
1775
  ];
1766
1776
  const queued = new Map(ordered.map((target) => [
1767
1777
  target.modelId,
1768
- enqueueWorkbenchProbe(deps, config, target, id, "profile-read", target.modelId === electedModelId),
1778
+ enqueueWorkbenchProbe(deps, config, target, id, "profile-read", {
1779
+ prioritized: target.modelId === electedModelId,
1780
+ retryUnanswered,
1781
+ }),
1769
1782
  ]));
1770
1783
  // A named model waits for ITS proof only — never for another model's. Without a name (the
1771
1784
  // Workbench could elect none yet) the first queued model is the one it would elect next.
@@ -1790,11 +1803,8 @@ function conversationQueue(holder) {
1790
1803
  controller: new AbortController(),
1791
1804
  initializedGeneration: -1,
1792
1805
  pending: [],
1793
- retries: new Map(),
1794
- retryable: new Map(),
1795
1806
  probeSettledAt: new Map(),
1796
- lastUsedAt: new Map(),
1797
- verified: new Set(),
1807
+ startupChecked: new Map(),
1798
1808
  };
1799
1809
  conversationQueues.set(holder, queue);
1800
1810
  }
@@ -1857,9 +1867,6 @@ export async function stopConfiguredConversationReadiness(deps) {
1857
1867
  const workbench = [...workbenchProbes.values()].filter((entry) => entry.holder === holder);
1858
1868
  for (const entry of workbench)
1859
1869
  entry.cancelQueued();
1860
- for (const timer of queue.retries.values())
1861
- clearTimeout(timer);
1862
- queue.retries.clear();
1863
1870
  drainConversationQueue(queue);
1864
1871
  // Each probe reports its own failure; this barrier keeps those reports ahead of shutdown sealing.
1865
1872
  await Promise.allSettled([
@@ -1880,15 +1887,16 @@ export function withReadinessParentCorrelation(deps, parentCorrelationId) {
1880
1887
  },
1881
1888
  };
1882
1889
  }
1883
- function monitorConversationInitialization(deps, modelId, generation, parentCorrelationId, attempt) {
1890
+ // The one startup check of a model: its result stands until a request or a selection needs a fresh
1891
+ // answer. Nothing re-probes in the background (owner decision 2026-11-01, customer 1.3.4).
1892
+ function checkConversationModelOnce(deps, modelId, generation, parentCorrelationId) {
1884
1893
  const holder = deps.gatewayConfig;
1885
1894
  if (holder?.generation() !== generation || conversationQueue(holder).disposed)
1886
1895
  return;
1887
1896
  const causalParent = parentCorrelationId ?? holder.initializationCorrelationId;
1888
1897
  const probeCorrelationId = newCorrelationId();
1889
1898
  const observedDeps = withReadinessParentCorrelation(deps, causalParent);
1890
- void ensureOnDemandConversationReadiness(observedDeps, modelId, probeCorrelationId, attempt)
1891
- .catch((error) => {
1899
+ void ensureOnDemandConversationReadiness(observedDeps, modelId, probeCorrelationId, 1).catch((error) => {
1892
1900
  emitServerDiagnostic(deps.diagnostics, serverDiagnosticFromError({
1893
1901
  correlationId: probeCorrelationId,
1894
1902
  parentCorrelationId: causalParent,
@@ -1898,133 +1906,56 @@ function monitorConversationInitialization(deps, modelId, generation, parentCorr
1898
1906
  summary: "A gateway readiness probe could not be completed.",
1899
1907
  redact: (message) => String(deps.redactor(message)),
1900
1908
  }));
1901
- })
1902
- .then(() => {
1903
- scheduleConversationRecovery(deps, modelId, generation, causalParent, attempt);
1904
1909
  });
1905
1910
  }
1906
- const MAX_CONVERSATION_RECOVERY_DELAY_MS = 5 * 60_000;
1907
- function conversationReadinessRenewAfterMs() {
1908
- // Renewal cadence is independent of the provider deadline. Subtracting a longer deadline
1909
- // from freshness can make this negative and cause continuous successful re-probes (#4038).
1910
- return 2 * 60_000;
1911
- }
1912
- function conversationRecoveryDelay(deps, holder, modelId, attempt) {
1913
- const observation = holder.verifiedCapability(modelId);
1914
- if (currentConversationReady(deps, modelId) && observation !== undefined)
1915
- return (Math.max(0, conversationReadinessRenewAfterMs() - conversationReadinessAgeMs(observation)) + 1);
1916
- return ((conversationQueue(holder).retryable.get(modelId) === false
1917
- ? MAX_CONVERSATION_RECOVERY_DELAY_MS
1918
- : Math.min(NOT_READY_REPROBE_COOLDOWN_MS * 2 ** Math.min(attempt - 1, 4), MAX_CONVERSATION_RECOVERY_DELAY_MS)) + 1);
1919
- }
1920
- function scheduleConversationRecovery(deps, modelId, generation, parentCorrelationId, attempt) {
1921
- const holder = deps.gatewayConfig;
1922
- if (holder === undefined)
1923
- return;
1924
- const queue = conversationQueue(holder);
1925
- if (queue.disposed ||
1926
- holder.generation() !== generation ||
1927
- holder.current()?.providers.some((provider) => provider.modelId === modelId) !== true)
1928
- return;
1929
- clearTimeout(queue.retries.get(modelId));
1930
- queue.retries.delete(modelId);
1931
- const ready = currentConversationReady(deps, modelId);
1932
- if (ready)
1933
- queue.verified.add(modelId);
1934
- if (conversationModelIdle(queue, modelId)) {
1935
- logConversationRenewalPaused(deps, queue, modelId, ready, parentCorrelationId ?? holder.initializationCorrelationId);
1936
- return;
1937
- }
1938
- const nextAttempt = ready ? 1 : attempt + 1;
1939
- const retry = setTimeout(() => {
1940
- queue.retries.delete(modelId);
1941
- monitorConversationInitialization(deps, modelId, generation, parentCorrelationId, nextAttempt);
1942
- }, conversationRecoveryDelay(deps, holder, modelId, attempt));
1943
- retry.unref();
1944
- queue.retries.set(modelId, retry);
1945
- }
1946
- // #4103: a configured model nobody uses is not probed. Background renewal and recovery continue for
1947
- // this long after the model's last conversation request; after it, the model's success
1948
- // expires at the five-minute boundary and its next request starts the single on-demand probe.
1949
- export const CONVERSATION_RENEWAL_IDLE_MS = 15 * 60_000;
1950
- function conversationModelIdle(queue, modelId) {
1951
- if (!queue.verified.has(modelId))
1952
- return false;
1953
- const usedAt = queue.lastUsedAt.get(modelId);
1954
- if (usedAt === undefined)
1955
- return true;
1956
- // A clock that went backwards cannot date the use; pausing is the safe answer, because the next
1957
- // request verifies the model on demand.
1958
- const elapsedMs = Date.now() - usedAt;
1959
- return !(elapsedMs >= 0 && elapsedMs < CONVERSATION_RENEWAL_IDLE_MS);
1960
- }
1961
- function logConversationRenewalPaused(deps, queue, modelId, ready, parentCorrelationId) {
1962
- const usedAt = queue.lastUsedAt.get(modelId);
1963
- const idleMs = usedAt === undefined ? undefined : Date.now() - usedAt;
1964
- (deps.activityLog ?? processServerLogSink()).write(activityLogEvent(GATEWAY_READINESS_RENEWAL_PAUSED_OPERATION, {
1965
- correlationId: newCorrelationId(),
1966
- ...(parentCorrelationId === undefined ? {} : { parentCorrelationId }),
1967
- }, {
1968
- ...modelIdEvidence(modelId),
1969
- paused: ready ? "renewal" : "recovery",
1970
- ...(idleMs === undefined || idleMs < 0 ? {} : { idleMs }),
1971
- }));
1972
- }
1973
- function configuredConversationModel(holder, modelId) {
1974
- return holder.current()?.providers.some((provider) => provider.modelId === modelId) === true;
1975
- }
1976
- // A request that needs the model marks it in use; only configured models are recorded, so a request
1977
- // cannot grow the map with names the gateway does not serve.
1978
- function noteConversationUse(holder, modelId) {
1979
- const queue = conversationQueue(holder);
1980
- if (queue.disposed || !configuredConversationModel(holder, modelId))
1981
- return;
1982
- resetConversationGeneration(queue, holder.generation());
1983
- queue.lastUsedAt.set(modelId, Date.now());
1984
- }
1985
- // After a request, a model whose background probes paused while it was idle renews (or recovers)
1986
- // again on the existing schedule: a timer, never a probe of its own, so a request still adds no
1987
- // readiness request for a model it cannot date. An armed timer or a probe in flight owns it.
1988
- function resumeConversationRenewal(deps, holder, modelId, correlationId) {
1989
- const queue = conversationQueue(holder);
1990
- const generation = holder.generation();
1991
- if (queue.disposed ||
1992
- queue.retries.has(modelId) ||
1993
- readinessProbesFor(holder).has(`${String(generation)}:${modelId}`))
1994
- return;
1995
- scheduleConversationRecovery(deps, modelId, generation, correlationId ?? holder.initializationCorrelationId, 1);
1996
- }
1997
1911
  function resetConversationGeneration(queue, generation) {
1998
1912
  if (queue.initializedGeneration === generation)
1999
1913
  return;
2000
- for (const timer of queue.retries.values())
2001
- clearTimeout(timer);
2002
- queue.retries.clear();
2003
- queue.retryable.clear();
2004
1914
  queue.probeSettledAt.clear();
2005
- queue.lastUsedAt.clear();
2006
- queue.verified.clear();
2007
1915
  queue.initializedGeneration = generation;
2008
1916
  }
2009
- function initializeConversationModel(deps, holder, modelId, correlationId) {
2010
- if (readinessProbesFor(holder).has(`${String(holder.generation())}:${modelId}`))
1917
+ /** Whether a basic-chat check of this model is running now, in the current generation. */
1918
+ export function isConversationReadinessCheckRunning(deps, modelId) {
1919
+ const holder = deps.gatewayConfig;
1920
+ return (holder !== undefined &&
1921
+ readinessProbesFor(holder).has(`${String(holder.generation())}:${modelId}`));
1922
+ }
1923
+ // Startup checks a model this configuration generation has not answered for yet (ready or not),
1924
+ // once per deployment: a generation that only persisted another model's proof repeats no check.
1925
+ // A user-driven refresh (a page load) checks again every model that did not answer ready, within
1926
+ // the not-ready cooldown. A success that only expired stays usable, as in Chat, and is checked by
1927
+ // the request that uses it; nothing re-checks a model on a timer (customer 1.3.4).
1928
+ function initializeConversationModel(deps, holder, config, modelId, correlationId, recheck) {
1929
+ const generation = holder.generation();
1930
+ if (readinessProbesFor(holder).has(`${String(generation)}:${modelId}`))
2011
1931
  return;
2012
- const observation = holder.verifiedCapability(modelId);
2013
- const ready = currentConversationReady(deps, modelId);
2014
- const queue = conversationQueue(holder);
2015
- if (ready &&
2016
- observation !== undefined &&
2017
- conversationReadinessAgeMs(observation) < conversationReadinessRenewAfterMs()) {
2018
- if (!queue.retries.has(modelId))
2019
- scheduleConversationRecovery(deps, modelId, holder.generation(), correlationId, 1);
1932
+ const answer = answerThisGeneration(holder, modelId);
1933
+ if (recheck ? answer === true : answer !== undefined)
2020
1934
  return;
2021
- }
2022
- if (observation?.fields.conversationReady === false && queue.retries.has(modelId))
1935
+ const checked = conversationQueue(holder).startupChecked.get(modelId);
1936
+ if (!recheck && checked === conversationConnectionKey(config, modelId))
2023
1937
  return;
2024
- monitorConversationInitialization(deps, modelId, holder.generation(), correlationId, 1);
1938
+ checkConversationModelOnce(deps, modelId, generation, correlationId);
1939
+ }
1940
+ // Everything a chat check depends on: the provider's connection, credential included. Measured
1941
+ // capability (a persisted proof) lives beside it and changes nothing here. Compared for equality in
1942
+ // this process only and never logged, so the serialized entry is kept as is: a fast digest of a
1943
+ // credential would add no protection.
1944
+ function conversationConnectionKey(config, modelId) {
1945
+ const provider = config.providers.find((candidate) => candidate.modelId === modelId);
1946
+ return provider === undefined ? modelId : JSON.stringify(provider);
1947
+ }
1948
+ function answerThisGeneration(holder, modelId) {
1949
+ const observation = holder.verifiedCapability(modelId);
1950
+ return observation?.generation === holder.generation()
1951
+ ? observation.fields.conversationReady
1952
+ : undefined;
2025
1953
  }
2026
- /** Configuration-owned, rate-bounded background probes renew health and recover outages. */
2027
- export function initializeConfiguredConversationReadiness(deps, correlationId) {
1954
+ /**
1955
+ * Each configured chat model is checked once per connection, at startup; `recheck`
1956
+ * (a user-driven refresh) checks again the models that are not ready now.
1957
+ */
1958
+ export function initializeConfiguredConversationReadiness(deps, correlationId, recheck = false) {
2028
1959
  const holder = deps.gatewayConfig;
2029
1960
  if (holder === undefined)
2030
1961
  return;
@@ -2037,26 +1968,20 @@ export function initializeConfiguredConversationReadiness(deps, correlationId) {
2037
1968
  return;
2038
1969
  for (const model of listConfiguredCapabilities(config)) {
2039
1970
  if (model.kind === "chat")
2040
- initializeConversationModel(deps, holder, model.id, correlationId);
1971
+ initializeConversationModel(deps, holder, config, model.id, correlationId, recheck);
2041
1972
  }
2042
1973
  }
2043
1974
  /**
2044
1975
  * Fresh chat success adds no interactive readiness request. A running probe is joined; an expired
2045
1976
  * success or a failed observation outside its cooldown can share one fresh check through the
2046
- * existing two-slot queue. Background renewal and recovery use the same in-flight owner, so
2047
- * simultaneous requests cannot create a probe storm.
1977
+ * existing two-slot queue. The startup check uses the same in-flight owner, so simultaneous
1978
+ * requests cannot create a probe storm.
2048
1979
  */
2049
1980
  export async function awaitInitializedConversationReadiness(deps, modelId, correlationId) {
2050
1981
  const holder = deps.gatewayConfig;
2051
1982
  if (holder === undefined)
2052
1983
  return;
2053
- noteConversationUse(holder, modelId);
2054
- try {
2055
- await awaitConversationRequestReadiness(deps, holder, modelId, correlationId);
2056
- }
2057
- finally {
2058
- resumeConversationRenewal(deps, holder, modelId, correlationId);
2059
- }
1984
+ await awaitConversationRequestReadiness(deps, holder, modelId, correlationId);
2060
1985
  }
2061
1986
  async function awaitConversationRequestReadiness(deps, holder, modelId, correlationId) {
2062
1987
  if (currentConversationReady(deps, modelId))
@@ -2072,11 +1997,11 @@ async function awaitConversationRequestReadiness(deps, holder, modelId, correlat
2072
1997
  async function reprobeExpiredNotReadyModel(deps, holder, modelId, correlationId) {
2073
1998
  if (modelId.length === 0 || conversationQueue(holder).disposed)
2074
1999
  return;
2075
- const observation = holder.verifiedCapability(modelId);
2076
- const expiredSuccess = observation?.generation === holder.generation() &&
2077
- observation.fields.conversationReady === true &&
2078
- !currentConversationReady(deps, modelId);
2079
- if (!expiredSuccess && !notReadyCooldownElapsed(holder, modelId))
2000
+ // Only an observed failure waits out its cooldown. An expired success and a model that holds no
2001
+ // answer (its startup check never settled) are checked now: the request would otherwise wait for
2002
+ // a check nobody runs (customer 1.3.4).
2003
+ const observedFailure = notReadyObservationAgeMs(holder, modelId) !== undefined;
2004
+ if (observedFailure && !notReadyCooldownElapsed(holder, modelId))
2080
2005
  return;
2081
2006
  const requestCorrelationId = correlationId ?? newCorrelationId();
2082
2007
  // The probe's own lines carry the request's correlation id; a probe failure is reported once by
@@ -2098,8 +2023,8 @@ async function reprobeExpiredNotReadyModel(deps, holder, modelId, correlationId)
2098
2023
  // readiness twin of the 0.3.11 endless-indexing incident). It must not be re-probed on every
2099
2024
  // request either — each probe can burn the full provider timeout against a dead gateway. So a
2100
2025
  // current-generation non-ready observation answers the guard only within this window; after it,
2101
- // configuration-owned background recovery, or the first conversation request that needs the model,
2102
- // re-probes and either heals or refreshes the pin. Answered failures retain slow background recovery.
2026
+ // the first conversation request, Workbench read or page load that needs the model re-probes and
2027
+ // either heals or refreshes the pin. Nothing re-probes on a timer (customer 1.3.4).
2103
2028
  export const NOT_READY_REPROBE_COOLDOWN_MS = 30_000;
2104
2029
  // Age of the current-generation EXPLICIT failed chat observation of a model, `NaN` when its
2105
2030
  // timestamp is malformed, `undefined` when there is no such observation. Only an explicit failed
@@ -2123,8 +2048,8 @@ function withinNotReadyCooldown(holder, modelId) {
2123
2048
  // The conversation-request twin of `withinNotReadyCooldown`: a request may start a probe only for a
2124
2049
  // failed observation whose LATEST evidence — the observation or the probe that settled it,
2125
2050
  // whichever is younger — has outlived the cooldown. A malformed or future timestamp fails CLOSED
2126
- // here (it yields no usable age): background recovery still probes such a model, but interactive
2127
- // Chat never adds a readiness request on a value it cannot date.
2051
+ // here (it yields no usable age): interactive Chat never adds a readiness request on a value it
2052
+ // cannot date; a page load still checks such a model again.
2128
2053
  function notReadyCooldownElapsed(holder, modelId) {
2129
2054
  const observedAgeMs = notReadyObservationAgeMs(holder, modelId);
2130
2055
  if (observedAgeMs === undefined)
@@ -2134,16 +2059,10 @@ function notReadyCooldownElapsed(holder, modelId) {
2134
2059
  const usableAges = ages.filter((ageMs) => Number.isFinite(ageMs) && ageMs >= 0);
2135
2060
  return usableAges.length > 0 && Math.min(...usableAges) >= NOT_READY_REPROBE_COOLDOWN_MS;
2136
2061
  }
2137
- function conversationProbeDue(deps, holder, modelId, backgroundAttempt) {
2062
+ function conversationProbeDue(deps, holder, modelId) {
2138
2063
  if (holder.current()?.providers.some((provider) => provider.modelId === modelId) !== true)
2139
2064
  return false;
2140
- if (!currentConversationReady(deps, modelId))
2141
- return true;
2142
- if (backgroundAttempt === undefined)
2143
- return false;
2144
- const observation = holder.verifiedCapability(modelId);
2145
- return (observation !== undefined &&
2146
- conversationReadinessAgeMs(observation) >= conversationReadinessRenewAfterMs());
2065
+ return !currentConversationReady(deps, modelId);
2147
2066
  }
2148
2067
  // `correlationId` is the conversation request that needed the answer: the probe's lines carry it,
2149
2068
  // so that request's timeline shows the check it waited for.
@@ -2151,7 +2070,7 @@ export async function ensureOnDemandConversationReadiness(deps, modelId, correla
2151
2070
  const holder = deps.gatewayConfig;
2152
2071
  if (holder === undefined || modelId.length === 0)
2153
2072
  return;
2154
- if (!conversationProbeDue(deps, holder, modelId, backgroundAttempt))
2073
+ if (!conversationProbeDue(deps, holder, modelId))
2155
2074
  return;
2156
2075
  if (withinNotReadyCooldown(holder, modelId))
2157
2076
  return;
@@ -2200,16 +2119,17 @@ async function observeOnDemandProbe(deps, modelId, probeCorrelationId) {
2200
2119
  finally {
2201
2120
  logAutomaticReadinessOutcome(deps, probeCorrelationId, modelId, outcome.overallStatus, 1, outcome.inconclusiveProbes);
2202
2121
  }
2203
- return outcome;
2204
2122
  }
2205
2123
  async function runOnDemandReadinessProbe(deps, holder, modelId, correlationId, backgroundAttempt) {
2206
2124
  const generation = holder.generation();
2207
2125
  const probeCorrelationId = correlationId ?? newCorrelationId();
2126
+ const config = holder.current();
2127
+ if (config !== undefined)
2128
+ conversationQueue(holder).startupChecked.set(modelId, conversationConnectionKey(config, modelId));
2208
2129
  logOnDemandProbeStarted(deps, holder, modelId, probeCorrelationId, backgroundAttempt);
2209
- const outcome = await observeOnDemandProbe(deps, modelId, probeCorrelationId);
2130
+ await observeOnDemandProbe(deps, modelId, probeCorrelationId);
2210
2131
  if (holder.generation() === generation) {
2211
2132
  const queue = conversationQueue(holder);
2212
- queue.retryable.set(modelId, outcome.inconclusiveProbes > 0);
2213
2133
  queue.probeSettledAt.set(modelId, Date.now());
2214
2134
  }
2215
2135
  // A failed report CLEARS the capability entry; without a current-generation observation
@@ -1 +1 @@
1
- {"version":3,"file":"gateway-setup.d.ts","sourceRoot":"","sources":["../src/gateway-setup.ts"],"names":[],"mappings":"AAwEA,OAAO,KAAK,EAKV,uBAAuB,EAGxB,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;AAOrF,OAAO,KAAK,EACV,SAAS,EACT,aAAa,EACb,eAAe,EAEf,mBAAmB,EAMpB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE7D,OAAO,KAAK,EAEV,uBAAuB,EAKvB,aAAa,EAEd,MAAM,WAAW,CAAC;AAUnB,OAAO,EAAuB,KAAK,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AA2BnG,eAAO,MAAM,qBAAqB,MAAM,CAAC;AAazC,eAAO,MAAM,iCAAiC,SAAU,CAAC;AAUzD,eAAO,MAAM,4BAA4B,SAAU,CAAC;AAuRpD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAM1D;AA8WD,wFAAwF;AACxF,wBAAgB,2BAA2B,CAAC,UAAU,EAAE,eAAe,GAAG,eAAe,CAGxF;AA4jBD,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,aAAa,EACrB,gBAAgB,EAAE,MAAM,GAAG,SAAS,EACpC,SAAS,CAAC,EAAE,MAAM,GACjB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAmBzB;AA8MD,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAO/E;AA+ID,wBAAgB,wBAAwB,CA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BAAgB,sCAAsC,CACpD,IAAI,EAAE,aAAa,EACnB,MAAM,EAAE,sBAAsB,EAC9B,kBAAkB,EAAE,MAAM,GAAG,SAAS,EACtC,aAAa,SAAyB,GACrC,IAAI,CAwBN;AAED,MAAM,MAAM,2BAA2B,GACnC;IACE,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;IAC1B,QAAQ,CAAC,qBAAqB,EAAE,MAAM,CAAC;IACvC,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;CAC9B,GACD;IAAE,QAAQ,CAAC,KAAK,EAAE,WAAW,GAAG,UAAU,GAAG,cAAc,CAAA;CAAE,CAAC;AAWlE;;;;;;;;;;GAUG;AACH,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,aAAa,EACnB,OAAO,EAAE,MAAM,EACf,mBAAmB,EAAE,MAAM,EAC3B,aAAa,EAAE,MAAM,GACpB,2BAA2B,CAiB7B;AAED,kGAAkG;AAClG,wBAAgB,gCAAgC,CAC9C,IAAI,EAAE,aAAa,EACnB,OAAO,EAAE,MAAM,EACf,iBAAiB,EAAE,eAAe,CAAC,mBAAmB,CAAC,EACvD,kBAAkB,EAAE,MAAM,EAC1B,wBAAwB,EAAE,MAAM,EAChC,aAAa,GAAE,MAA+B,GAC7C,OAAO,CAwCT;AAoJD,oGAAoG;AACpG,wBAAsB,sCAAsC,CAC1D,GAAG,EAAE,YAAY,EACjB,IAAI,EAAE,aAAa,GAClB,OAAO,CAAC,WAAW,CAAC,CAmCtB"}
@@ -1514,9 +1514,9 @@ export function normalizeDiscoveryPayload(payload) {
1514
1514
  export function normalizeDiscoveryPayloadForSetup(payload) {
1515
1515
  return parseModelDiscovery(payload);
1516
1516
  }
1517
- async function fetchDiscoveryJson(url, apiKey, apiKeyHeaderName, egress, signal = AbortSignal.timeout(DISCOVERY_TIMEOUT_MS)) {
1517
+ async function fetchDiscoveryJson(url, apiKey, apiKeyHeaderName, egress, correlationId, signal = AbortSignal.timeout(DISCOVERY_TIMEOUT_MS)) {
1518
1518
  signal.throwIfAborted();
1519
- const response = await fetchDiscoveryResponse(url, apiKey, apiKeyHeaderName, egress, signal);
1519
+ const response = await fetchDiscoveryResponse(url, apiKey, apiKeyHeaderName, egress, correlationId, signal);
1520
1520
  if (!response.ok) {
1521
1521
  throw Object.assign(new Error("model discovery returned an error status"), {
1522
1522
  httpStatus: response.status,
@@ -1535,13 +1535,17 @@ async function fetchDiscoveryJson(url, apiKey, apiKeyHeaderName, egress, signal
1535
1535
  throw cause;
1536
1536
  }
1537
1537
  }
1538
- async function fetchDiscoveryResponse(url, apiKey, apiKeyHeaderName, egress, signal) {
1538
+ async function fetchDiscoveryResponse(url, apiKey, apiKeyHeaderName, egress, correlationId, signal) {
1539
1539
  try {
1540
1540
  return await gatewayFetch(url, {
1541
1541
  method: "GET",
1542
1542
  headers: apiKeyHeaders(apiKey, apiKeyHeaderName),
1543
1543
  signal,
1544
1544
  ...(egress !== undefined ? { egress } : {}),
1545
+ // Discovery is where a wrong endpoint, blocked proxy or untrusted certificate first shows.
1546
+ // Without a sink those `http.gateway.fetch.failed` / TLS-trust lines count as `port-unwired`.
1547
+ log: processServerLogSink(),
1548
+ logContext: { correlationId },
1545
1549
  });
1546
1550
  }
1547
1551
  catch (cause) {
@@ -1571,7 +1575,7 @@ async function discoverLiteLlmModelInfo(baseUrl, apiKey, apiKeyHeaderName, egres
1571
1575
  trace.discoverySource = index === 0 ? "model-info" : "model-group-info";
1572
1576
  const outcomeKey = index === 0 ? "modelInfoOutcome" : "modelGroupInfoOutcome";
1573
1577
  try {
1574
- const payload = await fetchDiscoveryJson(endpoint, apiKey, apiKeyHeaderName, egress, discoveryManagementSignal(signal, deadlineAt, endpoints.length - index));
1578
+ const payload = await fetchDiscoveryJson(endpoint, apiKey, apiKeyHeaderName, egress, correlationId, discoveryManagementSignal(signal, deadlineAt, endpoints.length - index));
1575
1579
  const discovered = parseModelDiscovery(payload, correlationId);
1576
1580
  trace[outcomeKey] = "available";
1577
1581
  return {
@@ -1615,7 +1619,7 @@ async function defaultGatewayModelDiscovery(baseUrl, apiKey, requestedApiKeyHead
1615
1619
  if (litellmModels === undefined)
1616
1620
  trace.discoverySource = "model-list";
1617
1621
  try {
1618
- const payload = await fetchDiscoveryJson(modelsEndpoint(baseUrl), apiKey, apiKeyHeaderName, egress, signal);
1622
+ const payload = await fetchDiscoveryJson(modelsEndpoint(baseUrl), apiKey, apiKeyHeaderName, egress, correlationId, signal);
1619
1623
  const discovered = listedDiscoveryResult(payload, litellmModels, correlationId, allowEmpty);
1620
1624
  trace.modelListOutcome = "available";
1621
1625
  return litellmModels === undefined ? discovered : withLiteLlmTokenCounter(discovered);
@@ -2563,7 +2567,7 @@ function figmaReason(body) {
2563
2567
  const reason = body.err ?? body.message;
2564
2568
  return typeof reason === "string" ? reason : undefined;
2565
2569
  }
2566
- async function defaultFigmaCredentialTester(accessToken, egress) {
2570
+ async function defaultFigmaCredentialTester(accessToken, egress, correlationId) {
2567
2571
  try {
2568
2572
  const response = await gatewayFetch(FIGMA_ME_ENDPOINT, {
2569
2573
  method: "GET",
@@ -2574,6 +2578,10 @@ async function defaultFigmaCredentialTester(accessToken, egress) {
2574
2578
  redirect: "manual",
2575
2579
  signal: AbortSignal.timeout(FIGMA_CREDENTIAL_SMOKE_TIMEOUT_MS),
2576
2580
  ...(egress !== undefined ? { egress } : {}),
2581
+ // A blocked proxy or untrusted certificate surfaces here first; without a sink the transport
2582
+ // lines are lost and counted as `port-unwired`.
2583
+ log: processServerLogSink(),
2584
+ logContext: { correlationId },
2577
2585
  });
2578
2586
  let body;
2579
2587
  try {
@@ -5161,7 +5169,10 @@ async function verifySubmittedFigmaCredential(request, deps) {
5161
5169
  if (!request.verifyFigmaCredential || request.figmaAccessToken === undefined) {
5162
5170
  return undefined;
5163
5171
  }
5164
- const tester = deps.figmaCredentialTester ?? defaultFigmaCredentialTester;
5172
+ // The seam keeps its 2-arg shape; the real tester closes over the request correlation so its
5173
+ // transport lines join the setup request (ADR-0173 D5).
5174
+ const tester = deps.figmaCredentialTester ??
5175
+ ((accessToken, egress) => defaultFigmaCredentialTester(accessToken, egress, request.correlationId));
5165
5176
  try {
5166
5177
  await tester(request.figmaAccessToken, currentGatewayEgressConfig(deps));
5167
5178
  return undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"gateway-startup.d.ts","sourceRoot":"","sources":["../src/gateway-startup.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AA0B/C,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,aAAa,GAAG;IAC/D,QAAQ,CAAC,KAAK,EAAE,CAAC,aAAa,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACjD,QAAQ,CAAC,OAAO,EAAE,CAAC,aAAa,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACnD,QAAQ,CAAC,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACpC,CAWA"}
1
+ {"version":3,"file":"gateway-startup.d.ts","sourceRoot":"","sources":["../src/gateway-startup.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAyB/C,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,aAAa,GAAG;IAC/D,QAAQ,CAAC,KAAK,EAAE,CAAC,aAAa,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACjD,QAAQ,CAAC,OAAO,EAAE,CAAC,aAAa,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACnD,QAAQ,CAAC,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACpC,CAWA"}