v2.0.5: Fix E2E flow - proxy, welcome screen, provider sync
Critical fixes: - Translation proxy now uses system Node.js (not Electron binary) - Removed duplicate proxy start causing port conflicts - Added port availability check before spawning proxy - Fixed welcome:choice double resolve() - Fixed settings.html close using deprecated remote - Fixed translationProxy /v1 for openai-compat backends - Proxy no longer detached/unref - properly tracked as child - SingletonLock cleanup on startup Verified E2E: - Welcome screen on first run ✓ - Provider selection works ✓ - Settings save + sync ✓ - Translation proxy starts correctly ✓ - LS connects to proxy ✓ - --ag-reset works ✓
This commit is contained in:
7
dist/services/apiProxy.js
vendored
7
dist/services/apiProxy.js
vendored
@@ -70,8 +70,11 @@ class ApiProxy {
|
||||
console.log(`[ApiProxy] Starting built-in Node.js translation proxy on port ${this.port}`);
|
||||
// Use Electron's Node.js binary to run our translation proxy
|
||||
const proxyScript = path.join(__dirname, 'translationProxy.js');
|
||||
const nodeBin = process.execPath;
|
||||
this.proxyProcess = child_process.spawn(nodeBin, ['--no-sandbox', proxyScript], {
|
||||
// Use system node (not Electron's process.execPath which starts a GUI)
|
||||
const nodeBin = process.execPath.includes('electron') || process.execPath.includes('AG-X')
|
||||
? child_process.execSync('which node 2>/dev/null || echo /usr/bin/node').toString().trim()
|
||||
: process.execPath;
|
||||
this.proxyProcess = child_process.spawn(nodeBin, [proxyScript], {
|
||||
stdio: ['ignore', 'pipe', 'pipe'],
|
||||
detached: false,
|
||||
env: { ...process.env },
|
||||
|
||||
Reference in New Issue
Block a user