ktx/packages
Andrey Avtomonov 7e5551906e fix(cli): honor KTX_SQL_ANALYSIS_URL/KTX_DAEMON_URL in ktx sql and MCP
ktx ingest resolved the SQL-analysis port via resolveKtxCliSqlAnalysis,
which honors the external-daemon env overrides, but `ktx sql` and the MCP
server built their port by calling createManagedDaemonSqlAnalysisPort
directly. On a uv-less host with an external daemon and the override set,
ingest worked while `ktx sql` and MCP sql_execution ignored the override
and tried to install the managed Python runtime — contradicting the
documented contract and runtime-requirements, which already skip the
managed runtime when those vars are set.

Collapse the three call sites onto one env-override-aware resolver:
add externalDaemonSqlAnalysisBaseUrl + resolveSqlAnalysisPort in
managed-python-http.ts and route sql.ts, mcp-server-factory.ts, and
resolveKtxCliSqlAnalysis through it. createManagedDaemonSqlAnalysisPort
becomes @internal (test-only export).
2026-06-18 13:12:13 +02:00
..
cli fix(cli): honor KTX_SQL_ANALYSIS_URL/KTX_DAEMON_URL in ktx sql and MCP 2026-06-18 13:12:13 +02:00