Compare commits

...

3 Commits

Author SHA1 Message Date
Alexander Whitestone
571475a749 fix: closes #716
Some checks failed
CI / test (pull_request) Failing after 9s
CI / validate (pull_request) Failing after 18s
Review Approval Gate / verify-review (pull_request) Failing after 3s
2026-04-12 12:44:37 -04:00
aab3e607eb Merge pull request '[GOFAI] Resonance Viz Integration' (#1297) from feat/resonance-viz-integration-1776010801023 into main
Some checks failed
Deploy Nexus / deploy (push) Failing after 3s
Staging Verification Gate / verify-staging (push) Failing after 3s
2026-04-12 16:20:09 +00:00
fe56ece1ad Integrate ResonanceVisualizer into app.js
Some checks failed
CI / test (pull_request) Failing after 10s
CI / validate (pull_request) Failing after 16s
Review Approval Gate / verify-review (pull_request) Failing after 3s
2026-04-12 16:20:03 +00:00
2 changed files with 12 additions and 11 deletions

6
app.js
View File

@@ -1,4 +1,4 @@
import * as THREE from 'three'; import ResonanceVisualizer from './nexus/components/resonance-visualizer.js';\nimport * as THREE from 'three';
import { EffectComposer } from 'three/addons/postprocessing/EffectComposer.js'; import { EffectComposer } from 'three/addons/postprocessing/EffectComposer.js';
import { RenderPass } from 'three/addons/postprocessing/RenderPass.js'; import { RenderPass } from 'three/addons/postprocessing/RenderPass.js';
import { UnrealBloomPass } from 'three/addons/postprocessing/UnrealBloomPass.js'; import { UnrealBloomPass } from 'three/addons/postprocessing/UnrealBloomPass.js';
@@ -597,7 +597,7 @@ class PSELayer {
let pseLayer; let pseLayer;
let metaLayer, neuroBridge, cbr, symbolicPlanner, knowledgeGraph, blackboard, symbolicEngine, calibrator; let resonanceViz, metaLayer, neuroBridge, cbr, symbolicPlanner, knowledgeGraph, blackboard, symbolicEngine, calibrator;
let agentFSMs = {}; let agentFSMs = {};
function setupGOFAI() { function setupGOFAI() {
@@ -666,7 +666,7 @@ async function init() {
scene = new THREE.Scene(); scene = new THREE.Scene();
scene.fog = new THREE.FogExp2(0x050510, 0.012); scene.fog = new THREE.FogExp2(0x050510, 0.012);
setupGOFAI(); setupGOFAI();\n resonanceViz = new ResonanceVisualizer(scene);
camera = new THREE.PerspectiveCamera(65, window.innerWidth / window.innerHeight, 0.1, 1000); camera = new THREE.PerspectiveCamera(65, window.innerWidth / window.innerHeight, 0.1, 1000);
camera.position.copy(playerPos); camera.position.copy(playerPos);

View File

@@ -52,19 +52,20 @@ async def broadcast_handler(websocket: websockets.WebSocketServerProtocol):
continue continue
disconnected = set() disconnected = set()
# Create broadcast tasks for efficiency # Create broadcast tasks, tracking which client each task targets
tasks = [] task_client_pairs = []
for client in clients: for client in clients:
if client != websocket and client.open: if client != websocket and client.open:
tasks.append(asyncio.create_task(client.send(message))) task = asyncio.create_task(client.send(message))
task_client_pairs.append((task, client))
if tasks: if task_client_pairs:
tasks = [pair[0] for pair in task_client_pairs]
results = await asyncio.gather(*tasks, return_exceptions=True) results = await asyncio.gather(*tasks, return_exceptions=True)
for i, result in enumerate(results): for i, result in enumerate(results):
if isinstance(result, Exception): if isinstance(result, Exception):
# Find the client that failed target_client = task_client_pairs[i][1]
target_client = [c for c in clients if c != websocket][i] logger.error(f"Failed to send to client {target_client.remote_address}: {result}")
logger.error(f"Failed to send to a client {target_client.remote_address}: {result}")
disconnected.add(target_client) disconnected.add(target_client)
if disconnected: if disconnected: