Skip to content

fix: expose agent module via cascadeflow.agent attribute#176

Open
AasheeshLikePanner wants to merge 1 commit intolemony-ai:mainfrom
AasheeshLikePanner:fix/cascadeflow-agent-module-export
Open

fix: expose agent module via cascadeflow.agent attribute#176
AasheeshLikePanner wants to merge 1 commit intolemony-ai:mainfrom
AasheeshLikePanner:fix/cascadeflow-agent-module-export

Conversation

@AasheeshLikePanner
Copy link

@AasheeshLikePanner AasheeshLikePanner commented Mar 24, 2026

🎯 Description

This fix exposes the agent module via cascadeflow.agent attribute, which was previously missing from the lazy imports. The test test_top_level_exports_exist was failing because hasattr(cascadeflow.agent, 'PROVIDER_REGISTRY') raised an AttributeError.

🔗 Related Issues

  • Related to test_harness_api.py::test_top_level_exports_exist

🔄 Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✅ Test additions/improvements

🧪 Testing

Test cases added

  • Unit tests

How to test

import cascadeflow
# Before: AttributeError: module 'cascadeflow' has no attribute 'agent'
# After: Works correctly
assert hasattr(cascadeflow.agent, 'PROVIDER_REGISTRY')

📋 Checklist

Code Quality

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • My changes generate no new warnings
  • I have run black to format my code
  • I have run ruff and fixed all linting issues

Testing

  • New and existing unit tests pass locally with my changes
  • Tests in test_harness_api.py pass

Breaking Changes

  • This PR includes NO breaking changes

🙏 Reviewers


By submitting this PR, I confirm that:

  • I have read and followed the CONTRIBUTING.md guidelines
  • My contribution is my own original work or properly attributed
  • I agree to license my contribution under the project's MIT license
  • I have tested my changes thoroughly

- Add 'agent' to _LAZY_IMPORTS dict to expose the agent module
- Handle attr_name=None case in __getattr__ to return module itself
- This fixes AttributeError when accessing cascadeflow.agent
- Enables hasattr(cascadeflow.agent, 'PROVIDER_REGISTRY') to work

Fixes test_harness_api.py::test_top_level_exports_exist
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.

1 participant