Files
passepartout/verify_response.py
Amr Gharbeia c70f182888
Some checks failed
Deploy-Agent-V15-Stdin / JOB-V15-STDIN (push) Failing after 3s
FEAT: Stabilize Unified Envelope Architecture & TUI UX
- Fixed background boot crash via --non-interactive flag.
- Implemented robust protocol sanitization (stripped raw streams).
- Refined TUI formatting to display human-readable tool results.
- Fixed opencortex.sh variable shadowing and connection logic.
- Resolved :target field schema validation errors.
2026-04-20 18:19:54 -04:00

42 lines
1.3 KiB
Python

import socket, time, sys
def verify():
try:
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.settimeout(20)
s.connect(("localhost", 9105))
# We need to read handshake and status first to clear the pipe
full_data = b""
while len(full_data) < 50: # Expecting at least handshake + status
chunk = s.recv(4096)
if not chunk: break
full_data += chunk
print(f"Data received: {full_data.decode()}")
# Send "Hi"
# Make sure we use the right length.
# Send "Hi"
# (:TYPE :EVENT :META (:SOURCE :CLI) :PAYLOAD (:SENSOR :USER-INPUT :TEXT "Hi"))
payload = '(:TYPE :EVENT :META (:SOURCE :CLI) :PAYLOAD (:SENSOR :USER-INPUT :TEXT "Hi"))'
length = len(payload)
msg = f"{length:06x}{payload}".encode()
print(f"Sending: {msg.decode()}")
s.sendall(msg)
# Read response
while True:
chunk = s.recv(4096).decode()
if not chunk: break
print(f"Received chunk: {chunk}")
if ":REQUEST" in chunk or ":PAYLOAD" in chunk or "Neural Cascade Failure" in chunk:
print("SUCCESS: Response received!")
break
s.close()
except Exception as e:
print(f"Error: {e}")
sys.exit(1)
verify()