plexus.cli.procedure.logging_utils module

Logging utilities for procedure execution.

This module provides consistent logging patterns for the multi-agent system, including truncation utilities and chat history logging.

plexus.cli.procedure.logging_utils.log_agent_response(agent_name: str, response_content: str, context: str = '') None

Log agent response with truncation.

Args:

agent_name: Name of the responding agent response_content: The agent’s response content context: Additional context about the response

plexus.cli.procedure.logging_utils.log_chat_history_for_agent(agent_name: str, chat_history: List[Any], context: str = '') None

Log the chat history that is being sent to a specific agent.

This provides visibility into what each agent (manager/worker) actually sees in their conversation context.

Args:

agent_name: Name of the agent receiving this chat history chat_history: List of messages being sent to the agent context: Additional context about why this history is being sent

plexus.cli.procedure.logging_utils.log_filtered_vs_full_history(agent_name: str, full_history: List[Any], filtered_history: List[Any], filter_description: str = '') None

Log comparison between full and filtered chat history.

Args:

agent_name: Name of the agent full_history: Complete conversation history filtered_history: Filtered conversation history filter_description: Description of how filtering was applied

plexus.cli.procedure.logging_utils.log_tool_execution(tool_name: str, tool_args: Dict[str, Any], tool_result: Any, execution_time: float = None) None

Log tool execution with truncated results.

Args:

tool_name: Name of the tool being executed tool_args: Arguments passed to the tool tool_result: Result returned by the tool execution_time: Optional execution time in seconds

plexus.cli.procedure.logging_utils.reduce_debug_noise()

Configure logging to reduce debug noise while maintaining critical information. This should be called during initialization to clean up verbose logging.

plexus.cli.procedure.logging_utils.truncate_log_message(content: str, max_lines: int = 4) str

Truncate log message content after specified number of lines.

Args:

content: The content to potentially truncate max_lines: Maximum number of lines to show (default: 4)

Returns:

Truncated content with truncation indication if needed