Skip to main content

utils

Version: v1.2.8 | Status: Active | Last Updated: April 2026

Overview​

Cross-cutting helpers: JSON safety, hashing, paths, subprocess execution (process/), script base classes, metrics hooks, and two retry surfaces (see below). Depends on codomyrmex.logging_monitoring for structured logging.

Retry: package vs retry_sync​

SurfaceImportUse when
Package retryfrom codomyrmex.utils import retrySimple sync retries: max_attempts, delay, backoff, exceptions.
retry_sync modulefrom codomyrmex.utils.retry_sync import retry, async_retryJitter, capped delay, RetryConfig, and async retries via async_retry. Also re-exported on the package: RetryConfig, async_retry (see __all__).

The implementation file is named retry_sync.py so a retry submodule cannot shadow the package-level retry decorator.

Key references​

Directory contents​

  • __init__.py — public exports (__all__)
  • retry_sync.py — configurable sync/async retry
  • process/ — subprocess, script base, advanced streaming
  • mcp_tools.py, metrics.py, integration.py, refined.py, graph.py, hashing.py, cli_helpers.py
  • i18n/ — localized strings