lynkr 9.1.4 → 9.1.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lynkr",
3
- "version": "9.1.4",
3
+ "version": "9.1.5",
4
4
  "description": "Self-hosted Claude Code & Cursor proxy with Databricks,AWS BedRock,Azure adapters, openrouter, Ollama,llamacpp,LM Studio, workspace tooling, and MCP integration.",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -394,6 +394,18 @@ const finalModelProvider = (process.env.MODEL_PROVIDER ?? "databricks").toLowerC
394
394
  const finalFallbackProvider = (process.env.FALLBACK_PROVIDER ?? "databricks").toLowerCase();
395
395
  const finalFallbackEnabled = process.env.FALLBACK_ENABLED === "true";
396
396
 
397
+ // Safety check: prevent self-loop when tier routing is active and provider is not databricks
398
+ // If using tier routing with ollama/llamacpp/lmstudio, clear databricks URL to prevent agents from calling back to self
399
+ if (tierRoutingMode && finalModelProvider !== "databricks" && rawBaseUrl) {
400
+ const isLocalhost = rawBaseUrl.includes('localhost') || rawBaseUrl.includes('127.0.0.1');
401
+ const matchesServerPort = rawBaseUrl.includes(`:${port}`);
402
+ if (isLocalhost && matchesServerPort) {
403
+ console.warn(`[WARN] DATABRICKS_API_BASE points to this server (${rawBaseUrl}). Clearing to prevent self-loop.`);
404
+ rawBaseUrl = null;
405
+ apiKey = null;
406
+ }
407
+ }
408
+
397
409
  // Warn about misconfigured fallback provider (only when tier routing is active,
398
410
  // since that's the only path that triggers provider fallback)
399
411
  if (finalFallbackEnabled && tiersConfigured) {