Skip to content

Conversation

tfheud
Copy link

@tfheud tfheud commented Sep 13, 2025

Introduced a class-level logger (self.logger) to replace the use of the global get_logger() within methods. This enhances modularity and simplifies debugging in the swarm system.
..
Implemented safe key access (get with default "") to avoid KeyError when "question" is absent in environment_states. Enhances robustness in RL cycles, particularly during incomplete states such as action tree "transplants".
..
Significantly improved robustness: added None checks for critical parts of the payload (world_state, actions, metadata) with self.logger.warning and continue to safely skip invalid entries. Prevents crashes caused by incomplete payloads from other agents. Also includes safe access to "question". In the context of the Gensyn node, this avoids errors during swarm-based action tree exchanges ("transplants") where payloads may be malformed or incomplete.
..
Simplified validation logic: removed hasattr and isinstance checks, replacing them with .get() and direct access to payload["actions"]. Also removed explicit self.num_generations check (now implicitly handled via len(...)). The logic is less strict but still ensures presence and non-emptiness of actions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant