Skip to content

[BUG]502 Gateway Logic Errors and Action Loop Inconsistency #1218

Description

@0xceku

Describe the bug
The OM1 runtime enters an unstable "Infinite Retry Loop" when the upstream server (api.openmind.org) returns a 502 Bad Gateway error. There are two primary logical failures:

HTML Leakage: The system prints raw HTML code from the server to the terminal instead of a structured error message.

Action-State Paradox: The AvatarProvider continues to fire commands (e.g., happy) even when the network layer is offline and the WebSocket is closed.

To Reproduce Steps to replicate the bug:

  1. Start the node on a Mac M1/M2 environment using: PYTHONPATH=src uv run python src/runtime/single_mode/cortex.py --config config/spot.json5.
  2. Wait for a server-side outage or high latency period at api.openmind.org.
  3. Observe the terminal logging raw <html> tags and the 502 Bad Gateway status.
  4. Notice the system attempting to reconnect every 5 seconds without an exponential backoff.

Expected behavior

The system should parse the 502 error and display a user-friendly message like [System] Server Offline. Retrying... instead of raw HTML.

The AvatarProvider should pause all actions if the WebSocket connection is lost (Circuit Breaker pattern).

The retry logic should implement an exponential backoff (e.g., 5s, 15s, 60s) to prevent a "retry storm".

**

Image

**
System Information:

Operating System: macOS (Apple Silicon M1/M2)

Python Version: 3.10+ (via uv runtime)

Additional context As a Graduate Student in Aerospace Engineering, I have analyzed these logs to identify redundancy and communication failures. In aviation, "communication discipline" is vital; similarly, this node should not "shout" into an offline gateway. The paradox of the robot feeling "happy" while the system is failing highlights a lack of synchronization between the Network Status and the Action Execution Loop.

Contact:
Discord: ceku00
X (Twitter): 0xceku
Email: cemkudu34@gmail.com

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions