Compare commits

...

1 Commits

Author SHA1 Message Date
STEP35
012a1fe83e fix(harness): replace dead /api/world/ws with configurable WS bridge
Some checks failed
CI / test (pull_request) Failing after 1m15s
Review Approval Gate / verify-review (pull_request) Failing after 14s
CI / validate (pull_request) Failing after 1m20s
- Replace dead HTTP path with direct WebSocket connection to server.py
- Add ws_host and ws_port query-param config (defaults: localhost:8765)
- Remove duplicate initializeMemPalace() call in connectHermes()
- Follows L402_PORT pattern for environment configuration

Closes #694
2026-04-30 20:22:42 -04:00

12
app.js
View File

@@ -2277,9 +2277,6 @@ function sendChatMessage(overrideText = null) {
// ═══ HERMES WEBSOCKET ═══
function connectHermes() {
// Initialize MemPalace before Hermes connection
initializeMemPalace();
// Existing Hermes connection code...
// Initialize MemPalace before Hermes connection
initializeMemPalace();
if (hermesWs) return;
@@ -2287,8 +2284,6 @@ function connectHermes() {
// Initialize MemPalace storage
try {
console.log('Initializing MemPalace memory system...');
// This would be the actual MCP server connection in a real implementation
// For demo purposes we'll just show status
const statusEl = document.getElementById('mem-palace-status');
if (statusEl) {
statusEl.textContent = 'MEMPALACE INITIALIZING';
@@ -2303,8 +2298,11 @@ function connectHermes() {
}
}
const protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:';
const wsUrl = `${protocol}//${window.location.host}/api/world/ws`;
// WebSocket gateway configuration — connects to server.py (Nexus WS bridge)
const WS_HOST = new URLSearchParams(window.location.search).get('ws_host') || 'localhost';
const WS_PORT = parseInt(new URLSearchParams(window.location.search).get('ws_port') || '8765');
const isSecure = window.location.protocol === 'https:';
const wsUrl = `${isSecure ? 'wss:' : 'ws:'}//${WS_HOST}:${WS_PORT}`;
console.log(`Connecting to Hermes at ${wsUrl}...`);
hermesWs = new WebSocket(wsUrl);