@remnic/core 10.0.157 → 10.0.159
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/access-admin-ops-surface.js +10 -10
- package/dist/access-cli.js +10 -10
- package/dist/access-extraction-force-flush-preempt.js +10 -10
- package/dist/access-extraction-force-flush.js +10 -10
- package/dist/access-http-briefing.js +10 -10
- package/dist/access-http-query.js +10 -10
- package/dist/access-http.js +10 -10
- package/dist/access-identity-continuity-surface.js +10 -10
- package/dist/access-lcm-surface.js +10 -10
- package/dist/access-mcp.js +10 -10
- package/dist/access-observe-write-surface.js +10 -10
- package/dist/access-operations-batch.js +10 -10
- package/dist/access-operations.js +10 -10
- package/dist/access-recall-concurrency.js +10 -10
- package/dist/access-recall-response.js +10 -10
- package/dist/access-recall-surface.js +10 -10
- package/dist/access-service.js +10 -10
- package/dist/calibration.js +3 -3
- package/dist/{chunk-RGXNPAMA.js → chunk-3RHD5TF5.js} +38 -30
- package/dist/{chunk-RGXNPAMA.js.map → chunk-3RHD5TF5.js.map} +1 -1
- package/dist/{chunk-SKCMEZBU.js → chunk-52EM4UQU.js} +2 -2
- package/dist/{chunk-QAQL2OQH.js → chunk-5V3IBSVB.js} +2 -2
- package/dist/{chunk-K4TMUEYI.js → chunk-BT5TAOXG.js} +1 -1
- package/dist/{chunk-4IJBNRMZ.js → chunk-DRXFLPSE.js} +12 -2
- package/dist/chunk-DRXFLPSE.js.map +1 -0
- package/dist/{chunk-AGMMHT4P.js → chunk-GT2HWRST.js} +21 -3
- package/dist/chunk-GT2HWRST.js.map +1 -0
- package/dist/{chunk-BDKLKX43.js → chunk-KYZMCH4I.js} +79 -6
- package/dist/{chunk-BDKLKX43.js.map → chunk-KYZMCH4I.js.map} +1 -1
- package/dist/{chunk-RXG3WF7C.js → chunk-TXVTNDQT.js} +2 -2
- package/dist/{chunk-2TUWMP7B.js → chunk-UADAXWUJ.js} +3 -3
- package/dist/{chunk-Z6AP6O32.js → chunk-XC5BRK7J.js} +2 -2
- package/dist/{chunk-XWRSQWQO.js → chunk-YOR5QBEU.js} +60 -59
- package/dist/chunk-YOR5QBEU.js.map +1 -0
- package/dist/cli.js +10 -10
- package/dist/compounding/engine.js +1 -1
- package/dist/explicit-capture.js +10 -10
- package/dist/extraction.js +4 -4
- package/dist/index.js +10 -10
- package/dist/local-llm-helpers.d.ts +22 -8
- package/dist/local-llm-helpers.d.ts.map +1 -1
- package/dist/local-llm-helpers.js +11 -1
- package/dist/local-llm-rate-limit.d.ts +1 -5
- package/dist/local-llm-rate-limit.d.ts.map +1 -1
- package/dist/local-llm-rate-limit.js +3 -1
- package/dist/local-llm.d.ts +2 -4
- package/dist/local-llm.d.ts.map +1 -1
- package/dist/local-llm.js +3 -3
- package/dist/orchestration/backlog-scheduler.js +11 -11
- package/dist/orchestration/buffer-drain-runner.js +11 -11
- package/dist/orchestration/maintenance.js +5 -5
- package/dist/orchestration/recall-internal.d.ts.map +1 -1
- package/dist/orchestrator.js +10 -10
- package/dist/recall-enrichment-promise.d.ts +7 -2
- package/dist/recall-enrichment-promise.d.ts.map +1 -1
- package/dist/recall-enrichment-promise.js +1 -1
- package/dist/recall-navigation.js +10 -10
- package/dist/summarizer.js +4 -4
- package/dist/support-passport/index.js +4 -4
- package/package.json +12 -2
- package/src/local-llm-helpers.ts +116 -14
- package/src/local-llm-rate-limit.test.ts +79 -1
- package/src/local-llm-rate-limit.ts +37 -1
- package/src/local-llm.ts +75 -74
- package/src/orchestration/recall-internal.ts +36 -24
- package/src/recall-enrichment-promise.ts +20 -2
- package/src/recall-qos.test.ts +24 -0
- package/src/recall-timings-request-contract.test.ts +10 -8
- package/dist/chunk-4IJBNRMZ.js.map +0 -1
- package/dist/chunk-AGMMHT4P.js.map +0 -1
- package/dist/chunk-XWRSQWQO.js.map +0 -1
- /package/dist/{chunk-SKCMEZBU.js.map → chunk-52EM4UQU.js.map} +0 -0
- /package/dist/{chunk-QAQL2OQH.js.map → chunk-5V3IBSVB.js.map} +0 -0
- /package/dist/{chunk-K4TMUEYI.js.map → chunk-BT5TAOXG.js.map} +0 -0
- /package/dist/{chunk-RXG3WF7C.js.map → chunk-TXVTNDQT.js.map} +0 -0
- /package/dist/{chunk-2TUWMP7B.js.map → chunk-UADAXWUJ.js.map} +0 -0
- /package/dist/{chunk-Z6AP6O32.js.map → chunk-XC5BRK7J.js.map} +0 -0
|
@@ -3,8 +3,9 @@ import {
|
|
|
3
3
|
} from "./chunk-MJFL75J6.js";
|
|
4
4
|
import {
|
|
5
5
|
LocalLlmRateLimitSession,
|
|
6
|
+
isTerminalLocalLlmProxyPoolError,
|
|
6
7
|
resolveRateLimitSettings
|
|
7
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-GT2HWRST.js";
|
|
8
9
|
import {
|
|
9
10
|
isObjectRecord,
|
|
10
11
|
orderedLocalServers
|
|
@@ -15,12 +16,16 @@ import {
|
|
|
15
16
|
combineClientAbortSignals,
|
|
16
17
|
extractNonRecoverableBackendReason,
|
|
17
18
|
extractNonRecoverableBackendReasonFromErrorText,
|
|
19
|
+
formatLocalLlmPoolKey,
|
|
20
|
+
getLocalLlmTrippedBackendPoolState,
|
|
18
21
|
isAbortError,
|
|
22
|
+
localLlmBackendPoolExpiredAtMs,
|
|
23
|
+
markLocalLlmBackendPoolUnavailable,
|
|
19
24
|
normalizeBackendTripReason,
|
|
20
25
|
probeFetch,
|
|
21
26
|
resolveUnavailableVerdict,
|
|
22
27
|
waitForRetryBackoff
|
|
23
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-KYZMCH4I.js";
|
|
24
29
|
import {
|
|
25
30
|
ChatTransport
|
|
26
31
|
} from "./chunk-5YQXWVCP.js";
|
|
@@ -112,11 +117,12 @@ var THINKING_SUPPRESSED_OPERATIONS = /* @__PURE__ */ new Set([
|
|
|
112
117
|
"hourly_summary_extended",
|
|
113
118
|
"correction-classify"
|
|
114
119
|
]);
|
|
115
|
-
var LOCAL_LLM_GLOBAL_BACKEND_STATE = "__openclawEngramLocalLlmBackendState";
|
|
116
120
|
var LocalLlmClient = class _LocalLlmClient {
|
|
117
121
|
config;
|
|
118
122
|
isAvailable = null;
|
|
119
123
|
lastHealthCheck = 0;
|
|
124
|
+
poolExpirySeenMs = /* @__PURE__ */ new Map();
|
|
125
|
+
// pool key → lapsed-circuit instant already invalidated
|
|
120
126
|
availabilityProbe = new SingleFlightProbe();
|
|
121
127
|
detectedType = null;
|
|
122
128
|
cachedModelInfo = null;
|
|
@@ -167,11 +173,16 @@ var LocalLlmClient = class _LocalLlmClient {
|
|
|
167
173
|
return this.config.localLlmHomeDir || readEnvVar("HOME") || os.homedir();
|
|
168
174
|
}
|
|
169
175
|
buildRequestHeaders(base = {}) {
|
|
170
|
-
const headers = {
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
176
|
+
const headers = { ...base };
|
|
177
|
+
const configured = this.config.localLlmHeaders ?? {};
|
|
178
|
+
for (const [key, value] of Object.entries(configured)) {
|
|
179
|
+
const existing = Object.keys(headers).find((name) => name.toLowerCase() === key.toLowerCase());
|
|
180
|
+
if (existing !== void 0) delete headers[existing];
|
|
181
|
+
headers[key] = value;
|
|
182
|
+
}
|
|
174
183
|
if (this.config.localLlmApiKey && this.config.localLlmAuthHeader !== false) {
|
|
184
|
+
const existing = Object.keys(headers).find((name) => name.toLowerCase() === "authorization");
|
|
185
|
+
if (existing !== void 0) delete headers[existing];
|
|
175
186
|
headers.Authorization = `Bearer ${this.config.localLlmApiKey}`;
|
|
176
187
|
}
|
|
177
188
|
return headers;
|
|
@@ -188,40 +199,12 @@ var LocalLlmClient = class _LocalLlmClient {
|
|
|
188
199
|
getDetectedType() {
|
|
189
200
|
return this.detectedType;
|
|
190
201
|
}
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
this.config.localLlmUrl.replace("localhost", "127.0.0.1")
|
|
194
|
-
).replace(/\/v1$/, "");
|
|
195
|
-
}
|
|
196
|
-
getGlobalBackendState() {
|
|
197
|
-
const globalAny = globalThis;
|
|
198
|
-
if (!globalAny[LOCAL_LLM_GLOBAL_BACKEND_STATE]) {
|
|
199
|
-
globalAny[LOCAL_LLM_GLOBAL_BACKEND_STATE] = /* @__PURE__ */ new Map();
|
|
200
|
-
}
|
|
201
|
-
return globalAny[LOCAL_LLM_GLOBAL_BACKEND_STATE];
|
|
202
|
-
}
|
|
203
|
-
getTrippedBackendState(now) {
|
|
204
|
-
const state = this.getGlobalBackendState().get(this.getBackendKey()) ?? null;
|
|
205
|
-
if (!state) return null;
|
|
206
|
-
if (state.untilMs <= now) {
|
|
207
|
-
this.getGlobalBackendState().delete(this.getBackendKey());
|
|
208
|
-
this.lastHealthCheck = 0;
|
|
209
|
-
return null;
|
|
210
|
-
}
|
|
211
|
-
return state;
|
|
212
|
-
}
|
|
213
|
-
markBackendUnavailable(reason, durationMs) {
|
|
214
|
-
const normalizedReason = normalizeBackendTripReason(reason);
|
|
215
|
-
if (durationMs > 0) {
|
|
216
|
-
const untilMs = Date.now() + durationMs;
|
|
217
|
-
this.getGlobalBackendState().set(this.getBackendKey(), { untilMs, reason: normalizedReason });
|
|
218
|
-
} else {
|
|
219
|
-
this.getGlobalBackendState().delete(this.getBackendKey());
|
|
220
|
-
}
|
|
202
|
+
markBackendUnavailable(reason, durationMs, chatUrl, operation) {
|
|
203
|
+
markLocalLlmBackendPoolUnavailable(reason, durationMs, chatUrl, operation);
|
|
221
204
|
this.isAvailable = false;
|
|
222
205
|
this.lastHealthCheck = 0;
|
|
223
206
|
log.warn(
|
|
224
|
-
`local LLM backend unavailable for ${durationMs}ms: model=${this.config.localLlmModel} reason=${
|
|
207
|
+
`local LLM backend unavailable for ${durationMs}ms: model=${this.config.localLlmModel} reason=${normalizeBackendTripReason(reason)} op=${operation}`
|
|
225
208
|
);
|
|
226
209
|
}
|
|
227
210
|
/**
|
|
@@ -254,17 +237,27 @@ var LocalLlmClient = class _LocalLlmClient {
|
|
|
254
237
|
* Check if local LLM is available
|
|
255
238
|
* Uses 127.0.0.1 instead of localhost to avoid DNS issues (consistent with tactician)
|
|
256
239
|
*/
|
|
257
|
-
async checkAvailability(signal) {
|
|
240
|
+
async checkAvailability(signal, chatUrl, operation) {
|
|
258
241
|
if (signal?.aborted) return false;
|
|
259
242
|
const now = Date.now();
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
243
|
+
if (chatUrl) {
|
|
244
|
+
const poolOperation = operation ?? "unspecified";
|
|
245
|
+
const poolKey = formatLocalLlmPoolKey(chatUrl, poolOperation);
|
|
246
|
+
const expiredAtMs = localLlmBackendPoolExpiredAtMs(now, chatUrl, poolOperation);
|
|
247
|
+
if (expiredAtMs !== null && expiredAtMs > (this.poolExpirySeenMs.get(poolKey) ?? 0)) {
|
|
248
|
+
this.poolExpirySeenMs.set(poolKey, expiredAtMs);
|
|
249
|
+
this.isAvailable = null;
|
|
250
|
+
this.lastHealthCheck = 0;
|
|
251
|
+
}
|
|
252
|
+
const trippedState = getLocalLlmTrippedBackendPoolState(now, chatUrl, poolOperation);
|
|
253
|
+
if (trippedState) {
|
|
254
|
+
this.isAvailable = false;
|
|
255
|
+
this.lastHealthCheck = 0;
|
|
256
|
+
log.info(
|
|
257
|
+
`local LLM availability: backend circuit open for ${Math.max(0, trippedState.untilMs - now)}ms (${trippedState.reason}) op=${poolOperation}`
|
|
258
|
+
);
|
|
259
|
+
return false;
|
|
260
|
+
}
|
|
268
261
|
}
|
|
269
262
|
if (this.isAvailable !== null && now - this.lastHealthCheck < _LocalLlmClient.HEALTH_CHECK_INTERVAL_MS) {
|
|
270
263
|
return this.isAvailable;
|
|
@@ -685,13 +678,18 @@ var LocalLlmClient = class _LocalLlmClient {
|
|
|
685
678
|
`local LLM queue start: priority=${queueMeta.priority} waitMs=${startedAtMs - queueMeta.enqueuedAtMs} op=${operation}`
|
|
686
679
|
);
|
|
687
680
|
}
|
|
681
|
+
let chatUrl = "";
|
|
688
682
|
try {
|
|
689
683
|
const signal = combineClientAbortSignals(options.signal, this.shutdownSignal);
|
|
690
684
|
if (signal?.aborted) return null;
|
|
691
|
-
const
|
|
685
|
+
const baseUrl = trimTrailingSlashes(
|
|
686
|
+
this.config.localLlmUrl.replace("localhost", "127.0.0.1")
|
|
687
|
+
);
|
|
688
|
+
chatUrl = baseUrl.endsWith("/v1") ? `${baseUrl}/chat/completions` : `${baseUrl}/v1/chat/completions`;
|
|
689
|
+
const isAvailable = await this.checkAvailability(signal, chatUrl, operation);
|
|
692
690
|
if (!isAvailable) {
|
|
693
691
|
log.debug(
|
|
694
|
-
`local LLM: checkAvailability returned false for ${this.config.localLlmUrl}`
|
|
692
|
+
`local LLM: checkAvailability returned false for ${this.config.localLlmUrl} op=${operation}`
|
|
695
693
|
);
|
|
696
694
|
return null;
|
|
697
695
|
}
|
|
@@ -715,10 +713,6 @@ var LocalLlmClient = class _LocalLlmClient {
|
|
|
715
713
|
requestBody.reasoning_effort = effort;
|
|
716
714
|
}
|
|
717
715
|
}
|
|
718
|
-
const baseUrl = trimTrailingSlashes(
|
|
719
|
-
this.config.localLlmUrl.replace("localhost", "127.0.0.1")
|
|
720
|
-
);
|
|
721
|
-
const chatUrl = baseUrl.endsWith("/v1") ? `${baseUrl}/chat/completions` : `${baseUrl}/v1/chat/completions`;
|
|
722
716
|
let requestBodyJson = JSON.stringify(requestBody);
|
|
723
717
|
log.debug(
|
|
724
718
|
`local LLM: sending request to ${chatUrl} with model ${this.config.localLlmModel}`
|
|
@@ -727,7 +721,7 @@ var LocalLlmClient = class _LocalLlmClient {
|
|
|
727
721
|
const effectiveTimeoutMs = typeof options.timeoutMs === "number" ? Math.min(this.config.localLlmTimeoutMs, options.timeoutMs) : this.config.localLlmTimeoutMs;
|
|
728
722
|
const maxAttempts = 1 + Math.max(0, this.config.localLlmRetry5xxCount);
|
|
729
723
|
const rateLimit = new LocalLlmRateLimitSession(
|
|
730
|
-
chatUrl,
|
|
724
|
+
formatLocalLlmPoolKey(chatUrl, operation),
|
|
731
725
|
resolveRateLimitSettings(this.config),
|
|
732
726
|
(queueMeta?.priority ?? options.priority) === "recall-critical",
|
|
733
727
|
effectiveTimeoutMs
|
|
@@ -813,7 +807,9 @@ var LocalLlmClient = class _LocalLlmClient {
|
|
|
813
807
|
if (nonRecoverableReason) {
|
|
814
808
|
this.markBackendUnavailable(
|
|
815
809
|
nonRecoverableReason,
|
|
816
|
-
this.config.localLlm400CooldownMs
|
|
810
|
+
this.config.localLlm400CooldownMs,
|
|
811
|
+
chatUrl,
|
|
812
|
+
operation
|
|
817
813
|
);
|
|
818
814
|
this.consecutive400s = 0;
|
|
819
815
|
return null;
|
|
@@ -827,6 +823,7 @@ var LocalLlmClient = class _LocalLlmClient {
|
|
|
827
823
|
attempt -= 1;
|
|
828
824
|
continue;
|
|
829
825
|
}
|
|
826
|
+
if (isTerminalLocalLlmProxyPoolError(response.status, responseBody)) break;
|
|
830
827
|
if (response.status < 500 || attempt >= maxAttempts) break;
|
|
831
828
|
const backoffMs = this.config.localLlmRetryBackoffMs * attempt;
|
|
832
829
|
log.warn(
|
|
@@ -866,7 +863,9 @@ var LocalLlmClient = class _LocalLlmClient {
|
|
|
866
863
|
if (nonRecoverableReason) {
|
|
867
864
|
this.markBackendUnavailable(
|
|
868
865
|
nonRecoverableReason,
|
|
869
|
-
this.config.localLlm400CooldownMs
|
|
866
|
+
this.config.localLlm400CooldownMs,
|
|
867
|
+
chatUrl,
|
|
868
|
+
operation
|
|
870
869
|
);
|
|
871
870
|
this.consecutive400s = 0;
|
|
872
871
|
return null;
|
|
@@ -929,10 +928,12 @@ var LocalLlmClient = class _LocalLlmClient {
|
|
|
929
928
|
log.warn(`local LLM request error: op=${operation} error=${options.redactProviderErrors ? "provider error details redacted" : errMsg}`);
|
|
930
929
|
this.isAvailable = false;
|
|
931
930
|
const nonRecoverableReason = extractNonRecoverableBackendReason(errMsg);
|
|
932
|
-
if (nonRecoverableReason) {
|
|
931
|
+
if (nonRecoverableReason && chatUrl.length > 0) {
|
|
933
932
|
this.markBackendUnavailable(
|
|
934
933
|
nonRecoverableReason,
|
|
935
|
-
this.config.localLlm400CooldownMs
|
|
934
|
+
this.config.localLlm400CooldownMs,
|
|
935
|
+
chatUrl,
|
|
936
|
+
operation
|
|
936
937
|
);
|
|
937
938
|
}
|
|
938
939
|
return null;
|
|
@@ -1125,4 +1126,4 @@ var LocalLlmClient = class _LocalLlmClient {
|
|
|
1125
1126
|
export {
|
|
1126
1127
|
LocalLlmClient
|
|
1127
1128
|
};
|
|
1128
|
-
//# sourceMappingURL=chunk-
|
|
1129
|
+
//# sourceMappingURL=chunk-YOR5QBEU.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/local-llm.ts"],"sourcesContent":["import { log } from \"./logger.js\";\nimport { isUnsupportedJsonSchemaError } from \"./fallback-llm-codex-subscription.js\";\nimport { estimateTokenCount } from \"./token-estimate.js\";\nimport type { PluginConfig } from \"./types.js\";\nimport fs from \"node:fs\";\nimport os from \"node:os\";\nimport type { ModelRegistry } from \"./model-registry.js\";\nimport { launchProcessSync } from \"./runtime/child-process.js\";\nimport { mergeEnv, readEnvVar } from \"./runtime/env.js\";\nimport { resolveLocalLlmCapabilities, resolvePipelineProcessingCapabilities } from \"./capabilities.js\";\nimport { ChatTransport } from \"./local-llm-transport.js\";\nimport { LocalLlmRateLimitSession, resolveRateLimitSettings, isTerminalLocalLlmProxyPoolError } from \"./local-llm-rate-limit.js\";\nimport {\n extractNonRecoverableBackendReason,\n extractNonRecoverableBackendReasonFromErrorText,\n isAbortError,\n probeFetch,\n resolveUnavailableVerdict,\n type ProbeFetchResult,\n normalizeBackendTripReason,\n waitForRetryBackoff,\n combineClientAbortSignals,\n SingleFlightProbe,\n buildLocalLlmRoutingHeaders,\n formatLocalLlmPoolKey,\n localLlmBackendPoolExpiredAtMs,\n getLocalLlmTrippedBackendPoolState,\n markLocalLlmBackendPoolUnavailable,\n type LocalLlmChatCompletionOptions,\n type LocalLlmChatCompletionResult,\n} from \"./local-llm-helpers.js\";\nimport { NativeSchemaGate, type LocalLlmChatRequestBody } from \"./local-llm-native-schema.js\";\nimport {\n isObjectRecord,\n orderedLocalServers,\n type LocalLlmType,\n} from \"./local-llm-servers.js\";\n\nexport type { LocalLlmType } from \"./local-llm-servers.js\";\n\n/** Trim trailing slash characters without backtracking regex. */\nfunction trimTrailingSlashes(s: string): string {\n let end = s.length;\n while (end > 0 && s[end - 1] === \"/\") end--;\n return s.substring(0, end);\n}\n\nfunction stripTrailingV1Path(s: string): string {\n return s.endsWith(\"/v1\") ? s.slice(0, -3) : s;\n}\n\nfunction isLlamaCppPropsResponse(value: unknown): boolean {\n return (\n isObjectRecord(value) &&\n isObjectRecord(value.default_generation_settings) &&\n typeof value.total_slots === \"number\" &&\n (\n typeof value.model_path === \"string\" ||\n typeof value.chat_template === \"string\" ||\n typeof value.build_info === \"string\"\n )\n );\n}\n\nfunction isLlamaCppModelsResponse(value: unknown): boolean {\n if (!isObjectRecord(value) || !Array.isArray(value.data)) {\n return false;\n }\n return value.data.some((entry) => {\n if (!isObjectRecord(entry)) return false;\n if (entry.owned_by === \"llamacpp\") return true;\n if (typeof entry.id === \"string\" && entry.id.endsWith(\".gguf\")) return true;\n const meta = entry.meta;\n return (\n isObjectRecord(meta) &&\n (\"n_ctx_train\" in meta || \"n_params\" in meta || \"vocab_type\" in meta)\n );\n });\n}\n\nfunction isLmStudioApiV1ModelsResponse(value: unknown): boolean {\n if (!isObjectRecord(value) || !Array.isArray(value.models)) {\n return false;\n }\n return value.models.some((entry) => {\n if (!isObjectRecord(entry)) return false;\n return (\n typeof entry.key === \"string\" &&\n typeof entry.display_name === \"string\" &&\n (\n typeof entry.format === \"string\" ||\n typeof entry.max_context_length === \"number\" ||\n Array.isArray(entry.loaded_instances)\n )\n );\n });\n}\n\nfunction isLmStudioApiV0ModelsResponse(value: unknown): boolean {\n if (!isObjectRecord(value) || !Array.isArray(value.data)) {\n return false;\n }\n return value.data.some((entry) => {\n if (!isObjectRecord(entry)) return false;\n return (\n typeof entry.id === \"string\" &&\n typeof entry.publisher === \"string\" &&\n (\n typeof entry.compatibility_type === \"string\" ||\n typeof entry.max_context_length === \"number\" ||\n typeof entry.state === \"string\"\n )\n );\n });\n}\n\nfunction isLmStudioNativeModelsResponse(value: unknown): boolean {\n return isLmStudioApiV1ModelsResponse(value) || isLmStudioApiV0ModelsResponse(value);\n}\n\n/**\n * Backends known to honor `chat_template_kwargs: { enable_thinking: false }`\n * on OpenAI-compatible `/v1/chat/completions`. LM Studio, vLLM, and\n * llama.cpp forward this field to the jinja chat template, where thinking-capable\n * models (Qwen 3.5, Gemma 4, DeepSeek) suppress reasoning tokens.\n *\n * Strict OpenAI-compatible backends (standard OpenAI, Azure OpenAI, some\n * proxies) reject unknown request fields with 400 — which trips the\n * `localLlm400*` cooldown path. `LocalLlmClient` therefore only injects\n * the kwarg when the detected backend is in this set; unknown / `generic`\n * / `ollama` / `mlx` fail open (no injection, no 400 risk). Issue #548.\n */\nconst THINKING_COMPATIBLE_BACKENDS: ReadonlySet<LocalLlmType> = new Set([\n \"lmstudio\",\n \"vllm\",\n \"llamacpp\",\n]);\n\nconst THINKING_SUPPRESSED_OPERATIONS: ReadonlySet<string> = new Set([\n \"extraction\",\n \"extraction-judge\",\n \"extraction-faithfulness\",\n \"contradiction-judge\",\n \"contradiction_verification\",\n \"link_suggestion\",\n \"memory_summarization\",\n \"proactive_extraction\",\n \"lcm-summarize\",\n \"day_summary\",\n \"hourly_summary\",\n \"hourly_summary_extended\",\n \"correction-classify\",\n]);\n\nexport interface LocalModelInfo {\n id: string;\n contextWindow?: number;\n maxTokens?: number;\n}\n\nexport type LocalLlmRequestPriority = \"recall-critical\" | \"background\";\n\n// LocalLlmChatCompletionOptions and LocalLlmChatCompletionResult live in\n// local-llm-helpers.ts so this file stays under its size ceiling (#1995).\ninterface LocalLlmQueuedRequest {\n messages: Array<{ role: string; content: string }>;\n options: LocalLlmChatCompletionOptions;\n priority: LocalLlmRequestPriority;\n enqueuedAtMs: number;\n resolve: (value: LocalLlmChatCompletionResult | null) => void;\n}\n\n/**\n * Local LLM client for OpenAI-compatible endpoints (LM Studio, Ollama, MLX, etc.)\n *\n * Based on openclaw-tactician's provider detection patterns for consistency.\n * Provides privacy-preserving, cost-effective LLM operations with\n * graceful fallback to cloud providers when local LLM is unavailable.\n */\nexport class LocalLlmClient {\n private config: PluginConfig;\n private isAvailable: boolean | null = null;\n private lastHealthCheck: number = 0;\n private poolExpirySeenMs = new Map<string, number>(); // pool key → lapsed-circuit instant already invalidated\n private readonly availabilityProbe = new SingleFlightProbe();\n private detectedType: LocalLlmType | null = null;\n private cachedModelInfo: LocalModelInfo | null = null;\n private cachedLmsContext: number | null = null;\n private lastLmsCheck: number = 0;\n private consecutive400s: number = 0;\n private cooldownUntilMs: number = 0;\n private modelRegistry?: ModelRegistry;\n private readonly nativeSchemaGate = new NativeSchemaGate(() => this.modelRegistry);\n private _disableThinking: boolean = false;\n private readonly requestQueues: Record<LocalLlmRequestPriority, LocalLlmQueuedRequest[]> = {\n \"recall-critical\": [],\n background: [],\n };\n private readonly queueProcessing = new Set<LocalLlmRequestPriority>();\n private queueDrainScheduled: boolean = false;\n private static readonly HEALTH_CHECK_INTERVAL_MS = 60000; // 1 minute\n private static readonly LMS_CACHE_INTERVAL_MS = 30000; // 30 seconds\n private readonly chatTransport = new ChatTransport();\n /** Orchestrator-owned stop signal: aborts every in-flight and queued\n * request (and their retry backoffs) the moment teardown begins. */\n private readonly shutdownSignal: AbortSignal | undefined;\n\n constructor(config: PluginConfig, modelRegistry?: ModelRegistry, shutdownSignal?: AbortSignal) {\n this.config = config;\n this.modelRegistry = modelRegistry;\n this.shutdownSignal = shutdownSignal;\n }\n\n /**\n * Request thinking/reasoning suppression on the next chat completion.\n *\n * When `true`, the client will inject\n * `chat_template_kwargs: { enable_thinking: false }` into the request\n * body — **but only when the detected backend is known to support it**\n * (LM Studio, vLLM; see `THINKING_COMPATIBLE_BACKENDS`). Strict\n * OpenAI-compat backends reject unknown fields with 400; on those the\n * client fails open (thinking runs normally). This is the safe\n * default for Remnic extraction-style operations: measurable latency\n * win on thinking-capable backends, zero risk on others. Consolidation\n * operations keep thinking enabled unless explicitly added to\n * `THINKING_SUPPRESSED_OPERATIONS`. Issues #548 and #979.\n */\n set disableThinking(value: boolean) {\n this._disableThinking = value;\n }\n\n private resolveHomeDir(): string {\n return this.config.localLlmHomeDir || readEnvVar(\"HOME\") || os.homedir();\n }\n\n private buildRequestHeaders(base: Record<string, string> = {}): Record<string, string> {\n const headers = { ...base } satisfies Record<string, string>;\n const configured = this.config.localLlmHeaders ?? {};\n for (const [key, value] of Object.entries(configured)) {\n const existing = Object.keys(headers).find((name) => name.toLowerCase() === key.toLowerCase());\n if (existing !== undefined) delete headers[existing];\n headers[key] = value;\n }\n if (this.config.localLlmApiKey && this.config.localLlmAuthHeader !== false) {\n const existing = Object.keys(headers).find((name) => name.toLowerCase() === \"authorization\");\n if (existing !== undefined) delete headers[existing];\n headers.Authorization = `Bearer ${this.config.localLlmApiKey}`;\n }\n return headers;\n }\n\n\n /**\n * Set the ModelRegistry for caching detected capabilities\n */\n setModelRegistry(registry: ModelRegistry): void {\n this.modelRegistry = registry;\n }\n\n /**\n * Get the detected server type (null if not detected)\n */\n getDetectedType(): LocalLlmType | null {\n return this.detectedType;\n }\n\n private markBackendUnavailable(\n reason: string,\n durationMs: number,\n chatUrl: string,\n operation: string,\n ): void {\n markLocalLlmBackendPoolUnavailable(reason, durationMs, chatUrl, operation);\n this.isAvailable = false;\n this.lastHealthCheck = 0;\n log.warn(\n `local LLM backend unavailable for ${durationMs}ms: model=${this.config.localLlmModel} reason=${normalizeBackendTripReason(reason)} op=${operation}`,\n );\n }\n\n\n /**\n * Fetch with timeout for health checks. Body lives in the sibling helper so\n * this file stays under its size ceiling (issue #1995).\n */\n private async fetchWithTimeout(\n url: string,\n timeoutMs: number = 2000,\n headers?: Record<string, string>,\n signal?: AbortSignal,\n ): Promise<ProbeFetchResult> {\n return await probeFetch(url, {\n timeoutMs,\n headers: this.buildRequestHeaders({ Accept: \"application/json\", ...(headers ?? {}) }),\n signal,\n });\n }\n\n private async probeLmStudioNativeModels(\n probeBaseUrl: string,\n signal?: AbortSignal,\n ): Promise<{ matched: boolean; unauthorized: boolean }> {\n let unauthorized = false;\n for (const endpoint of [\"/api/v1/models\", \"/api/v0/models\"]) {\n if (signal?.aborted) return { matched: false, unauthorized };\n const probe = await this.fetchWithTimeout(`${probeBaseUrl}${endpoint}`, 2000, undefined, signal);\n if (signal?.aborted) return { matched: false, unauthorized };\n if (probe.ok && isLmStudioNativeModelsResponse(probe.data)) {\n return { matched: true, unauthorized };\n }\n if (probe.status === 401 || probe.status === 403) {\n unauthorized = true;\n }\n }\n return { matched: false, unauthorized };\n }\n\n /**\n * Check if local LLM is available\n * Uses 127.0.0.1 instead of localhost to avoid DNS issues (consistent with tactician)\n */\n async checkAvailability(\n signal?: AbortSignal,\n chatUrl?: string,\n operation?: string,\n ): Promise<boolean> {\n if (signal?.aborted) return false;\n const now = Date.now(); // cache health check results for 1 minute\n if (chatUrl) {\n // An empty label is a real pool key: a \"\" caller still sees a recorded circuit (wAN on #3474).\n const poolOperation = operation ?? \"unspecified\";\n const poolKey = formatLocalLlmPoolKey(chatUrl, poolOperation);\n // A lapsed circuit stays visible as a tombstone; each client clears its cached verdict once.\n const expiredAtMs = localLlmBackendPoolExpiredAtMs(now, chatUrl, poolOperation);\n if (expiredAtMs !== null && expiredAtMs > (this.poolExpirySeenMs.get(poolKey) ?? 0)) {\n this.poolExpirySeenMs.set(poolKey, expiredAtMs);\n this.isAvailable = null;\n this.lastHealthCheck = 0;\n }\n const trippedState = getLocalLlmTrippedBackendPoolState(now, chatUrl, poolOperation);\n if (trippedState) {\n this.isAvailable = false;\n this.lastHealthCheck = 0;\n log.info(\n `local LLM availability: backend circuit open for ${Math.max(0, trippedState.untilMs - now)}ms (${trippedState.reason}) op=${poolOperation}`,\n );\n return false;\n }\n }\n if (this.isAvailable !== null && now - this.lastHealthCheck < LocalLlmClient.HEALTH_CHECK_INTERVAL_MS) {\n return this.isAvailable;\n }\n return await this.availabilityProbe.run((probeSignal) => this.probeAvailability(probeSignal), signal);\n }\n\n private async probeAvailability(signal?: AbortSignal): Promise<boolean> {\n const now = Date.now();\n // Probe server-native endpoints from the server root even when users configure\n // the OpenAI-compatible `/v1` base URL for chat completions.\n const configuredBaseUrl = trimTrailingSlashes(\n this.config.localLlmUrl.replace(\"localhost\", \"127.0.0.1\"),\n );\n const probeBaseUrl = stripTrailingV1Path(configuredBaseUrl);\n let sawUnauthorizedProbe = false;\n // A probe that TIMED OUT says the event loop was busy, not that the backend\n // is down (issue #2210). Tracked separately so a loaded daemon cannot cache\n // itself into a blackout.\n let sawAbortedProbe = false;\n // Several server shapes share a probe URL (LiteLLM and Ollama both use\n // `/`); fetch each URL once per pass.\n const probed = new Map<string, ProbeFetchResult>();\n const probeOnce = async (url: string): Promise<ProbeFetchResult> => {\n const cached = probed.get(url);\n if (cached) return cached;\n const result = await this.fetchWithTimeout(url, 2000, undefined, signal);\n probed.set(url, result);\n return result;\n };\n\n // Try to detect which server type is running\n if (signal?.aborted) return false;\n for (const serverConfig of orderedLocalServers(configuredBaseUrl)) {\n const healthUrl = `${probeBaseUrl}${serverConfig.healthEndpoint}`;\n log.debug(`checking ${serverConfig.type} at ${healthUrl}`);\n\n const result = await probeOnce(healthUrl);\n if (result.aborted) sawAbortedProbe = true;\n if (signal?.aborted) return false;\n if (result.ok && serverConfig.detectFn(result.data)) {\n if (serverConfig.type === \"mlx\") {\n const lmStudioProbe = await this.probeLmStudioNativeModels(probeBaseUrl, signal);\n if (signal?.aborted) return false;\n if (lmStudioProbe.unauthorized) {\n sawUnauthorizedProbe = true;\n }\n if (lmStudioProbe.matched) {\n this.isAvailable = true;\n this.detectedType = \"lmstudio\";\n this.lastHealthCheck = now;\n log.info(`detected lmstudio at ${configuredBaseUrl}`);\n return true;\n }\n }\n if (serverConfig.type === \"llamacpp\") {\n let sawLlamaCppSignal = false;\n const propsProbe = await this.fetchWithTimeout(`${probeBaseUrl}/props`, 2000, undefined, signal);\n if (propsProbe.aborted) sawAbortedProbe = true;\n if (signal?.aborted) return false;\n if (propsProbe.ok && isLlamaCppPropsResponse(propsProbe.data)) {\n sawLlamaCppSignal = true;\n }\n if (propsProbe.status === 401 || propsProbe.status === 403) {\n sawUnauthorizedProbe = true;\n }\n\n const modelsUrl = `${probeBaseUrl}${serverConfig.modelsEndpoint}`;\n const modelsProbe = await this.fetchWithTimeout(modelsUrl, 2000, undefined, signal);\n if (modelsProbe.aborted) sawAbortedProbe = true;\n if (signal?.aborted) return false;\n if (modelsProbe.ok && isLlamaCppModelsResponse(modelsProbe.data)) {\n sawLlamaCppSignal = true;\n }\n if (modelsProbe.status === 401 || modelsProbe.status === 403) {\n sawUnauthorizedProbe = true;\n continue;\n }\n\n const authConfigured = Boolean(this.config.localLlmApiKey) && this.config.localLlmAuthHeader !== false;\n if (!sawLlamaCppSignal || (authConfigured && !modelsProbe.ok)) {\n continue;\n }\n }\n this.isAvailable = true;\n this.detectedType = serverConfig.type;\n this.lastHealthCheck = now;\n log.info(`detected ${serverConfig.type} at ${configuredBaseUrl}`);\n return true;\n }\n if (result.status === 401 || result.status === 403) {\n sawUnauthorizedProbe = true;\n }\n }\n if (signal?.aborted) return false;\n\n // Generic check if specific detection failed\n try {\n const modelsUrl = `${probeBaseUrl}/v1/models`;\n const result = await this.fetchWithTimeout(modelsUrl, 2000, undefined, signal);\n if (result.aborted) sawAbortedProbe = true;\n if (signal?.aborted) return false;\n if (result.ok) {\n this.isAvailable = true;\n this.detectedType = \"generic\";\n this.lastHealthCheck = now;\n log.info(`detected generic OpenAI-compatible server at ${configuredBaseUrl}`);\n return true;\n }\n if (result.status === 401 || result.status === 403) {\n sawUnauthorizedProbe = true;\n }\n } catch {\n // Fall through to unavailable\n }\n\n const wasAvailable = this.isAvailable;\n this.detectedType = null;\n if (sawUnauthorizedProbe) {\n log.warn(\n `local LLM availability probe was unauthorized at ${configuredBaseUrl}; verify localLlmApiKey and localLlmAuthHeader settings`,\n );\n }\n const verdict = resolveUnavailableVerdict({\n baseUrl: configuredBaseUrl,\n sawAbortedProbe,\n wasAvailable,\n });\n this.isAvailable = verdict.cacheVerdict ? false : null;\n this.lastHealthCheck = verdict.cacheVerdict ? now : 0;\n if (verdict.warning) log.warn(verdict.warning);\n log.debug(\"local LLM not available at\", configuredBaseUrl);\n return false;\n }\n\n /**\n * Try to get context window from LM Studio settings.json as fallback.\n * This reads the defaultContextLength setting which is what LM Studio uses\n * when loading models without explicit context configuration.\n */\n private getContextFromLmStudioSettings(): number | null {\n try {\n const homeDir = this.resolveHomeDir();\n const settingsPath = `${homeDir}/.cache/lm-studio/settings.json`;\n\n if (!fs.existsSync(settingsPath)) {\n log.debug(`LM Studio settings: file not found at ${settingsPath}`);\n return null;\n }\n\n const content = fs.readFileSync(settingsPath, \"utf-8\");\n const settings = JSON.parse(content) as {\n defaultContextLength?: {\n type?: string;\n value?: number;\n };\n };\n\n if (settings.defaultContextLength?.value) {\n const contextWindow = settings.defaultContextLength.value;\n log.debug(`LM Studio settings: found default context length: ${contextWindow}`);\n return contextWindow;\n }\n\n return null;\n } catch (err) {\n const errorMsg = err instanceof Error ? err.message : String(err);\n log.debug(`LM Studio settings: failed to read - ${errorMsg}`);\n return null;\n }\n }\n\n /**\n * Try to get context window from LMS CLI (LM Studio specific).\n * Uses --json flag for reliable parsing.\n * Returns null if LMS CLI is not available or model not found.\n */\n private getContextFromLmsCli(modelId: string): number | null {\n try {\n // Check if lms CLI exists in common locations.\n // HOME may be absent in launchd environments, so prefer the resolved helper.\n const homeDir = this.resolveHomeDir();\n const lmsPaths = [\n this.config.localLmsCliPath || \"\",\n `${homeDir}/.cache/lm-studio/bin/lms`,\n \"/usr/local/bin/lms\",\n \"/opt/homebrew/bin/lms\",\n ];\n\n const lmsPath = lmsPaths.find((p) => p.length > 0 && fs.existsSync(p));\n if (!lmsPath) {\n log.debug(`LMS CLI: not found in standard locations (checked: ${lmsPaths.join(\", \")})`);\n return null;\n }\n\n // Run lms ps --json to get loaded models with context\n // Use spawnSync with shell and explicit PATH to ensure lms can find its dependencies\n log.debug(`LMS CLI: running: ${lmsPath} ps --json`);\n const existingPath = readEnvVar(\"PATH\") || \"\";\n const result = launchProcessSync(lmsPath, [\"ps\", \"--json\"], {\n encoding: \"utf-8\",\n timeout: 5000,\n shell: false, // Don't use shell for JSON output - more reliable\n env: mergeEnv({\n PATH: `${this.config.localLmsBinDir || `${homeDir}/.cache/lm-studio/bin`}:/usr/local/bin:/opt/homebrew/bin:/usr/bin:/bin:${existingPath}`,\n HOME: homeDir,\n }),\n });\n\n if (result.error) {\n log.debug(`LMS CLI: spawn error - ${result.error.message}`);\n return null;\n }\n\n if (result.stderr && result.stderr.trim()) {\n log.debug(`LMS CLI: stderr - ${result.stderr.slice(0, 200)}`);\n }\n\n const output = result.stdout || \"\";\n if (!output.trim()) {\n log.debug(\"LMS CLI: empty output - LM Studio may not be running or no models loaded\");\n return null;\n }\n\n // Parse JSON output\n let models: Array<{\n identifier?: string;\n modelKey?: string;\n contextLength?: number;\n maxContextLength?: number;\n }>;\n\n try {\n models = JSON.parse(output) as typeof models;\n } catch (parseErr) {\n log.debug(`LMS CLI: JSON parse error - ${parseErr}`);\n return null;\n }\n\n if (!Array.isArray(models) || models.length === 0) {\n log.debug(\"LMS CLI: no models loaded\");\n return null;\n }\n\n // Find the model matching our configured model ID\n const model = models.find((m) =>\n m.identifier === modelId ||\n m.modelKey === modelId ||\n (m.identifier?.includes(modelId.replace(/@\\d+bit$/, \"\")))\n );\n\n if (!model) {\n log.debug(`LMS CLI: model \"${modelId}\" not found in loaded models: ${models.map(m => m.identifier).join(\", \")}`);\n return null;\n }\n\n // Use contextLength (actual configured) or fall back to maxContextLength (model max)\n const contextWindow = model.contextLength || model.maxContextLength;\n\n if (contextWindow) {\n log.info(`LMS CLI detected context window: ${contextWindow} for ${modelId} (max: ${model.maxContextLength})`);\n return contextWindow;\n }\n\n return null;\n } catch (err) {\n // LMS CLI not available or failed\n const errorMsg = err instanceof Error ? err.message : String(err);\n log.debug(`LMS CLI: failed - ${errorMsg}`);\n return null;\n }\n }\n\n /**\n * Get full model info from LMS CLI including context length and max context length.\n * Returns null if LMS CLI is unavailable or model not found.\n */\n private getLmsModelInfo(modelId: string): { contextLength: number; maxContextLength: number; identifier: string } | null {\n try {\n const result = launchProcessSync(\"lms\", [\"ps\", \"--json\"], {\n encoding: \"utf-8\",\n timeout: 5000,\n shell: false,\n });\n\n if (result.error) {\n return null;\n }\n\n const output = result.stdout || \"\";\n if (!output.trim()) {\n return null;\n }\n\n let models: Array<{\n identifier?: string;\n modelKey?: string;\n contextLength?: number;\n maxContextLength?: number;\n }>;\n\n try {\n models = JSON.parse(output) as typeof models;\n } catch {\n return null;\n }\n\n if (!Array.isArray(models) || models.length === 0) {\n return null;\n }\n\n const model = models.find((m) =>\n m.identifier === modelId ||\n m.modelKey === modelId ||\n (m.identifier?.includes(modelId.replace(/@\\d+bit$/, \"\")))\n );\n\n if (!model || !model.contextLength) {\n return null;\n }\n\n return {\n contextLength: model.contextLength,\n maxContextLength: model.maxContextLength || model.contextLength,\n identifier: model.identifier || modelId,\n };\n } catch {\n return null;\n }\n }\n\n /**\n * Get context window for the configured model, using cache if available.\n * This method caches the result to avoid repeated LMS CLI calls.\n * Order: ModelRegistry (persistent) -> memory cache -> LMS CLI -> settings.json\n */\n getCachedContextWindow(modelId: string): number | null {\n const now = Date.now();\n\n // 1. Check ModelRegistry for persisted context window\n if (this.modelRegistry) {\n const caps = this.modelRegistry.getCapabilities(modelId);\n if (caps.source === \"lmstudio\" && caps.contextWindow) {\n log.debug(`ModelRegistry: using persisted LM Studio context: ${caps.contextWindow}`);\n // Also update memory cache\n this.cachedLmsContext = caps.contextWindow;\n this.lastLmsCheck = now;\n return caps.contextWindow;\n }\n }\n\n // 2. Return in-memory cached value if still valid\n if (this.cachedLmsContext && now - this.lastLmsCheck < LocalLlmClient.LMS_CACHE_INTERVAL_MS) {\n log.debug(`LMS CLI: returning in-memory cached context: ${this.cachedLmsContext}`);\n return this.cachedLmsContext;\n }\n\n // 3. Try LMS CLI (authoritative source)\n const lmsInfo = this.getLmsModelInfo(modelId);\n if (lmsInfo?.contextLength) {\n this.cachedLmsContext = lmsInfo.contextLength;\n this.lastLmsCheck = now;\n // Calculate appropriate output tokens based on context size\n // Use 12.5% of context window, capped at 16K (generous but safe)\n const calculatedOutputTokens = Math.min(Math.floor(lmsInfo.contextLength / 8), 16384);\n const outputTokens = Math.max(calculatedOutputTokens, 4096); // Minimum 4K\n // Persist to ModelRegistry with detected capabilities\n if (this.modelRegistry) {\n this.modelRegistry.setCapabilities(modelId, {\n maxPositionEmbeddings: lmsInfo.maxContextLength || lmsInfo.contextLength,\n contextWindow: lmsInfo.contextLength,\n supportsExtendedContext: (lmsInfo.maxContextLength || lmsInfo.contextLength) > 65536,\n typicalOutputTokens: outputTokens,\n source: \"lmstudio\",\n });\n log.info(`LMS CLI: Stored capabilities for ${modelId}: ${lmsInfo.contextLength} context, ${outputTokens} output tokens`);\n }\n return lmsInfo.contextLength;\n }\n\n // Legacy: Try LMS CLI context only (fallback)\n const legacyContext = this.getContextFromLmsCli(modelId);\n if (legacyContext) {\n this.cachedLmsContext = legacyContext;\n this.lastLmsCheck = now;\n // Persist to ModelRegistry with calculated output tokens\n if (this.modelRegistry) {\n const calculatedOutputTokens = Math.min(Math.floor(legacyContext / 8), 16384);\n const outputTokens = Math.max(calculatedOutputTokens, 4096);\n this.modelRegistry.setCapabilities(modelId, {\n maxPositionEmbeddings: legacyContext,\n contextWindow: legacyContext,\n supportsExtendedContext: false,\n typicalOutputTokens: outputTokens,\n source: \"lmstudio\",\n });\n }\n return legacyContext;\n }\n\n // 4. Fall back to LM Studio settings.json\n const settingsContext = this.getContextFromLmStudioSettings();\n if (settingsContext) {\n log.info(`LM Studio settings: using default context: ${settingsContext}`);\n this.cachedLmsContext = settingsContext;\n this.lastLmsCheck = now;\n return settingsContext;\n }\n\n return null;\n }\n\n /**\n * Clear the LMS context cache. Call this when the model changes.\n */\n clearContextCache(): void {\n this.cachedLmsContext = null;\n this.lastLmsCheck = 0;\n log.debug(\"LMS CLI: context cache cleared\");\n }\n\n private remainingCooldownMs(now: number = Date.now()): number {\n return Math.max(0, this.cooldownUntilMs - now);\n }\n\n private scheduleQueueDrain(): void {\n if (this.queueDrainScheduled) return;\n this.queueDrainScheduled = true;\n\n queueMicrotask(() => {\n this.queueDrainScheduled = false;\n this.startAvailableQueuedRequests();\n });\n }\n\n /** True when a background-priority request occupies or awaits this client's local lane (issue #2011). */\n isBackgroundLaneContended(): boolean {\n return this.queueProcessing.has(\"background\") || this.requestQueues.background.length > 0;\n }\n\n private dequeueQueuedRequest(priority: LocalLlmRequestPriority): LocalLlmQueuedRequest | null {\n const next = this.requestQueues[priority].shift();\n return next ?? null;\n }\n\n private failOpenQueuedRequestsForCooldown(): number {\n let dropped = 0;\n for (const priority of [\"recall-critical\", \"background\"] as const) {\n while (this.requestQueues[priority].length > 0) {\n const queued = this.requestQueues[priority].shift();\n queued?.resolve(null);\n dropped += 1;\n }\n }\n return dropped;\n }\n\n private startAvailableQueuedRequests(): void {\n if (!this.queueProcessing.has(\"recall-critical\")) {\n const nextCritical = this.dequeueQueuedRequest(\"recall-critical\");\n if (nextCritical) {\n this.queueProcessing.add(\"recall-critical\");\n void this.runQueuedRequest(nextCritical);\n }\n }\n\n if (!this.queueProcessing.has(\"background\")) {\n const nextBackground = this.dequeueQueuedRequest(\"background\");\n if (nextBackground) {\n this.queueProcessing.add(\"background\");\n void this.runQueuedRequest(nextBackground);\n }\n }\n }\n\n private async runQueuedRequest(next: LocalLlmQueuedRequest): Promise<void> {\n try {\n if (combineClientAbortSignals(next.options.signal, this.shutdownSignal)?.aborted) {\n next.resolve(null);\n return;\n }\n const remainingCooldownMs = this.remainingCooldownMs();\n if (remainingCooldownMs > 0) {\n const additionalDropped = this.failOpenQueuedRequestsForCooldown();\n log.warn(\n `local LLM: cooldown active (${remainingCooldownMs}ms remaining), dropping ${additionalDropped + 1} queued request(s) fail-open`,\n );\n next.resolve(null);\n return;\n }\n\n let result: LocalLlmChatCompletionResult | null = null;\n try {\n result = await this.runChatCompletionRequest(next.messages, next.options, {\n priority: next.priority,\n enqueuedAtMs: next.enqueuedAtMs,\n });\n } catch (err) {\n log.warn(`local LLM queue drain failed open: ${next.options.redactProviderErrors ? \"provider error details redacted\" : err instanceof Error ? err.message : String(err)}`);\n }\n next.resolve(result);\n } finally {\n this.queueProcessing.delete(next.priority);\n if (this.requestQueues[\"recall-critical\"].length > 0 || this.requestQueues.background.length > 0) {\n this.scheduleQueueDrain();\n }\n }\n }\n\n private async runChatCompletionRequest(\n messages: Array<{ role: string; content: string }>,\n options: LocalLlmChatCompletionOptions,\n queueMeta?: { priority: LocalLlmRequestPriority; enqueuedAtMs: number },\n ): Promise<LocalLlmChatCompletionResult | null> {\n log.debug(\n `local LLM chatCompletion: localLlmEnabled=${resolveLocalLlmCapabilities(this.config).localLlm}, model=${this.config.localLlmModel}`,\n );\n\n const operation = options.operation ?? \"unspecified\";\n const startedAtMs = Date.now();\n if (queueMeta) {\n log.debug(\n `local LLM queue start: priority=${queueMeta.priority} waitMs=${startedAtMs - queueMeta.enqueuedAtMs} op=${operation}`,\n );\n }\n\n let chatUrl = \"\";\n try {\n const signal = combineClientAbortSignals(options.signal, this.shutdownSignal);\n if (signal?.aborted) return null;\n const baseUrl = trimTrailingSlashes(\n this.config.localLlmUrl.replace(\"localhost\", \"127.0.0.1\"),\n );\n chatUrl = baseUrl.endsWith(\"/v1\")\n ? `${baseUrl}/chat/completions`\n : `${baseUrl}/v1/chat/completions`;\n const isAvailable = await this.checkAvailability(signal, chatUrl, operation);\n if (!isAvailable) {\n log.debug(\n `local LLM: checkAvailability returned false for ${this.config.localLlmUrl} op=${operation}`,\n );\n return null;\n }\n\n const promptChars = messages.reduce((sum, m) => sum + (m.content?.length ?? 0), 0);\n const requestModel = options.model ?? this.config.localLlmModel;\n const requestBody: LocalLlmChatRequestBody = {\n model: requestModel,\n messages,\n temperature: options.temperature ?? 0.7,\n // Use max_tokens consistent with cloud models\n max_tokens: options.maxTokens ?? 4096,\n stream: false,\n };\n this.nativeSchemaGate.attach(requestBody, options, requestModel);\n\n // Suppress thinking/reasoning for operations that benefit from terse,\n // structured output. Thinking-capable models (Qwen 3.5, Gemma 4,\n // DeepSeek) default to thinking-on via their chat template; sending\n // `chat_template_kwargs: { enable_thinking: false }` tells the template\n // to skip reasoning tokens. Consolidation operations on the main client\n // intentionally keep thinking enabled so entity resolution and\n // deduplication can use the model's reasoning path. Fast-tier callers can\n // still force suppression per request to preserve their low-latency\n // contract.\n //\n // Gate the injection on detected backend support (issue #548,\n // Codex P1 on PR #550): `chat_template_kwargs` is an LM Studio /\n // vLLM / llama.cpp extension, not part of standard OpenAI chat\n // completions. Strict OpenAI-compatible backends reject\n // unknown fields with 400, which trips the 400-cooldown path and\n // can effectively disable local extraction. Fail open when the\n // backend hasn't been positively identified as thinking-capable.\n const shouldSuppressThinking =\n options.forceDisableThinking === true ||\n ((options.disableThinking ?? this._disableThinking) &&\n THINKING_SUPPRESSED_OPERATIONS.has(operation));\n if (\n shouldSuppressThinking &&\n this.detectedType !== null &&\n THINKING_COMPATIBLE_BACKENDS.has(this.detectedType)\n ) {\n requestBody.chat_template_kwargs = { enable_thinking: false };\n } else if (shouldSuppressThinking && this.detectedType === \"ollama\") {\n // Ollama's /v1 endpoint silently drops `chat_template_kwargs` AND\n // `enable_thinking` — the ONLY field it maps to think-off is\n // `reasoning_effort` (\"none\" → ThinkValue{false} in openai.go;\n // verified against Ollama 0.32.0 source and live probes,\n // issue #1996). Without this, thinking-capable models (Gemma 4,\n // Qwen 3.5+) burn 1,700-2,000 reasoning tokens per extraction on\n // Ollama, exceed the client timeout, and retry forever. The effort\n // is configurable via `localLlmReasoningEffort` (default \"none\");\n // an empty value disables injection (pre-#1996 behavior).\n const effort = this.config.localLlmReasoningEffort;\n if (effort) {\n requestBody.reasoning_effort = effort;\n }\n }\n\n let requestBodyJson = JSON.stringify(requestBody);\n log.debug(\n `local LLM: sending request to ${chatUrl} with model ${this.config.localLlmModel}`,\n );\n // Avoid logging request bodies by default (can contain sensitive user content).\n log.debug(`local LLM: request body length=${requestBodyJson.length}`);\n\n const effectiveTimeoutMs =\n typeof options.timeoutMs === \"number\"\n ? Math.min(this.config.localLlmTimeoutMs, options.timeoutMs)\n : this.config.localLlmTimeoutMs;\n const maxAttempts = 1 + Math.max(0, this.config.localLlmRetry5xxCount);\n // COS-447: rate-limit responses (429/503/408, LiteLLM cooldown) get\n // their own retry budget with exponential full-jitter backoff, and a\n // process-wide semaphore caps concurrent HTTP attempts across clients.\n // Waits are bounded by the request timeout so a short caller budget\n // (e.g. rerankTimeoutMs) is never stretched by a long cooldown.\n const rateLimit = new LocalLlmRateLimitSession(\n formatLocalLlmPoolKey(chatUrl, operation),\n resolveRateLimitSettings(this.config),\n (queueMeta?.priority ?? options.priority) === \"recall-critical\",\n effectiveTimeoutMs,\n );\n let lastRateLimitDelayMs: number | null = null;\n let response: Response | null = null, responseBody = \"\";\n let lastAbortError: Error | null = null;\n for (let attempt = 1; attempt <= maxAttempts; attempt += 1) {\n response = null;\n responseBody = \"\";\n // Wait out the shared endpoint backoff, then take a concurrency slot.\n const gate = await rateLimit.beforeAttempt(signal);\n if (gate.kind === \"skip\") {\n log.warn(gate.reason === \"queue\"\n ? `local LLM concurrency queue exceeded the ${effectiveTimeoutMs}ms request budget; skipping request (op=${operation})`\n : `local LLM rate-limit backoff active (${gate.remainingMs}ms remaining); skipping request (op=${operation})`);\n if (options.failureDiag)\n options.failureDiag.lastError = Object.assign(new Error(\"local LLM rate limited\"), { status: 429 });\n return null;\n }\n if (gate.kind === \"aborted\") return null;\n const attemptAbort = new AbortController();\n const onCallerAbort = (): void => {\n attemptAbort.abort(signal?.reason);\n };\n if (signal) {\n if (signal.aborted) {\n onCallerAbort();\n } else {\n signal.addEventListener(\"abort\", onCallerAbort, { once: true });\n }\n }\n const attemptTimeout = setTimeout(() => attemptAbort.abort(), effectiveTimeoutMs);\n const routingHeaders = buildLocalLlmRoutingHeaders(operation, options.priority);\n const postAttempt = (bodyJson: string): Promise<Response> => this.chatTransport.post({\n url: chatUrl,\n headers: this.buildRequestHeaders(routingHeaders),\n body: bodyJson,\n signal: attemptAbort.signal,\n budgetMs: this.config.localLlmTimeoutMs,\n });\n try {\n response = await postAttempt(requestBodyJson);\n responseBody = await response.text();\n if (\n response.status === 400 &&\n requestBody.response_format &&\n isUnsupportedJsonSchemaError(`400 ${responseBody}`)\n ) {\n this.nativeSchemaGate.rememberRejection(requestModel);\n // Match gateway degradation without extending this attempt's deadline.\n delete requestBody.response_format;\n requestBodyJson = JSON.stringify(requestBody);\n log.debug(\"local LLM rejected native JSON schema; retrying without it\");\n response = null;\n response = await postAttempt(requestBodyJson);\n responseBody = await response.text();\n }\n } catch (err) {\n const error = err instanceof Error ? err : new Error(String(err));\n if (signal?.aborted) {\n response = null;\n lastAbortError = error;\n break;\n }\n if (response && !response.ok) {\n log.debug(`local LLM failed to read ${response.status} response body: ${options.redactProviderErrors ? \"details redacted\" : error.message}`);\n } else {\n response = null;\n if (!isAbortError(err)) throw err;\n lastAbortError = error;\n if (attempt >= maxAttempts) break;\n const backoffMs = this.config.localLlmRetryBackoffMs * attempt;\n log.warn(\n `local LLM request aborted: op=${operation} attempt=${attempt}/${maxAttempts} timeoutMs=${effectiveTimeoutMs} model=${this.config.localLlmModel}; retrying after ${backoffMs}ms`,\n );\n if (!(await waitForRetryBackoff(backoffMs, signal))) return null;\n continue;\n }\n } finally {\n clearTimeout(attemptTimeout);\n signal?.removeEventListener(\"abort\", onCallerAbort);\n gate.release();\n }\n\n if (response.ok) {\n rateLimit.onSuccess();\n break;\n }\n if (response.status >= 500 && attempt < maxAttempts) {\n const nonRecoverableReason = extractNonRecoverableBackendReasonFromErrorText(responseBody);\n if (nonRecoverableReason) {\n this.markBackendUnavailable(\n nonRecoverableReason,\n this.config.localLlm400CooldownMs,\n chatUrl,\n operation,\n );\n this.consecutive400s = 0;\n return null;\n }\n }\n const decision = rateLimit.onResponse(response.status, response.headers?.get(\"retry-after\"), responseBody);\n lastRateLimitDelayMs = decision.kind === \"not-rate-limited\" ? null : decision.delayMs;\n if (decision.kind === \"give-up\") break;\n if (decision.kind === \"retry\") {\n log.warn(`local LLM rate limited: ${response.status}; backing off ${decision.delayMs}ms before retry ${decision.retry}/${rateLimit.settings.retryCount} (op=${operation}, serverHintMs=${decision.hintMs ?? \"none\"}, consecutive=${decision.consecutive})`);\n attempt -= 1; // own retry budget; the loop top waits out the backoff\n continue;\n }\n // A terminal pool-unavailable 503 must not reach the generic 5xx retry.\n if (isTerminalLocalLlmProxyPoolError(response.status, responseBody)) break;\n if (response.status < 500 || attempt >= maxAttempts) break;\n\n const backoffMs = this.config.localLlmRetryBackoffMs * attempt;\n log.warn(\n `local LLM request got ${response.status}; retrying (attempt ${attempt + 1}/${maxAttempts}) after ${backoffMs}ms`,\n );\n if (!(await waitForRetryBackoff(backoffMs, signal))) return null;\n }\n log.debug(\n `local LLM: received response, status=${response?.status}, ok=${response?.ok}`,\n );\n if (!response) {\n if (lastAbortError) {\n log.warn(\n `local LLM request aborted after ${maxAttempts} attempt(s): op=${operation} timeoutMs=${effectiveTimeoutMs} model=${this.config.localLlmModel} promptChars=${promptChars} durationMs=${Date.now() - startedAtMs}${queueMeta ? ` waitMs=${startedAtMs - queueMeta.enqueuedAtMs}` : \"\"}`,\n );\n } else {\n log.warn(\n `local LLM request failed: no response object (op=${operation} model=${this.config.localLlmModel} durationMs=${Date.now() - startedAtMs})`,\n );\n }\n return null;\n }\n\n if (!response.ok) {\n if (lastRateLimitDelayMs !== null)\n log.warn(`local LLM rate-limit retries exhausted: op=${operation} retries=${rateLimit.retryCount} nextBackoffMs=${lastRateLimitDelayMs}`);\n let reason = \"\";\n try {\n const parsed = JSON.parse(responseBody) as { error?: { message?: string } };\n reason = parsed?.error?.message ? ` — ${parsed.error.message}` : \"\";\n } catch {\n if (!options.redactProviderErrors) log.debug(`local LLM error body: ${responseBody.slice(0, 500)}`);\n }\n log.warn(\n `local LLM request failed: ${response.status}${options.redactProviderErrors ? \"\" : ` ${response.statusText}${reason}`} ` +\n `(op=${operation}, model=${this.config.localLlmModel}, url=${chatUrl}, promptChars=${promptChars}, maxTokens=${requestBody.max_tokens as number})`,\n );\n const nonRecoverableReason =\n extractNonRecoverableBackendReason(reason) ??\n extractNonRecoverableBackendReasonFromErrorText(responseBody);\n if (nonRecoverableReason) {\n this.markBackendUnavailable(\n nonRecoverableReason,\n this.config.localLlm400CooldownMs,\n chatUrl,\n operation,\n );\n this.consecutive400s = 0;\n return null;\n }\n if (response.status === 400) {\n this.consecutive400s += 1;\n if (this.consecutive400s >= this.config.localLlm400TripThreshold) {\n this.cooldownUntilMs = Date.now() + this.config.localLlm400CooldownMs;\n log.warn(\n `local LLM: entering cooldown for ${this.config.localLlm400CooldownMs}ms ` +\n `after ${this.consecutive400s} consecutive 400 responses`,\n );\n this.consecutive400s = 0;\n }\n } else {\n this.consecutive400s = 0;\n }\n if (options.failureDiag)\n options.failureDiag.lastError = Object.assign(new Error(\"local LLM http failure\"), {\n status: response.status,\n });\n return null;\n }\n this.consecutive400s = 0;\n this.nativeSchemaGate.recordSuccess(requestBody, requestModel);\n\n // SAFETY: OpenAI-compatible wire format; every field is optional and read defensively below.\n const data = JSON.parse(responseBody) as {\n choices?: Array<{ message?: { content?: string; reasoning_content?: string }; finish_reason?: string }>;\n usage?: {\n prompt_tokens?: number;\n completion_tokens?: number;\n total_tokens?: number;\n };\n };\n\n log.debug(\n `local LLM response: choices=${data.choices?.length}, usage=${JSON.stringify(data.usage)}`,\n );\n\n // Thinking models (e.g. Qwen 3.5) may put their response in\n // `reasoning_content` and leave `content` empty. Fall back to\n // reasoning_content so engram still gets a usable result.\n const msg = data.choices?.[0]?.message;\n if (options.failureDiag) options.failureDiag.finishReason = data.choices?.[0]?.finish_reason;\n const content = msg?.content || msg?.reasoning_content || \"\";\n if (!content) {\n log.warn(`local LLM returned empty content.${options.redactProviderErrors ? \"\" : ` choices=${JSON.stringify(data.choices)?.slice(0, 200)}`}`);\n return null;\n }\n\n // Estimate tokens if not provided by local LLM\n const usage = data.usage\n ? {\n promptTokens: data.usage.prompt_tokens ?? 0,\n completionTokens: data.usage.completion_tokens ?? 0,\n totalTokens: data.usage.total_tokens ?? 0,\n }\n : this.estimateTokens(messages, content);\n\n const durationMs = Date.now() - startedAtMs;\n if (resolvePipelineProcessingCapabilities(this.config).slowLog && durationMs >= this.config.slowLogThresholdMs) {\n const promptChars = messages.reduce((sum, m) => sum + (m.content?.length ?? 0), 0);\n const op = options.operation ? ` op=${options.operation}` : \"\";\n log.warn(\n `SLOW local LLM:${op} durationMs=${durationMs} model=${this.config.localLlmModel} url=${chatUrl} promptChars=${promptChars} outputTokens=${usage.completionTokens} totalTokens=${usage.totalTokens}`,\n );\n }\n\n log.debug(\"local LLM: request succeeded, tokens:\", usage.totalTokens);\n return { content, usage };\n } catch (err) {\n const errMsg = err instanceof Error ? err.message : String(err);\n const durationMs = Date.now() - startedAtMs;\n if (isAbortError(err)) {\n log.warn(\n `local LLM request aborted: op=${operation} timeoutMs=${options.timeoutMs ?? this.config.localLlmTimeoutMs} model=${this.config.localLlmModel} durationMs=${durationMs} error=${options.redactProviderErrors ? \"provider error details redacted\" : errMsg}`,\n );\n return null;\n }\n log.warn(`local LLM request error: op=${operation} error=${options.redactProviderErrors ? \"provider error details redacted\" : errMsg}`);\n this.isAvailable = false; // Mark as unavailable on non-abort errors\n const nonRecoverableReason = extractNonRecoverableBackendReason(errMsg);\n if (nonRecoverableReason && chatUrl.length > 0) {\n this.markBackendUnavailable(\n nonRecoverableReason,\n this.config.localLlm400CooldownMs,\n chatUrl,\n operation,\n );\n }\n return null;\n } finally {\n if (queueMeta) {\n const finishedAtMs = Date.now();\n const waitMs = startedAtMs - queueMeta.enqueuedAtMs;\n log.debug(\n `local LLM queue finish: priority=${queueMeta.priority} waitMs=${waitMs} runMs=${finishedAtMs - startedAtMs} totalMs=${finishedAtMs - queueMeta.enqueuedAtMs} op=${operation}`,\n );\n }\n }\n }\n\n /**\n * Query the local LLM server for loaded model information.\n * Returns null if unavailable or if the model is not found.\n */\n async getLoadedModelInfo(): Promise<LocalModelInfo | null> {\n const baseUrl = trimTrailingSlashes(\n this.config.localLlmUrl.replace(\"localhost\", \"127.0.0.1\"),\n );\n\n // Handle URL construction - localLlmUrl may already include /v1\n const modelsUrl = baseUrl.endsWith(\"/v1\")\n ? `${baseUrl}/models`\n : `${baseUrl}/v1/models`;\n log.debug(`Fetching model info from ${modelsUrl}`);\n\n try {\n const result = await this.fetchWithTimeout(modelsUrl, 3000);\n if (!result.ok) {\n if (result.status === 401 || result.status === 403) {\n log.warn(\n `Local LLM: unauthorized while fetching models from ${modelsUrl}; verify localLlmApiKey and localLlmAuthHeader settings`,\n );\n }\n log.warn(`Local LLM: Failed to fetch models from ${modelsUrl} - server returned error`);\n return null;\n }\n if (!result.data) {\n log.warn(`Local LLM: No data returned from ${modelsUrl}`);\n return null;\n }\n\n const data = result.data as {\n data?: Array<{\n id?: string;\n object?: string;\n owned_by?: string;\n // LM Studio specific fields\n max_context_length?: number;\n max_tokens?: number;\n // Ollama specific\n name?: string;\n details?: {\n parameter_size?: string;\n family?: string;\n };\n }>;\n };\n\n if (!Array.isArray(data.data) || data.data.length === 0) {\n log.warn(\"Local LLM returned no models\");\n return null;\n }\n\n // Verbose model listings are noisy on every gateway restart. Keep it debug-only.\n const modelIds = data.data.map((m) => m.id).filter(Boolean);\n log.debug(\n `Local LLM: Found ${modelIds.length} model(s). First 10: ${modelIds.slice(0, 10).join(\", \")}`,\n );\n\n // Find the model matching our configured model ID\n const configuredModel = this.config.localLlmModel;\n let model = data.data.find((m) => m.id === configuredModel);\n\n // If not found by exact match, try partial match (handle suffixes like @4bit)\n if (!model) {\n model = data.data.find((m) =>\n configuredModel.includes(m.id || \"\") ||\n (m.id || \"\").includes(configuredModel.replace(/@\\d+bit$/, \"\"))\n );\n }\n\n // If still not found, use the first loaded model and warn\n if (!model) {\n model = data.data[0];\n const availablePreview = data.data\n .map((m) => m.id)\n .filter(Boolean)\n .slice(0, 10)\n .join(\", \");\n log.warn(\n `Configured model \"${configuredModel}\" not found in local LLM. ` +\n `Using \"${model.id}\" instead. Available (first 10): ${availablePreview}`\n );\n }\n\n // Extract context window - try multiple field names\n let contextWindow = model.max_context_length || model.max_tokens;\n\n // If API doesn't report context window, try LMS CLI (LM Studio specific)\n if (!contextWindow) {\n log.info(\"Local LLM: API did not report context window, trying LMS CLI...\");\n const lmsContext = this.getCachedContextWindow(model.id || \"\");\n if (lmsContext) {\n contextWindow = lmsContext;\n }\n }\n\n this.cachedModelInfo = {\n id: model.id || \"unknown\",\n contextWindow: contextWindow,\n maxTokens: model.max_tokens,\n };\n\n log.info(\n `Local LLM model detected: ${this.cachedModelInfo.id}, ` +\n `context window: ${contextWindow?.toLocaleString() || \"unknown (may use default)\"}`\n );\n\n return this.cachedModelInfo;\n } catch (err) {\n log.warn(`Failed to fetch model info: ${err}`);\n return null;\n }\n }\n\n /**\n * Check if the configured model is available and get its actual context window.\n * Warns if there's a mismatch between expected and actual context.\n */\n async validateModelConfig(expectedContextWindow?: number): Promise<{\n available: boolean;\n actualContextWindow?: number;\n warnings: string[];\n }> {\n const warnings: string[] = [];\n\n const modelInfo = await this.getLoadedModelInfo();\n if (!modelInfo) {\n return { available: false, warnings: [\"Could not query local LLM for model info\"] };\n }\n\n // If we have expected context and the server reports one, check for mismatch\n if (expectedContextWindow && modelInfo.contextWindow) {\n if (modelInfo.contextWindow < expectedContextWindow) {\n warnings.push(\n `Context window mismatch: Model ${modelInfo.id} supports ${modelInfo.contextWindow.toLocaleString()} tokens, ` +\n `but engram is configured for ${expectedContextWindow.toLocaleString()}. ` +\n `Set localLlmMaxContext: ${modelInfo.contextWindow} in config to avoid errors.`\n );\n }\n }\n\n // Warn if server doesn't report context window (common with some local LLM setups)\n if (!modelInfo.contextWindow) {\n warnings.push(\n `Local LLM server did not report context window for ${modelInfo.id}. ` +\n `If you get \"context length exceeded\" errors, set localLlmMaxContext in config.`\n );\n }\n\n return {\n available: true,\n actualContextWindow: modelInfo.contextWindow,\n warnings,\n };\n }\n\n /**\n * Make a chat completion request to local LLM\n */\n async chatCompletion(\n messages: Array<{ role: string; content: string }>,\n options: LocalLlmChatCompletionOptions = {},\n ): Promise<LocalLlmChatCompletionResult | null> {\n if (!resolveLocalLlmCapabilities(this.config).localLlm) {\n log.debug(\"local LLM: disabled, returning null\");\n return null;\n }\n\n const remainingMs = this.remainingCooldownMs();\n if (remainingMs > 0) {\n log.debug(`local LLM: cooldown active (${remainingMs}ms remaining), skipping request`);\n return null;\n }\n if (options.priority) {\n const priority = options.priority;\n const signal = combineClientAbortSignals(options.signal, this.shutdownSignal);\n return await new Promise<LocalLlmChatCompletionResult | null>((resolve) => {\n let settled = false;\n let onAbort: (() => void) | undefined;\n const finish = (value: LocalLlmChatCompletionResult | null): void => {\n if (settled) return;\n settled = true;\n if (onAbort) signal?.removeEventListener(\"abort\", onAbort);\n resolve(value);\n };\n const queued: LocalLlmQueuedRequest = {\n messages,\n options,\n priority,\n enqueuedAtMs: Date.now(),\n resolve: finish,\n };\n onAbort = () => {\n const queue = this.requestQueues[priority];\n const index = queue.indexOf(queued);\n if (index >= 0) queue.splice(index, 1);\n finish(null);\n };\n this.requestQueues[priority].push(queued);\n if (signal?.aborted) onAbort();\n else if (signal) signal.addEventListener(\"abort\", onAbort, { once: true });\n this.scheduleQueueDrain();\n });\n }\n\n return await this.runChatCompletionRequest(messages, options);\n }\n /**\n * Estimate tokens when local LLM does not return usage stats.\n */\n private estimateTokens(\n messages: Array<{ role: string; content: string }>,\n response: string\n ): { promptTokens: number; completionTokens: number; totalTokens: number } {\n const promptTokens = messages.reduce((sum, message) => sum + estimateTokenCount(message.content), 0);\n const completionTokens = estimateTokenCount(response);\n\n return {\n promptTokens,\n completionTokens,\n totalTokens: promptTokens + completionTokens,\n };\n }\n\n /**\n * Try local LLM first, fallback to cloud provider if configured\n */\n async withFallback<T>(\n localOperation: () => Promise<T | null>,\n fallbackOperation: () => Promise<T>,\n operationName: string\n ): Promise<T> {\n // Try local LLM first if enabled\n if (resolveLocalLlmCapabilities(this.config).localLlm) {\n const localResult = await localOperation();\n if (localResult !== null) {\n log.debug(`${operationName}: used local LLM`);\n return localResult;\n }\n\n // Local failed or unavailable\n if (this.config.localLlmFallback) {\n log.info(`${operationName}: local LLM unavailable, falling back to cloud`);\n } else {\n throw new Error(`${operationName}: local LLM unavailable and fallback disabled`);\n }\n }\n\n // Use fallback (cloud provider)\n return fallbackOperation();\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,OAAO,QAAQ;AACf,OAAO,QAAQ;AAoCf,SAAS,oBAAoB,GAAmB;AAC9C,MAAI,MAAM,EAAE;AACZ,SAAO,MAAM,KAAK,EAAE,MAAM,CAAC,MAAM,IAAK;AACtC,SAAO,EAAE,UAAU,GAAG,GAAG;AAC3B;AAEA,SAAS,oBAAoB,GAAmB;AAC9C,SAAO,EAAE,SAAS,KAAK,IAAI,EAAE,MAAM,GAAG,EAAE,IAAI;AAC9C;AAEA,SAAS,wBAAwB,OAAyB;AACxD,SACE,eAAe,KAAK,KACpB,eAAe,MAAM,2BAA2B,KAChD,OAAO,MAAM,gBAAgB,aAE3B,OAAO,MAAM,eAAe,YAC5B,OAAO,MAAM,kBAAkB,YAC/B,OAAO,MAAM,eAAe;AAGlC;AAEA,SAAS,yBAAyB,OAAyB;AACzD,MAAI,CAAC,eAAe,KAAK,KAAK,CAAC,MAAM,QAAQ,MAAM,IAAI,GAAG;AACxD,WAAO;AAAA,EACT;AACA,SAAO,MAAM,KAAK,KAAK,CAAC,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gB,MAAM;AACxB,YAAI,MAAM,GAAG,aAAa,kBAAkB;AAC5C,eAAO;AAAA,MACT;AAGA,UAAI,KAAK,OAAO,kBAAkB;AAChC,YAAI,KAAK,GAAG,aAAa,gDAAgD;AAAA,MAC3E,OAAO;AACL,cAAM,IAAI,MAAM,GAAG,aAAa,+CAA+C;AAAA,MACjF;AAAA,IACF;AAGA,WAAO,kBAAkB;AAAA,EAC3B;AACF;","names":["backoffMs","promptChars"]}
|
package/dist/cli.js
CHANGED
|
@@ -91,7 +91,7 @@ import {
|
|
|
91
91
|
runWorkProductStatusCliCommand,
|
|
92
92
|
runWorkProjectCliCommand,
|
|
93
93
|
runWorkTaskCliCommand
|
|
94
|
-
} from "./chunk-
|
|
94
|
+
} from "./chunk-3RHD5TF5.js";
|
|
95
95
|
import "./chunk-TH6OYP6I.js";
|
|
96
96
|
import "./chunk-PQM3B54K.js";
|
|
97
97
|
import "./chunk-2MWKUVHT.js";
|
|
@@ -107,7 +107,7 @@ import "./chunk-K3KSTSGM.js";
|
|
|
107
107
|
import "./chunk-BV2TIZ4F.js";
|
|
108
108
|
import "./chunk-Z734BLO3.js";
|
|
109
109
|
import "./chunk-HDDRVXX4.js";
|
|
110
|
-
import "./chunk-
|
|
110
|
+
import "./chunk-5V3IBSVB.js";
|
|
111
111
|
import "./chunk-OZKVVUJB.js";
|
|
112
112
|
import "./chunk-2DL3OFLD.js";
|
|
113
113
|
import "./chunk-G4IAEX6D.js";
|
|
@@ -121,7 +121,7 @@ import "./chunk-FGDKJJZS.js";
|
|
|
121
121
|
import "./chunk-AJVLDJU6.js";
|
|
122
122
|
import "./chunk-TBUEE7XF.js";
|
|
123
123
|
import "./chunk-5PHOU5QI.js";
|
|
124
|
-
import "./chunk-
|
|
124
|
+
import "./chunk-UADAXWUJ.js";
|
|
125
125
|
import "./chunk-I74SUMNI.js";
|
|
126
126
|
import "./chunk-ILNPU5W5.js";
|
|
127
127
|
import "./chunk-VZAKYDMJ.js";
|
|
@@ -151,7 +151,7 @@ import "./chunk-4AKPTHOO.js";
|
|
|
151
151
|
import "./chunk-TECVW3JP.js";
|
|
152
152
|
import "./chunk-C5JF6EZ7.js";
|
|
153
153
|
import "./chunk-2524MOWK.js";
|
|
154
|
-
import "./chunk-
|
|
154
|
+
import "./chunk-BT5TAOXG.js";
|
|
155
155
|
import "./chunk-JVBAPAWZ.js";
|
|
156
156
|
import "./chunk-HSSERO3E.js";
|
|
157
157
|
import "./chunk-NOUJNHWG.js";
|
|
@@ -188,7 +188,7 @@ import "./chunk-OBPOIZNR.js";
|
|
|
188
188
|
import "./chunk-ECZU5BJH.js";
|
|
189
189
|
import "./chunk-77NTFICT.js";
|
|
190
190
|
import "./chunk-LJLGH2DE.js";
|
|
191
|
-
import "./chunk-
|
|
191
|
+
import "./chunk-TXVTNDQT.js";
|
|
192
192
|
import "./chunk-HNOSWPKG.js";
|
|
193
193
|
import "./chunk-ODZKV2F7.js";
|
|
194
194
|
import "./chunk-WWDO7ZWM.js";
|
|
@@ -229,7 +229,7 @@ import "./chunk-VYDGHJIN.js";
|
|
|
229
229
|
import "./chunk-6NPLVV6M.js";
|
|
230
230
|
import "./chunk-7O5EW7KX.js";
|
|
231
231
|
import "./chunk-H7XKCNR6.js";
|
|
232
|
-
import "./chunk-
|
|
232
|
+
import "./chunk-DRXFLPSE.js";
|
|
233
233
|
import "./chunk-H6OTEBPK.js";
|
|
234
234
|
import "./chunk-SOBJ6NEY.js";
|
|
235
235
|
import "./chunk-O7CHKXSF.js";
|
|
@@ -284,7 +284,7 @@ import "./chunk-64NJRYU2.js";
|
|
|
284
284
|
import "./chunk-U2PSE7MB.js";
|
|
285
285
|
import "./chunk-BPPUH5JM.js";
|
|
286
286
|
import "./chunk-LEO4MQ3S.js";
|
|
287
|
-
import "./chunk-
|
|
287
|
+
import "./chunk-52EM4UQU.js";
|
|
288
288
|
import "./chunk-EI6V5UXY.js";
|
|
289
289
|
import "./chunk-773QSFFN.js";
|
|
290
290
|
import "./chunk-YAVIBVCU.js";
|
|
@@ -392,11 +392,11 @@ import "./chunk-QASTQVGK.js";
|
|
|
392
392
|
import "./chunk-CSAKJVXW.js";
|
|
393
393
|
import "./chunk-K2XUWZBM.js";
|
|
394
394
|
import "./chunk-OD4FM2U7.js";
|
|
395
|
-
import "./chunk-
|
|
395
|
+
import "./chunk-YOR5QBEU.js";
|
|
396
396
|
import "./chunk-MJFL75J6.js";
|
|
397
|
-
import "./chunk-
|
|
397
|
+
import "./chunk-GT2HWRST.js";
|
|
398
398
|
import "./chunk-U4LUIE6Y.js";
|
|
399
|
-
import "./chunk-
|
|
399
|
+
import "./chunk-KYZMCH4I.js";
|
|
400
400
|
import "./chunk-5YQXWVCP.js";
|
|
401
401
|
import "./chunk-YN2DQ2D6.js";
|
|
402
402
|
import "./chunk-FKBGK3NC.js";
|
package/dist/explicit-capture.js
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
shouldSkipImplicitExtraction,
|
|
9
9
|
stripInlineExplicitCaptureNotes,
|
|
10
10
|
validateExplicitCaptureInput
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-3RHD5TF5.js";
|
|
12
12
|
import "./chunk-TH6OYP6I.js";
|
|
13
13
|
import "./chunk-PQM3B54K.js";
|
|
14
14
|
import "./chunk-2MWKUVHT.js";
|
|
@@ -24,7 +24,7 @@ import "./chunk-K3KSTSGM.js";
|
|
|
24
24
|
import "./chunk-BV2TIZ4F.js";
|
|
25
25
|
import "./chunk-Z734BLO3.js";
|
|
26
26
|
import "./chunk-HDDRVXX4.js";
|
|
27
|
-
import "./chunk-
|
|
27
|
+
import "./chunk-5V3IBSVB.js";
|
|
28
28
|
import "./chunk-OZKVVUJB.js";
|
|
29
29
|
import "./chunk-2DL3OFLD.js";
|
|
30
30
|
import "./chunk-G4IAEX6D.js";
|
|
@@ -38,7 +38,7 @@ import "./chunk-FGDKJJZS.js";
|
|
|
38
38
|
import "./chunk-AJVLDJU6.js";
|
|
39
39
|
import "./chunk-TBUEE7XF.js";
|
|
40
40
|
import "./chunk-5PHOU5QI.js";
|
|
41
|
-
import "./chunk-
|
|
41
|
+
import "./chunk-UADAXWUJ.js";
|
|
42
42
|
import "./chunk-I74SUMNI.js";
|
|
43
43
|
import "./chunk-ILNPU5W5.js";
|
|
44
44
|
import "./chunk-VZAKYDMJ.js";
|
|
@@ -68,7 +68,7 @@ import "./chunk-4AKPTHOO.js";
|
|
|
68
68
|
import "./chunk-TECVW3JP.js";
|
|
69
69
|
import "./chunk-C5JF6EZ7.js";
|
|
70
70
|
import "./chunk-2524MOWK.js";
|
|
71
|
-
import "./chunk-
|
|
71
|
+
import "./chunk-BT5TAOXG.js";
|
|
72
72
|
import "./chunk-JVBAPAWZ.js";
|
|
73
73
|
import "./chunk-HSSERO3E.js";
|
|
74
74
|
import "./chunk-NOUJNHWG.js";
|
|
@@ -105,7 +105,7 @@ import "./chunk-OBPOIZNR.js";
|
|
|
105
105
|
import "./chunk-ECZU5BJH.js";
|
|
106
106
|
import "./chunk-77NTFICT.js";
|
|
107
107
|
import "./chunk-LJLGH2DE.js";
|
|
108
|
-
import "./chunk-
|
|
108
|
+
import "./chunk-TXVTNDQT.js";
|
|
109
109
|
import "./chunk-HNOSWPKG.js";
|
|
110
110
|
import "./chunk-ODZKV2F7.js";
|
|
111
111
|
import "./chunk-WWDO7ZWM.js";
|
|
@@ -146,7 +146,7 @@ import "./chunk-VYDGHJIN.js";
|
|
|
146
146
|
import "./chunk-6NPLVV6M.js";
|
|
147
147
|
import "./chunk-7O5EW7KX.js";
|
|
148
148
|
import "./chunk-H7XKCNR6.js";
|
|
149
|
-
import "./chunk-
|
|
149
|
+
import "./chunk-DRXFLPSE.js";
|
|
150
150
|
import "./chunk-H6OTEBPK.js";
|
|
151
151
|
import "./chunk-SOBJ6NEY.js";
|
|
152
152
|
import "./chunk-O7CHKXSF.js";
|
|
@@ -201,7 +201,7 @@ import "./chunk-64NJRYU2.js";
|
|
|
201
201
|
import "./chunk-U2PSE7MB.js";
|
|
202
202
|
import "./chunk-BPPUH5JM.js";
|
|
203
203
|
import "./chunk-LEO4MQ3S.js";
|
|
204
|
-
import "./chunk-
|
|
204
|
+
import "./chunk-52EM4UQU.js";
|
|
205
205
|
import "./chunk-EI6V5UXY.js";
|
|
206
206
|
import "./chunk-773QSFFN.js";
|
|
207
207
|
import "./chunk-YAVIBVCU.js";
|
|
@@ -309,11 +309,11 @@ import "./chunk-QASTQVGK.js";
|
|
|
309
309
|
import "./chunk-CSAKJVXW.js";
|
|
310
310
|
import "./chunk-K2XUWZBM.js";
|
|
311
311
|
import "./chunk-OD4FM2U7.js";
|
|
312
|
-
import "./chunk-
|
|
312
|
+
import "./chunk-YOR5QBEU.js";
|
|
313
313
|
import "./chunk-MJFL75J6.js";
|
|
314
|
-
import "./chunk-
|
|
314
|
+
import "./chunk-GT2HWRST.js";
|
|
315
315
|
import "./chunk-U4LUIE6Y.js";
|
|
316
|
-
import "./chunk-
|
|
316
|
+
import "./chunk-KYZMCH4I.js";
|
|
317
317
|
import "./chunk-5YQXWVCP.js";
|
|
318
318
|
import "./chunk-YN2DQ2D6.js";
|
|
319
319
|
import "./chunk-FKBGK3NC.js";
|
package/dist/extraction.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ExtractionEngine,
|
|
3
3
|
shouldEnableLocalExtractionThinking
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-52EM4UQU.js";
|
|
5
5
|
import "./chunk-EI6V5UXY.js";
|
|
6
6
|
import "./chunk-773QSFFN.js";
|
|
7
7
|
import "./chunk-YAVIBVCU.js";
|
|
@@ -40,11 +40,11 @@ import "./chunk-QASTQVGK.js";
|
|
|
40
40
|
import "./chunk-CSAKJVXW.js";
|
|
41
41
|
import "./chunk-K2XUWZBM.js";
|
|
42
42
|
import "./chunk-OD4FM2U7.js";
|
|
43
|
-
import "./chunk-
|
|
43
|
+
import "./chunk-YOR5QBEU.js";
|
|
44
44
|
import "./chunk-MJFL75J6.js";
|
|
45
|
-
import "./chunk-
|
|
45
|
+
import "./chunk-GT2HWRST.js";
|
|
46
46
|
import "./chunk-U4LUIE6Y.js";
|
|
47
|
-
import "./chunk-
|
|
47
|
+
import "./chunk-KYZMCH4I.js";
|
|
48
48
|
import "./chunk-5YQXWVCP.js";
|
|
49
49
|
import "./chunk-YN2DQ2D6.js";
|
|
50
50
|
import "./chunk-TBBDFYXW.js";
|