Skip to content

fix: MLflow 3.7+ compatibility - graceful handling of removed agent tracer#472

Open
vivekvar-dl wants to merge 1 commit intoSylphAI-Inc:mainfrom
vivekvar-dl:fix-mlflow-compatibility
Open

fix: MLflow 3.7+ compatibility - graceful handling of removed agent tracer#472
vivekvar-dl wants to merge 1 commit intoSylphAI-Inc:mainfrom
vivekvar-dl:fix-mlflow-compatibility

Conversation

@vivekvar-dl
Copy link
Copy Markdown

Fixes #459

Problem

The mlflow.openai._agent_tracer module was removed or relocated in MLflow 3.7.0, causing import failures when users try to run the quickstart example from the documentation.

Solution

This PR adds graceful handling for the missing module:

  • Added MLFLOW_AGENT_TRACER_AVAILABLE flag to check tracer availability separately from MLflow itself
  • Changed hard import failure to a soft warning with None fallback
  • Added clear error messages in enable_mlflow_local() and enable_mlflow_local_with_server() directing users to either:
    • Downgrade MLflow to < 3.7.0, or
    • Use an alternative tracing method

Changes

  • Modified adalflow/tracing/mlflow_integration.py to handle the missing import gracefully
  • Added validation checks before attempting to use MlflowOpenAgentTracingProcessor
  • Improved error messages for better user experience

Testing

The library now loads successfully with MLflow 3.7+, and provides actionable error messages when tracing features are attempted.

Related

This ensures the AdalFlow library can coexist with newer MLflow versions without breaking imports, while maintaining backwards compatibility for users with older MLflow installations.

…racer

Fixes SylphAI-Inc#459

The mlflow.openai._agent_tracer module was removed or relocated in MLflow 3.7.0,
causing import failures when users try to run the quickstart example.

Changes:
- Added graceful fallback when MlflowOpenAgentTracingProcessor is unavailable
- Added MLFLOW_AGENT_TRACER_AVAILABLE flag to check tracer availability
- Added clear error messages directing users to downgrade MLflow if needed
- Changed hard import failure to a soft warning with None fallback

This ensures the library loads successfully even with newer MLflow versions,
while providing actionable error messages when tracing features are used.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document example is not working

1 participant