Skip to main content

Overview

The Agent-Centric Tools module provides tools that route file operations and code intelligence through LSP (Language Server Protocol) and ACP (Agent Communication Protocol), making the Agent the central orchestrator for all actions. This ensures:
  • Plan → Approve → Apply → Verify flow for file modifications
  • LSP-powered code intelligence with fallback to regex
  • Full action tracking via ACP sessions
  • Multi-agent safe operations with proper attribution

Installation

The agent-centric tools are included in the praisonai package:

Quick Start

Both from praisonai.cli.features import create_agent_centric_tools and from praisonai.cli.features.agent_tools import create_agent_centric_tools now resolve to the same implementation (canonical: praisonai_code.cli.features.agent_tools). Older PraisonAI releases briefly had these resolve to two separate copies — upgrade to the latest praisonai release for a single source of truth. See PR #3361.

Available Tools

ACP-Powered File Tools

LSP-Powered Code Intelligence

Read-Only Tools

Timeouts & Cancellation

Every agent-centric tool call is bounded by PRAISONAI_RUN_SYNC_TIMEOUT (default 300 seconds) so a hung ACP/LSP tool can never block the agent indefinitely. Override the default five-minute cap by setting the env var before creating the tools:
Configuration: Behaviour on timeout:
  • The coroutine is cancelled (future.cancel()) and concurrent.futures.TimeoutError propagates to the agent.
  • The worker pool is shut down with wait=False, so the tool call returns immediately — it does not block until the hung coroutine finishes.
  • Because Python threads cannot be force-killed, a hung sync tool may keep running in the background daemon thread; it is reclaimed on interpreter exit. Do not rely on the timeout as a hard security cutoff.
This env var is shared with the wrapper-level praisonai._async_bridge.run_sync. Setting it applies to both the wrapper bridge (used by gateway, a2u, mcp_server, scheduler) and the praisonai-code agent-tool bridge (used by the ACP/LSP tools created above). See Async Bridge for the wrapper-level surface.

Tool Details

acp_create_file

Creates a file through the ACP orchestration pipeline:
Example Response:

lsp_list_symbols

Lists all symbols in a file using LSP (with regex fallback):
Example Response:

Approval Modes

The approval_mode parameter controls how file modifications are approved:

Architecture

Operational Notes

Performance

  • All imports are lazy-loaded
  • LSP client starts only when lsp_enabled=True
  • ACP session is lightweight (in-process)

Dependencies

  • praisonaiagents - Core agent functionality
  • pylsp (optional) - For LSP code intelligence

Production Caveats

  • LSP requires language server to be installed (e.g., pylsp for Python)
  • If LSP unavailable, falls back to regex-based symbol extraction
  • ACP tracking is in-memory; use external storage for persistence