Compare commits

...

1 Commits

Author SHA1 Message Date
Alexander Whitestone
465599accb fix: port 8080 conflict between L402 server and preview (#1415)
Some checks failed
CI / test (pull_request) Failing after 43s
Review Approval Gate / verify-review (pull_request) Failing after 5s
CI / validate (pull_request) Failing after 33s
- L402 server: port configurable via L402_PORT env var (default 8080)
- app.js: L402 URL reads ?l402_port= from query string
- mempalace example: changed port from 8080 to 7772

Fixes #1415.
2026-04-13 21:44:03 -04:00
3 changed files with 10 additions and 3 deletions

6
app.js
View File

@@ -15,6 +15,10 @@ import { ReasoningTrace } from './nexus/components/reasoning-trace.js';
// NEXUS v1.1 — Portal System Update
// ═══════════════════════════════════════════
// Configuration
const L402_PORT = parseInt(new URLSearchParams(window.location.search).get('l402_port') || '8080');
const L402_URL = `http://localhost:${L402_PORT}/api/cost-estimate`;
const NEXUS = {
colors: {
primary: 0x4af0c0,
@@ -681,7 +685,7 @@ function updateGOFAI(delta, elapsed) {
// Simulate calibration update
calibrator.update({ input_tokens: 100, complexity_score: 0.5 }, 0.06);
if (Math.random() > 0.95) l402Client.fetchWithL402("http://localhost:8080/api/cost-estimate");
if (Math.random() > 0.95) l402Client.fetchWithL402(L402_URL);
}
metaLayer.track(startTime);

View File

@@ -3,6 +3,7 @@
from http.server import HTTPServer, BaseHTTPRequestHandler
import json
import secrets
import os
class L402Handler(BaseHTTPRequestHandler):
def do_GET(self):
@@ -25,7 +26,9 @@ class L402Handler(BaseHTTPRequestHandler):
self.send_response(404)
self.end_headers()
def run(server_class=HTTPServer, handler_class=L402Handler, port=8080):
def run(server_class=HTTPServer, handler_class=L402Handler, port=None):
if port is None:
port = int(os.environ.get('L402_PORT', 8080))
server_address = ('', port)
httpd = server_class(server_address, handler_class)
print(f"Starting L402 Skeleton Server on port {port}...")

View File

@@ -27,7 +27,7 @@ Usage:
python mempalace/fleet_api.py
# Custom host/port/palace:
FLEET_PALACE_PATH=/data/fleet python mempalace/fleet_api.py --host 0.0.0.0 --port 8080
FLEET_PALACE_PATH=/data/fleet python mempalace/fleet_api.py --host 0.0.0.0 --port 7772
Refs: #1078, #1075, #1085
"""