Skip to content

Release 0.11.0

Choose a tag to compare

@tercel tercel released this 06 Jan 13:53
· 176 commits to main since this release

Added

  • Standard Installation Profile - New [standard] extra providing recommended feature set
  • Combines A2A server, CLI tools, CrewAI, and LLM support in single installation command
  • Installation: pip install apflow[standard] or pip install -e ".[standard,dev]" for development
  • Simplifies setup for most common use cases without requiring manual feature selection
  • Test Infrastructure Improvements
  • Fixed event loop conflicts in pytest-asyncio test environment via ThreadPoolExecutor-based async isolation
  • New test fixtures: disable_api_for_tests for API gateway testing, run_async helper for sync test context
  • All 59 CLI tests now passing without hangs (fixed exit code 130 issues)
  • A2A tests excluded by default (added to pytest.ini ignore list since a2a is optional dependency)
  • Full test suite stable: 861 tests passing
  • Security Enhancement: Token Masking
  • Improved token masking in CLI config display from 8-character preview to 3-character preview
  • Prevents sensitive words from leaking in masked token display
  • Example: "very-secret-token-12345" now masked as "ver..." instead of "very-sec..."

Changed

  • Documentation Updates
  • Updated README.md to highlight [standard] as recommended installation option
  • Updated docs/development/setup.md to recommend [standard,dev] for development environment
  • Enhanced installation documentation to explain standard profile benefits
  • Improved test documentation with note about A2A tests being optional
  • Added detailed [standard] configuration documentation in setup.md
  • API Client Enhancement
  • APIClient.list_tasks() now supports offset parameter for pagination beyond initial limit

Fixed

  • Event Loop Conflict Resolution
  • Fixed hangs in async CLI tests by implementing ThreadPoolExecutor-based event loop isolation in conftest.py
  • Root cause: run_async_safe() was attempting nested event loop execution in pytest-asyncio context
  • Solution: Patched run_async_safe() to use separate thread with independent event loop
  • Resolves issue where @pytest.mark.asyncio + runner.invoke() caused tests to hang with exit code 130

TaskBuilder dependency coverage**

  • Added tests for TaskBuilder handling multiple dependencies and multi-level dependency chains to prevent regressions when wiring dependent tasks.
  • ConfigManager integration validation
  • New integration test verifies .env loading and dynamic hook registration work end-to-end via distribute_task_tree.
  • CLI → API Gateway Architecture (Priority 2)
  • New APIClient class (src/apflow/cli/api_client.py) for CLI to communicate with API server via HTTP
  • ConfigManager extended with API configuration: api_server_url, api_auth_token, use_local_db, api_timeout, api_retry_attempts, api_retry_backoff
  • APIClient supports exponential backoff retry (configurable attempts and initial backoff)
  • APIClient supports auth token injection via Bearer header
  • Comprehensive error handling for connection failures, timeouts, and API errors with custom exception types
  • Added httpx>=0.27.0 to CLI optional dependencies for HTTP communication
  • Integration tests for APIClient initialization, context manager, and ConfigManager API methods (8 tests)
  • Enables single source of truth (API) for task data when both CLI and API are running
  • Solves DuckDB concurrent write limitation (all writes go through API)
  • Foundation for future protocol adapters (GraphQL, MQTT, WebSocket)
  • CLI Command Layer Refactoring for API Gateway Integration
  • Created api_gateway_helper.py with helper functions for transparent API usage and fallback to local database
  • should_use_api(): Check if API is configured
  • get_api_client_if_configured(): Async context manager yielding APIClient when configured, None otherwise
  • api_with_fallback_decorator(): Try API first, fall back to local database if unavailable
  • log_api_usage(): Log whether command is using API or local database
  • Refactored CLI task commands to use API gateway when configured:
  • tasks list: Supports API via client.list_tasks() with status and user filters
  • tasks get: Supports API via client.get_task()
  • tasks status: Supports API via client.get_task_status()
  • tasks cancel: Supports API via client.cancel_task()
  • All commands automatically fall back to local database if API is not configured
  • Graceful error handling with warning logs when API unavailable but fallback enabled
  • Added property accessors to ConfigManager for convenience: api_server_url, api_auth_token, use_local_db, api_timeout, api_retry_attempts, api_retry_backoff
  • Integration tests for CLI API gateway with fallback scenarios (13 tests)
  • All existing CLI tests pass without modification (59 tests, backward compatible)
  • CLI Configuration Management System with Multi-Location & Separated Secrets
  • New apflow config command with 13 subcommands for comprehensive configuration management
  • Basic Config: set, get, unset, list, reset - Full CRUD operations with alias support
  • Token Management: gen-token, verify-token - Generate and verify JWT tokens with role-based claims
  • Quick Setup: init, init-server - Interactive wizard and one-command server setup
  • Utilities: path, show-path, edit, validate - Config file management and validation
  • Multi-location configuration support:
  • Priority 1 (highest): APFLOW_CONFIG_DIR environment variable
  • Priority 2: Project-local .data/ directory (if in project with pyproject.toml/.git)
  • Priority 3: User-global ~/.aipartnerup/apflow/ (default fallback)
  • Separated secrets architecture:
  • config.cli.yaml (600 permissions) - Unified configuration (all settings: api_server_url, timeouts, tokens, jwt_secret, etc.)
  • Single file with multi-location priority system (project-local and user-global)
  • API server can also read from same multi-location config structure
  • gen-token --save parameter to save tokens to config.cli.yaml
  • Token security: Automatic masking in all outputs, expiry validation, signature verification
  • Alias support for convenience: api-server/api-urlapi_server_url, api-token/tokenadmin_auth_token
  • apflow config validate checks YAML syntax, API server connectivity, and token validity
  • apflow config verify-token displays token details (subject, issuer, expiry, role) with status indicators
  • apflow config init provides interactive wizard for first-time setup
  • Added PyJWT>=2.8.0 to CLI dependencies for JWT token support
  • 19 new tests for config persistence and CLI commands (all passing)