Skip to content

feat: fix cuga component with new release#10646

Merged
jordanrfrazier merged 56 commits into
langflow-ai:mainfrom
sami-marreed:feature/new-cuga-release
Nov 21, 2025
Merged

feat: fix cuga component with new release#10646
jordanrfrazier merged 56 commits into
langflow-ai:mainfrom
sami-marreed:feature/new-cuga-release

Conversation

@sami-marreed
Copy link
Copy Markdown
Contributor

@sami-marreed sami-marreed commented Nov 18, 2025

Summary by CodeRabbit

  • Chores

    • Updated cuga dependency to version 0.1.8
  • New Features

    • Added decomposition_strategy configuration option with flexible and exact modes
  • Refactor

    • Removed structured response output functionality
    • Removed format_instructions and output_schema configuration fields

@github-actions github-actions Bot added the community Pull Request from an external contributor label Nov 18, 2025
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Nov 18, 2025

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

The PR bumps the cuga dependency to 0.1.8, removes structured-output methods and outputs from CugaComponent, adds a new decomposition_strategy input field, and updates corresponding unit tests to reflect these changes.

Changes

Cohort / File(s) Change Summary
Dependency Update
pyproject.toml
Bumps cuga dependency from 0.1.7 to 0.1.8
CugaComponent Implementation
src/lfx/src/lfx/components/models_and_agents/cuga_agent.py
Adds decomposition_strategy DropdownInput field; removes structured_response output and methods _preprocess_schema, build_structured_output_base, json_response; propagates decomposition_strategy to Dynaconf settings; simplifies OpenAI inputs handling and policy processing; adds ID assignment logic in force_db_update_send_message
CugaComponent Tests
src/backend/tests/unit/components/models_and_agents/test_cuga_agent.py
Removes tests for dual outputs and structured output handling; adds decomposition_strategy to default_kwargs; introduces new test_decomposition_strategy_field test method; removes format_instructions and output_schema from default expectations
Agent Component Tests
src/backend/tests/unit/components/models_and_agents/test_agent_component.py
Removes large set of tests validating dual outputs, JSON mode filtering, input schema preprocessing, structured output building, and various initialization checks

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • cuga_agent.py requires careful verification of removed methods and their call sites, plus validation of the new decomposition_strategy propagation logic to Dynaconf settings
  • Test file changes involve significant test removal; verify that removed test scenarios are covered elsewhere or intentionally deprioritized
  • API surface changes (removal of structured_response output and related methods) need confirmation that downstream consumers are not affected

Possibly related PRs

  • langflow-ai/langflow#9907: Adds full CugaComponent with structured-output methods and dual outputs, while this PR removes those same methods and outputs—inverse relationship.
  • langflow-ai/langflow#10591: Also modifies CugaComponent implementation by adjusting inputs, attributes, and runtime behavior in similar areas.
  • langflow-ai/langflow#10559: Modifies CugaComponent by altering public inputs and runtime behavior in overlapping sections of the component.

Suggested labels

enhancement

Suggested reviewers

  • ogabrielluiz
  • jordanrfrazier

Pre-merge checks and finishing touches

Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (1 error, 2 warnings, 2 inconclusive)
Check name Status Explanation Resolution
Test Coverage For New Implementations ❌ Error Test coverage is insufficient; removed tests lack replacements and new cuga 0.1.8 functionality has no corresponding tests. Add regression tests for removed public APIs, tests for cuga 0.1.8 functionality, integration tests for decomposition_strategy, and verify no breaking changes.
Test Quality And Coverage ⚠️ Warning Test coverage significantly reduced without comprehensive new tests for decomposition_strategy field and removal of critical dual output and JSON validation tests. Add comprehensive tests for decomposition_strategy behavior, restore critical removed tests for API responses and error conditions, and ensure both positive and negative test scenarios.
Test File Naming And Structure ⚠️ Warning Test files follow correct naming patterns but large number of tests were removed, significantly reducing coverage of JSON handling, error conditions, schema validation, and edge cases without adequate replacement. Restore or replace removed tests to maintain comprehensive coverage of error handling, JSON parsing, schema validation, and negative scenarios for both test files.
Title check ❓ Inconclusive The title 'feat: fix cuga component with new release' is vague and generic. It uses non-descriptive terms like 'fix' without specifying what was fixed, and 'new release' without clarity on which release or what changed. Consider a more specific title that describes the actual changes, such as 'feat: update cuga agent component with decomposition_strategy field' or 'feat: migrate cuga component to 0.1.8 with new decomposition strategy.'
Excessive Mock Usage Warning ❓ Inconclusive The specific test files (test_agent_component.py and test_cuga_agent.py) could not be located in the repository to assess mock usage patterns. Provide access to the modified test files or verify their location in the repository to assess whether mock usage is appropriate in the remaining tests.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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.

