Skip to content

fix(cuga): fix cuga component configurations & update version#10303

Merged
ogabrielluiz merged 1 commit into
langflow-ai:mainfrom
sami-marreed:bugfix/fix-cuga-release
Oct 16, 2025
Merged

fix(cuga): fix cuga component configurations & update version#10303
ogabrielluiz merged 1 commit into
langflow-ai:mainfrom
sami-marreed:bugfix/fix-cuga-release

Conversation

@sami-marreed
Copy link
Copy Markdown
Contributor

@sami-marreed sami-marreed commented Oct 16, 2025

Summary by CodeRabbit

  • Dependencies

    • Updated cuga to stable release version.
  • Improvements

    • Enhanced configuration handling with improved fallback mechanisms for increased robustness.

@github-actions
Copy link
Copy Markdown
Contributor

⚠️ Component index needs to be updated

Please run the following command locally and commit the changes:

make build_component_index

Or alternatively:

LFX_DEV=1 uv run python scripts/build_component_index.py

Then commit and push the updated src/lfx/src/lfx/_assets/component_index.json file.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Oct 16, 2025

Walkthrough

Updated the cuga dependency version from 0.1.2.dev3 to 0.1.2 in pyproject.toml. Modified cuga_agent.py to apply dynamic in-process settings configuration for advanced features instead of relying solely on environment variables, with fallback error handling to preserve existing behavior.

Changes

Cohort / File(s) Summary
Dependency version update
pyproject.toml
Updated cuga package version from 0.1.2.dev3 to 0.1.2
Configuration mechanism enhancement
src/lfx/src/lfx/components/agents/cuga_agent.py
Replaced direct environment variable configuration with dynamic in-process settings update. Now imports cuga.config.settings and applies advanced feature settings (registry, mode, use_vision). Includes error handling with fallback to original environment-variable approach and warning logs on failure.

Sequence Diagram

sequenceDiagram
    participant A as cuga_agent.py
    participant B as cuga.config
    participant C as Environment Variables
    
    A->>B: Try import settings
    alt Import Successful
        B-->>A: settings object
        A->>B: Apply advanced_features config<br/>(registry=False, mode, use_vision)
        B-->>A: Settings updated
        A->>A: Log updated mode
    else Import/Attribute Error
        A->>A: Log warning
        A->>C: Fall back to env vars
        C-->>A: Environment config
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Pre-merge checks and finishing touches

❌ Failed checks (1 error, 1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Test Coverage For New Implementations ❌ Error The PR includes changes to cuga_agent.py and pyproject.toml, specifically updating the cuga dependency and modifying the component configuration mechanism. However, based on the available git information and file structure analysis, no test files appear to have been added, modified, or updated as part of this PR. The changes constitute a bug fix (as indicated by the "bugfix/fix-cuga-release" branch name) with behavioral modifications to how the cuga component is configured, yet no corresponding regression tests or unit tests for the updated functionality have been included in the PR. To pass this check, the PR should include test files that verify the bug fix works correctly. For a bug fix that changes how cuga component settings are configured, this should include regression tests verifying that the dynamic in-process settings update works as expected, as well as tests for the fallback behavior when ImportError or AttributeError occurs. Consider adding tests following the project's naming convention (e.g., test_cuga_agent.py) that cover both the new settings configuration path and the error handling fallback path.
Test Quality And Coverage ⚠️ Warning The existing test suite extensively covers CugaComponent’s build configuration, output behaviors, JSON parsing, schema handling, and integration with OpenAI, but it does not include any tests for the new dynamic cuga.config.settings logic or its fallback to environment variables. There are no tests that simulate successful import of cuga.config.settings to verify that advanced_features.registry, mode, and use_vision are set correctly based on browser_enabled, nor tests that simulate ImportError or AttributeError to validate the environment‐variable fallback. Consequently, the core new configuration behavior introduced in this PR lacks targeted coverage. Add unit tests that mock or monkeypatch the cuga.config.settings import path to simulate both the success and failure cases: verify that cuga_settings.set is called with the correct flags when browser_enabled is true or false, and confirm that on ImportError/AttributeError the appropriate DYNACONF environment variables are set. These tests should use pytest fixtures to isolate and assert both code paths in the updated try/except block.
Test File Naming And Structure ❓ Inconclusive The PR summary indicates changes to pyproject.toml (dependency update for cuga package) and modifications to src/lfx/src/lfx/components/agents/cuga_agent.py (configuration changes). However, based on the provided PR summary, there is no indication that any test files were added, modified, or removed as part of this pull request. The check instructions require verification that test files follow correct patterns and structure with descriptive names, proper setup/teardown, edge cases, and coverage for both positive and negative scenarios. Since the PR summary makes no mention of any test file changes and only describes a dependency version bump and code modifications to handle configuration dynamically, this custom check cannot be fully verified. To complete this check, verify whether any test files (following test_*.py, *.test.ts, or .test.tsx patterns) were added or modified in this PR. If tests were added, examine them for: proper pytest structure and naming conventions (test_ prefix), descriptive function names explaining what is tested, appropriate setup/teardown logic, coverage of edge cases and error conditions, and both positive and negative test scenarios. If no test files were added or modified, this would indicate a potential gap in test coverage for the cuga_agent configuration changes.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Excessive Mock Usage Warning ✅ Passed The unit tests for CugaComponent use a modest number of mocks (11 across 443 logic lines, about 2% density) exclusively to isolate external dependencies like the language model and network calls, while exercising the component’s real behavior and assertions. Mocks are limited to methods that would otherwise require API or I/O, and the core logic paths—including configuration updates, JSON parsing, and schema validation—are tested directly without excessive stubbing. The ratio of mock setup to assertions and overall test structure indicates appropriate use of mocks rather than over-mocking core functionality.
Title Check ✅ Passed The pull request title "fix(cuga): fix cuga component configurations & update version" is directly related to the changeset. It accurately reflects the two main changes: the refactoring of cuga settings configuration in cuga_agent.py (replacing environment variable configuration with dynamic in-process settings update) and the version bump in pyproject.toml (updating cuga from 0.1.2.dev3 to 0.1.2). The title is concise, specific, and uses standard commit conventions, making it clear to reviewers scanning the history what the primary intent of the PR is.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud
Copy link
Copy Markdown

@github-actions github-actions Bot added the bug Something isn't working label Oct 16, 2025
@ogabrielluiz ogabrielluiz changed the title fix(cuga): fix cuga component configurations & release fix(cuga): fix cuga component configurations & update version Oct 16, 2025
@ogabrielluiz ogabrielluiz added the lgtm This PR has been approved by a maintainer label Oct 16, 2025
@ogabrielluiz ogabrielluiz merged commit e8765f9 into langflow-ai:main Oct 16, 2025
36 of 40 checks passed
@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels Oct 16, 2025
mokeyish pushed a commit to mokeyish/langflow that referenced this pull request Oct 21, 2025
korenLazar pushed a commit to kiran-kate/langflow that referenced this pull request Nov 12, 2025
korenLazar pushed a commit to kiran-kate/langflow that referenced this pull request Nov 13, 2025
korenLazar pushed a commit to kiran-kate/langflow that referenced this pull request Nov 13, 2025
korenLazar pushed a commit to kiran-kate/langflow that referenced this pull request Nov 13, 2025
korenLazar pushed a commit to kiran-kate/langflow that referenced this pull request Nov 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working lgtm This PR has been approved by a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants