Back to Signal Feed
CodeTracked since May 19, 2026

PraisonAI tool wrapper adds shared async bridge with cancellation-safe timeouts

This PR fixes a core async-safety problem in PraisonAI’s tool-calling wrapper by replacing per-runtime event-loop execution with a shared `_async_bridge` and adding explicit cancellation-aware timeout handling so run-time tool calls can finish/abort without leaking resources.

PraisonAIInteractiveRuntime_async_bridgerun_sync

What Happened

  • This PR fixes a core async-safety problem in PraisonAI’s tool-calling wrapper by replacing per-runtime event-loop execution with a shared `_async_bridge` and adding explicit cancellation-aware timeout handling so run-time tool calls can finish/abort without leaking resources.
  • This PR fixes a core async-safety problem in PraisonAI’s tool-calling wrapper by replacing per-runtime event-loop execution with a shared `_async_bridge` and adding explicit cancellation-aware timeout handling so run-time tool calls can finish/abort without leaking resources.
  • 1 evidence item attached for review.

What is Different

Before

Scattered source updates, isolated context, and manual follow-up across multiple feeds.

Now

Implemented a single async-safety track for the tool wrapper: all internal tools now execute through a shared async bridge, `run_sync` timeout paths now cancel pending work with cleanup, and a timeout wrapper now returns explicit timeout results at the boundary to avoid silent hangs and leaked processes.

Why Track This

Why It Matters

Users and operators invoking tools through PraisonAI should see fewer stalled jobs and background leftovers when calls timeout, because long-running or failing tool runs now terminate with explicit timeout outcomes and cleaned-up execution state. Technically, this is achieved by unifying async execution around `_async_bridge` plus cancellation/finally cleanup on `run_sync` timeout paths and a boundary-level `tool_timeout` guard; watch for edge cases where custom tools do not propagate cancellation correctly or where strict timeout settings may prematurely cut legitimate long tasks under heavy concurrency.

Impact

Users and operators invoking tools through PraisonAI should see fewer stalled jobs and background leftovers when calls timeout, because long-running or failing tool runs now terminate with explicit timeout outcomes and cleaned-up execution state. Technically, this is achieved by unifying async execution around `_async_bridge` plus cancellation/finally cleanup on `run_sync` timeout paths and a boundary-level `tool_timeout` guard; watch for edge cases where custom tools do not propagate cancellation correctly or where strict timeout settings may prematurely cut legitimate long tasks under heavy concurrency.

What To Watch Next

  • Watch whether PraisonAI becomes a repeated pattern.
  • Track follow-up changes around Tool Calling.
  • Compare future signals against this evidence trail.
  • Re-check risk flags: custom_tool_cancellation_incomplete, shared_bridge_synchronization_contention.
Open Topic TimelineOpen Technical EventOpen Original Sourcecustom_tool_cancellation_incomplete / shared_bridge_synchronization_contention / timeout_threshold_regressions_on_long_tasks / resource_cleanup_regression_in_custom_backends

Supporting Evidence