Skip to content

Conversation

@IsaacGHX
Copy link
Collaborator

⚡️ Fix: Thread-Safe Python Execution

Description:
Replaced signal.alarm with threading to handle code execution timeouts.

Changes:

  • Executor: Wraps exec() in a daemon thread. Uses thread.join(timeout) to enforce limits.
  • Tool: Updates timeout context manager to use threading.Timer (cross-platform compatible).

Benefits:

  • Fixes signal only works in main thread error in multi-threaded training loops.
  • Prevents tool execution from blocking or crashing the main application loop.

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.

3 participants