Compare commits

..

1 Commits

Author SHA1 Message Date
Timmy
d69d289a9b fix(#1415): Resolve port 8080 conflict between L402 and preview server
Some checks failed
Review Approval Gate / verify-review (pull_request) Failing after 9s
CI / test (pull_request) Failing after 1m2s
CI / validate (pull_request) Failing after 1m3s
L402 server defaulted to port 8080, which conflicts with the Nexus
preview server (#1339). Both cannot run simultaneously on the same
machine without port collision.

Changes:
  - l402_server.py: default port 8080 -> 8081, configurable via
    L402_PORT environment variable
  - app.js: update L402 cost-estimate URL from :8080 to :8081

This frees port 8080 for the preview server and makes L402 port
configurable for future flexibility.

Fixes #1415
2026-04-14 14:06:58 -04:00
2 changed files with 7 additions and 4 deletions

6
app.js
View File

@@ -681,7 +681,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("http://localhost:8081/api/cost-estimate");
}
metaLayer.track(startTime);
@@ -1261,7 +1261,7 @@ async function updateSovereignHealth() {
{ name: 'LOCAL DAEMON', status: daemonReachable ? 'ONLINE' : 'OFFLINE' },
{ name: 'FORGE / GITEA', url: 'https://forge.alexanderwhitestone.com', status: 'ONLINE' },
{ name: 'NEXUS CORE', url: 'https://forge.alexanderwhitestone.com/Timmy_Foundation/the-nexus', status: 'ONLINE' },
{ name: 'HERMES WS', url: `${window.location.protocol === 'https:' ? 'wss:' : 'ws:'}//${window.location.host}/api/world/ws`, status: wsConnected ? 'ONLINE' : 'OFFLINE' },
{ name: 'HERMES WS', url: 'ws://143.198.27.163:8765', status: wsConnected ? 'ONLINE' : 'OFFLINE' },
{ name: 'SOVEREIGNTY', url: 'http://localhost:8082/metrics', status: metrics.sovereignty_score + '%' }
];
@@ -2190,7 +2190,7 @@ function connectHermes() {
}
const protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:';
const wsUrl = `${window.location.protocol === \"https:\" ? \"wss:\" : \"ws:\"}//${window.location.host}/api/world/ws`;
const wsUrl = `${protocol}//${window.location.host}/api/world/ws`;
console.log(`Connecting to Hermes at ${wsUrl}...`);
hermesWs = new WebSocket(wsUrl);

View File

@@ -2,6 +2,7 @@
#!/usr/bin/env python3
from http.server import HTTPServer, BaseHTTPRequestHandler
import json
import os
import secrets
class L402Handler(BaseHTTPRequestHandler):
@@ -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', 8081))
server_address = ('', port)
httpd = server_class(server_address, handler_class)
print(f"Starting L402 Skeleton Server on port {port}...")