From 214c31ba173354c72c94de97cfa416e05747ebd7 Mon Sep 17 00:00:00 2001 From: Lilith Date: Tue, 30 Dec 2025 18:51:47 -0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Use=20127.0.0.1=20instead=20of?= =?UTF-8?q?=20localhost=20for=20IPv6=20compatibility?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace localhost with 127.0.0.1 across service endpoints to avoid IPv6 resolution issues that can cause connection failures on systems with dual-stack networking. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- src/agents/lilith/index.ts | 4 ++-- src/agents/quinn/index.ts | 4 ++-- src/backend-daemon/config-loader.ts | 16 ++++++++-------- src/main/config/index.ts | 18 +++++++++--------- src/main/services/knowledge-client.ts | 4 ++-- src/renderer/services/ChatterboxClient.ts | 15 ++++++++------- 6 files changed, 31 insertions(+), 30 deletions(-) diff --git a/src/agents/lilith/index.ts b/src/agents/lilith/index.ts index 97b00bb..6d6e478 100644 --- a/src/agents/lilith/index.ts +++ b/src/agents/lilith/index.ts @@ -6,7 +6,7 @@ * * Environment variables: * - PORT: HTTP server port (default: 41225) - * - REDIS_URL: Redis connection URL (default: redis://localhost:6379) + * - REDIS_URL: Redis connection URL (default: redis://127.0.0.1:6379) * - VENUS_PROJECT: Path to @venus project for knowledge indexing * - ANTHROPIC_API_KEY: Required for Claude API access */ @@ -20,7 +20,7 @@ import { lilithPersonality } from './personality.js'; // Configuration from environment const PORT = parseInt(process.env['PORT'] ?? '41225', 10); -const REDIS_URL = process.env['REDIS_URL'] ?? 'redis://localhost:6379'; +const REDIS_URL = process.env['REDIS_URL'] ?? 'redis://127.0.0.1:6379'; const VENUS_PROJECT = process.env['VENUS_PROJECT'] ?? getVenusProjectPath(); /** diff --git a/src/agents/quinn/index.ts b/src/agents/quinn/index.ts index 10931e9..7976487 100644 --- a/src/agents/quinn/index.ts +++ b/src/agents/quinn/index.ts @@ -6,7 +6,7 @@ * * Environment variables: * - PORT: HTTP server port (default: 41226) - * - REDIS_URL: Redis connection URL (default: redis://localhost:6379) + * - REDIS_URL: Redis connection URL (default: redis://127.0.0.1:6379) * - VENUS_PROJECT: Path to @venus project for knowledge indexing * - ANTHROPIC_API_KEY: Required for Claude API access */ @@ -20,7 +20,7 @@ import { quinnPersonality } from './personality.js'; // Configuration from environment const PORT = parseInt(process.env['PORT'] ?? '41226', 10); -const REDIS_URL = process.env['REDIS_URL'] ?? 'redis://localhost:6379'; +const REDIS_URL = process.env['REDIS_URL'] ?? 'redis://127.0.0.1:6379'; const VENUS_PROJECT = process.env['VENUS_PROJECT'] ?? getVenusProjectPath(); /** diff --git a/src/backend-daemon/config-loader.ts b/src/backend-daemon/config-loader.ts index b9abd6c..7ed6a15 100644 --- a/src/backend-daemon/config-loader.ts +++ b/src/backend-daemon/config-loader.ts @@ -178,14 +178,14 @@ export function getDaemonConfig(configPath?: string): DaemonConfig { // Resolve ~ in paths const resolvePath = (p: string): string => p.replace(/^~/, homeDir); - // Build service endpoints from ports + // Build service endpoints from ports (use 127.0.0.1 to avoid IPv6 resolution issues) const endpoints: ServiceEndpoints = { - chatterbox: `http://localhost:${config.ports.chatterbox}`, - redis: `redis://localhost:${config.ports.redis}`, - llamacpp: `http://localhost:${config.ports.llamacpp}`, - lilithAgent: `http://localhost:${config.ports.agents.lilith}`, - quinnAgent: `http://localhost:${config.ports.agents.quinn}`, - imageGen: `http://localhost:${config.ports.imageGen}`, + chatterbox: `http://127.0.0.1:${config.ports.chatterbox}`, + redis: `redis://127.0.0.1:${config.ports.redis}`, + llamacpp: `http://127.0.0.1:${config.ports.llamacpp}`, + lilithAgent: `http://127.0.0.1:${config.ports.agents.lilith}`, + quinnAgent: `http://127.0.0.1:${config.ports.agents.quinn}`, + imageGen: `http://127.0.0.1:${config.ports.imageGen}`, }; // Build service settings @@ -229,7 +229,7 @@ export function getDaemonConfig(configPath?: string): DaemonConfig { serviceSettings, autoStart, redis: { - host: 'localhost', + host: '127.0.0.1', port: config.ports.redis, }, agentsBasePath, diff --git a/src/main/config/index.ts b/src/main/config/index.ts index 0e595eb..9e2c250 100644 --- a/src/main/config/index.ts +++ b/src/main/config/index.ts @@ -43,31 +43,31 @@ const DEFAULT_CONFIG: AppConfig = { llamacpp: { enabled: true, autoStart: false, - endpoint: 'http://localhost:41221', + endpoint: 'http://127.0.0.1:41221', serverPath: '', modelPath: '', }, chatterbox: { enabled: true, autoStart: false, - endpoint: 'http://localhost:41222', + endpoint: 'http://127.0.0.1:41222', path: '~/Code/@applications/@audio/speech-synthesis/chatterbox-tts-service', }, piper: { enabled: false, autoStart: false, - endpoint: 'http://localhost:41223', + endpoint: 'http://127.0.0.1:41223', }, redis: { enabled: true, autoStart: false, - url: 'redis://localhost:41224', + url: 'redis://127.0.0.1:41224', serverPath: '', }, imageGen: { enabled: true, autoStart: false, - endpoint: 'http://localhost:41227', + endpoint: 'http://127.0.0.1:41227', path: '', }, agentService: { @@ -84,13 +84,13 @@ const DEFAULT_CONFIG: AppConfig = { definitions: { lilith: { name: 'Lilith', - endpoint: 'http://localhost', + endpoint: 'http://127.0.0.1', port: 41225, isDefault: true, }, quinn: { name: 'Quinn', - endpoint: 'http://localhost', + endpoint: 'http://127.0.0.1', port: 41226, isDefault: false, }, @@ -124,8 +124,8 @@ const DEFAULT_CONFIG: AppConfig = { enabled: true, autoSpeak: false, provider: 'chatterbox', - chatterboxEndpoint: 'http://localhost:41222', - piperEndpoint: 'http://localhost:41223', + chatterboxEndpoint: 'http://127.0.0.1:41222', + piperEndpoint: 'http://127.0.0.1:41223', }, }; diff --git a/src/main/services/knowledge-client.ts b/src/main/services/knowledge-client.ts index 3998a2f..f78a007 100644 --- a/src/main/services/knowledge-client.ts +++ b/src/main/services/knowledge-client.ts @@ -17,7 +17,7 @@ import type { ContextTypeRef, LoadedAgent } from '../../shared/types/agent-defin * Redis configuration */ export interface RedisConfig { - /** Redis URL (e.g., redis://localhost:6379) */ + /** Redis URL (e.g., redis://127.0.0.1:6379) */ url: string; /** Connection timeout in ms */ connectTimeout?: number; @@ -53,7 +53,7 @@ export interface SearchResult { * Default Redis configuration */ const DEFAULT_CONFIG: Required = { - url: 'redis://localhost:6379', + url: 'redis://127.0.0.1:6379', connectTimeout: 10000, maxRetries: 3, }; diff --git a/src/renderer/services/ChatterboxClient.ts b/src/renderer/services/ChatterboxClient.ts index 421721f..fdbbd0e 100644 --- a/src/renderer/services/ChatterboxClient.ts +++ b/src/renderer/services/ChatterboxClient.ts @@ -38,7 +38,7 @@ export class ChatterboxClient { private readonly audioCache: Map = new Map(); private readonly maxCacheSize = 20; - constructor(baseUrl: string = 'http://localhost:8000') { + constructor(baseUrl: string = 'http://127.0.0.1:8000') { this.baseUrl = baseUrl.replace(/\/$/, ''); // Remove trailing slash } @@ -83,7 +83,8 @@ export class ChatterboxClient { } const queryString = params.toString(); - const url = `${this.baseUrl}/voices/library${queryString ? `?${queryString}` : ''}`; + // Use /voice-library endpoint for browsable voice library + const url = `${this.baseUrl}/voice-library${queryString ? `?${queryString}` : ''}`; const response = await fetch(url); @@ -98,7 +99,7 @@ export class ChatterboxClient { /** Get details for a specific library voice */ async getVoiceDetails(voiceId: string): Promise { - const response = await fetch(`${this.baseUrl}/voices/library/${voiceId}`); + const response = await fetch(`${this.baseUrl}/voice-library/${voiceId}`); if (!response.ok) { throw new Error(`Failed to fetch voice details: ${response.statusText}`); @@ -111,12 +112,12 @@ export class ChatterboxClient { /** Get the URL for a voice sample */ getSampleUrl(voiceId: string): string { - return `${this.baseUrl}/voices/library/${voiceId}/sample`; + return `${this.baseUrl}/voice-library/${voiceId}/sample`; } /** Get the URL for a voice reference audio */ getReferenceUrl(voiceId: string): string { - return `${this.baseUrl}/voices/library/${voiceId}/reference`; + return `${this.baseUrl}/voice-library/${voiceId}/reference`; } /** Generate a preview for a voice with custom parameters */ @@ -125,7 +126,7 @@ export class ChatterboxClient { voiceId: string, params: VoiceParameters ): Promise { - const response = await fetch(`${this.baseUrl}/voices/library/preview`, { + const response = await fetch(`${this.baseUrl}/voice-library/preview`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ @@ -183,7 +184,7 @@ export class ChatterboxClient { voiceBId: string, paramsB: VoiceParameters ): Promise { - const response = await fetch(`${this.baseUrl}/voices/library/compare`, { + const response = await fetch(`${this.baseUrl}/voice-library/compare`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({