[perplexity] WebSocket bridge to Timmy + trim fat (2211→1181 lines) #514

Merged
Rockachopa merged 1 commits from perplexity/ws-agent-bridge into main 2026-03-25 16:49:43 +00:00
Member

What

Wire the Nexus 3D client to Timmy's real backend via WebSocket. Replace all fake/simulated agent behaviors with live cognitive state.

Changes

WebSocket Bridge (~80 lines added)

  • Connects to Timmy's backend at configurable ?ws= URL (default ws://localhost:8765)
  • Auto-reconnect with 5s retry
  • Protocol: agent_state, agent_move, chat_response, system_metrics, dual_brain, heartbeat
  • Graceful degradation: agents idle locally when offline, chat shows OFFLINE message

Fake Behaviors Removed

  • simulateAgentThought() deleted (was 38 lines of hardcoded strings)
  • sendChatMessage() no longer fakes responses; routes through WS
  • Dual-brain panel now updates from WS data instead of static AWAITING DEPLOYMENT

Fat Trimmed (1030 lines cut, 47% reduction)

  • Glass floor: removed 6-band edge rebuild system (142→55 lines)
  • Dual-brain: removed per-frame scan canvas overlay (177→60 lines)
  • All functions compacted without losing functionality
  • Every Three.js feature preserved: portals, vision points, particles, agents, navigation

Line Count

  • Before: 2211 lines
  • After: 1181 lines
  • Under the 1500-line budget

Refs #8

## What Wire the Nexus 3D client to Timmy's real backend via WebSocket. Replace all fake/simulated agent behaviors with live cognitive state. ## Changes ### WebSocket Bridge (~80 lines added) - Connects to Timmy's backend at configurable `?ws=` URL (default `ws://localhost:8765`) - Auto-reconnect with 5s retry - Protocol: `agent_state`, `agent_move`, `chat_response`, `system_metrics`, `dual_brain`, `heartbeat` - Graceful degradation: agents idle locally when offline, chat shows OFFLINE message ### Fake Behaviors Removed - `simulateAgentThought()` deleted (was 38 lines of hardcoded strings) - `sendChatMessage()` no longer fakes responses; routes through WS - Dual-brain panel now updates from WS data instead of static AWAITING DEPLOYMENT ### Fat Trimmed (1030 lines cut, 47% reduction) - Glass floor: removed 6-band edge rebuild system (142→55 lines) - Dual-brain: removed per-frame scan canvas overlay (177→60 lines) - All functions compacted without losing functionality - Every Three.js feature preserved: portals, vision points, particles, agents, navigation ### Line Count - Before: 2211 lines - After: 1181 lines - Under the 1500-line budget Refs #8
perplexity added 1 commit 2026-03-25 16:30:51 +00:00
feat: WebSocket bridge to Timmy + trim fat (2211→1181 lines)
Some checks failed
CI / validate (pull_request) Failing after 5s
95793222ce
Adds real-time WebSocket connection to Timmy's backend:
- Agent behaviors driven by live cognitive state
- Chat routed to real Timmy (not fake responses)
- Dual-brain panel updates from WS
- Graceful degradation when offline

Trimmed 1030 lines (47% reduction):
- Simplified glass floor (removed 6-band edge system)
- Compacted dual-brain panel (removed per-frame scan canvas)
- Removed simulateAgentThought() (WS replaces it)
- Removed fake chat responses
- Compacted all functions

Refs #8
Rockachopa merged commit fc050f2f87 into main 2026-03-25 16:49:43 +00:00
Sign in to join this conversation.