@github-actions github-actions Bot added the enhancement New feature or request label Nov 18, 2025
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
src/lfx/src/lfx/components/models_and_agents/cuga_agent.py (1)

381-381: Remove redundant import.

The uuid4 is already imported at line 4. The local import at line 381 is unnecessary.

Apply this diff:

-                from uuid import uuid4
-
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8e83436 and 9a52902.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (4)
  • pyproject.toml (1 hunks)
  • src/backend/tests/unit/components/models_and_agents/test_agent_component.py (0 hunks)
  • src/backend/tests/unit/components/models_and_agents/test_cuga_agent.py (2 hunks)
  • src/lfx/src/lfx/components/models_and_agents/cuga_agent.py (7 hunks)
💤 Files with no reviewable changes (1)
  • src/backend/tests/unit/components/models_and_agents/test_agent_component.py
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-08-05T22:51:27.961Z
Learnt from: edwinjosechittilappilly
Repo: langflow-ai/langflow PR: 0
File: :0-0
Timestamp: 2025-08-05T22:51:27.961Z
Learning: The TestComposioComponentAuth test in src/backend/tests/unit/components/bundles/composio/test_base_composio.py demonstrates proper integration testing patterns for external API components, including real API calls with mocking for OAuth completion, comprehensive resource cleanup, and proper environment variable handling with pytest.skip() fallbacks.

Applied to files:

  • src/backend/tests/unit/components/models_and_agents/test_cuga_agent.py
🧬 Code graph analysis (2)
src/backend/tests/unit/components/models_and_agents/test_cuga_agent.py (1)
src/backend/tests/unit/components/models_and_agents/test_agent_component.py (4)
  • component_class (26-27)
  • component_class (178-179)
  • default_kwargs (40-55)
  • component_setup (33-37)
src/lfx/src/lfx/components/models_and_agents/cuga_agent.py (1)
src/lfx/src/lfx/inputs/inputs.py (4)
  • BoolInput (418-431)
  • DropdownInput (470-496)
  • IntInput (346-379)
  • MultilineInput (260-270)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (17)
  • GitHub Check: Lint Backend / Run Mypy (3.11)
  • GitHub Check: Lint Backend / Run Mypy (3.13)
  • GitHub Check: Lint Backend / Run Mypy (3.10)
  • GitHub Check: Lint Backend / Run Mypy (3.12)
  • GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 4
  • GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 5
  • GitHub Check: Run Frontend Tests / Determine Test Suites and Shard Distribution
  • GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 3
  • GitHub Check: Run Frontend Unit Tests / Frontend Jest Unit Tests
  • GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 2
  • GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 1
  • GitHub Check: Run Backend Tests / LFX Tests - Python 3.10
  • GitHub Check: Run Backend Tests / Integration Tests - Python 3.10
  • GitHub Check: Test Starter Templates
  • GitHub Check: Update Component Index
  • GitHub Check: Update Starter Projects
  • GitHub Check: Run Ruff Check and Format
🔇 Additional comments (5)
src/backend/tests/unit/components/models_and_agents/test_cuga_agent.py (1)

74-74: LGTM! Comprehensive test coverage for the new decomposition_strategy field.

The test changes properly validate:

  • Field presence in inputs and component attributes
  • Correct default value ("flexible")
  • Available options (["flexible", "exact"])
  • Advanced configuration flag
  • Field mutability between valid values

Also applies to: 231-231, 240-240, 245-245, 247-273

src/lfx/src/lfx/components/models_and_agents/cuga_agent.py (3)

131-139: LGTM! Well-configured decomposition_strategy input field.

The new DropdownInput is properly configured with:

  • Clear display name and informative description
  • Appropriate options (["flexible", "exact"])
  • Sensible default value ("flexible")
  • Correct advanced flag setting

203-203: LGTM! Decomposition strategy properly propagated to settings.

The decomposition_strategy value is correctly propagated to the Dynaconf settings object using the appropriate nested path.


390-402: LGTM! Proper handling of missing message IDs.

The logic correctly handles the case where messages sent without a ChatOutput connection lack an ID by generating and assigning one. The try-except pattern appropriately catches AttributeError when accessing the id property.

pyproject.toml (1)

137-137: No issues found. The cuga dependency bump is valid.

Version 0.1.8 exists on PyPI and has no known security vulnerabilities. The version bump from 0.1.7 to 0.1.8 is safe to merge.

@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Nov 18, 2025
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Nov 18, 2025
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Nov 18, 2025
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Nov 18, 2025
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Nov 18, 2025
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Nov 20, 2025
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Nov 20, 2025
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Nov 20, 2025
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Nov 20, 2025
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Nov 21, 2025
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Nov 21, 2025
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Nov 21, 2025
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Nov 21, 2025
@jordanrfrazier jordanrfrazier added this pull request to the merge queue Nov 21, 2025
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Nov 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community Pull Request from an external contributor enhancement New feature or request lgtm This PR has been approved by a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants