* Improve session fixture cleanup and engine handling
Refactors the session fixture to use an in-memory SQLite engine with proper disposal and ensures tables are dropped and the engine is disposed of after tests. This enhances resource management and test isolation.
* Update src/backend/tests/conftest.py
* Increase pytest timeout to 150 seconds
Updated the pytest timeout setting from 120 to 150 seconds in pyproject.toml to allow tests more time to complete, potentially addressing issues with longer-running tests.
* Update store_pytest_durations.yml
---------
Co-authored-by: Ítalo Johnny <italojohnnydosanjos@gmail.com>
* Improve session fixture cleanup and engine handling
Refactors the session fixture to use an in-memory SQLite engine with proper disposal and ensures tables are dropped and the engine is disposed of after tests. This enhances resource management and test isolation.
* Update src/backend/tests/conftest.py
---------
Co-authored-by: Ítalo Johnny <italojohnnydosanjos@gmail.com>
* update MCP Tests
* [autofix.ci] apply automated fixes
* Update util.py
* [autofix.ci] apply automated fixes
* Refactor MCP session manager for better configurability and cleanup (#9176)
* Add log rotation and header validation features
Introduces support for log rotation via the LANGFLOW_LOG_ROTATION environment variable and CLI/config options, with documentation updates. Adds header validation and sanitization for MCP connections, ensuring RFC 7230 compliance and security. Frontend and backend now support passing custom headers for MCP servers. Includes extensive new and updated unit tests for header handling, MCP utilities, and log rotation.
* Add unit tests for MCP utilities and update disconnect logic
Added comprehensive unit tests for MCP utility functions, session management, header validation, and client classes in test_mcp_util.py. Updated MCPStdioClient and MCPSseClient disconnect methods for clearer session cleanup logic. Refactored test_mcp_component.py to remove redundant and duplicated tests, consolidating coverage in the new test suite.
* [autofix.ci] apply automated fixes
* Update test_mcp_memory_leak.py
* Update util.py
* Improve session and process cleanup in MCP
Added explicit session closing and a short delay to allow subprocess transports to clean up, reducing warnings and potential memory leaks. Test code now waits longer after cleanup and increases process termination timeout to ensure all child processes are properly terminated.
* Improve session and process cleanup logic
Enhanced MCPSessionManager to handle both async and sync session closing methods, using inspection to determine awaitability. Updated memory leak test to more robustly wait for and clean up child processes, logging process states and handling termination more gracefully.
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
* update MCP Tests
* [autofix.ci] apply automated fixes
* Update util.py
* [autofix.ci] apply automated fixes
* Refactor MCP session manager for better configurability and cleanup (#9176)
* Add log rotation and header validation features
Introduces support for log rotation via the LANGFLOW_LOG_ROTATION environment variable and CLI/config options, with documentation updates. Adds header validation and sanitization for MCP connections, ensuring RFC 7230 compliance and security. Frontend and backend now support passing custom headers for MCP servers. Includes extensive new and updated unit tests for header handling, MCP utilities, and log rotation.
* Add unit tests for MCP utilities and update disconnect logic
Added comprehensive unit tests for MCP utility functions, session management, header validation, and client classes in test_mcp_util.py. Updated MCPStdioClient and MCPSseClient disconnect methods for clearer session cleanup logic. Refactored test_mcp_component.py to remove redundant and duplicated tests, consolidating coverage in the new test suite.
* [autofix.ci] apply automated fixes
* Update test_mcp_memory_leak.py
* Update util.py
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
* feat: add import utilities for LangFlow components
- Introduced a new module `_importing.py` containing the `import_mod` function.
- This function dynamically imports attributes from specified modules, enhancing modularity and flexibility in component initialization.
- Comprehensive docstring added for clarity on usage and parameters.
* feat: implement dynamic imports for LangFlow components
- Added dynamic import functionality to various LangFlow components, allowing for lazy loading of attributes on access.
- Introduced mapping in each component's to manage imports efficiently.
- Enhanced error handling for import failures, providing clearer messages for missing attributes.
- Updated method to reflect available attributes for better introspection and tab-completion support.
- Comprehensive docstrings added to improve documentation and usability.
* test: add comprehensive tests for dynamic imports and component accessibility
- Introduced integration tests for dynamic import functionality, ensuring components are discoverable and instantiable post-refactor.
- Added unit tests for the `_import_utils` module, validating the `import_mod` function's behavior and error handling.
- Implemented tests to confirm all component modules are importable and maintain backward compatibility with existing import patterns.
- Enhanced performance tests to measure lazy loading efficiency and memory usage during component access.
- Ensured that all components have the required attributes for dynamic loading and that circular imports are prevented.
* chore: update ruff pre-commit hook to version 0.12.2 in configuration file
* refactor: update warning handling for dynamic imports
- Moved the warning suppression for LangChainDeprecationWarning into the dynamic import context to ensure it only applies during the import process.
- This change enhances clarity and maintains the original functionality while improving the robustness of the import mechanism.
* test: enhance dynamic import integration tests for component attributes
- Removed unnecessary import of AgentComponent and added assertions to verify essential attributes of OpenAIModelComponent, including display_name, description, icon, and inputs.
- Ensured that each input field has the required attributes for better validation of component integrity during dynamic imports.
* refactor: update import paths for Message class in conversation utilities
- Changed the import of the Message class from langflow.field_typing to langflow.schema.message across multiple utility files, ensuring consistency and alignment with the updated module structure.
- This refactor enhances code clarity and maintains compatibility with the latest schema definitions.
* refactor: remove Vectara components from LangFlow
- Deleted the Vectara components module from the codebase, streamlining the component structure.
- This change helps to reduce complexity and maintain focus on core functionalities.
* refactor: remove Vectara references from LangFlow component imports
- Eliminated Vectara from both the import statements and dynamic imports mapping, streamlining the component structure.
- This change contributes to reducing complexity and maintaining focus on core functionalities within the LangFlow framework.
* [autofix.ci] apply automated fixes
* fix: remove 'vectara' from __all__ in components module
* refactor: improve error handling tests for dynamic imports
* test: add tests for ModuleNotFoundError handling with None and special module names
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
* content
* dba-style
* kubernetes-best-practices
* edits
* spacing-cleanup
* see-also
* trailing-space
* Apply suggestions from code review
Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>
* title-case-and-via
* steps-for-intro
* ha-postgres
* dba-page
* code-review
* a-the
* Apply suggestions from code review
Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>
* move-file-location
* split-out-bp-page
* cleanup-links
* link
* editorial - k8s dev and prod deployments
* working on dba and best practices
* finish best practices
* fix link
* finish dba and best practices
* fix migration command
---------
Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>
Co-authored-by: April M <april.murphy@datastax.com>
* ✨ (authContext.tsx): Add setCookieWithOptions function to set cookies with specific options for better security and control
📝 (use-post-refresh-access.ts): Update cookies.set calls to use setCookieWithOptions function for consistent cookie settings
♻️ (utils.ts): Refactor setCookieWithOptions function to include httpOnly option and update sameSite values to lowercase for consistency
* 📝 (frontend): add useGetCookieAuth and useSetCookieAuth hooks for managing cookies in auth context
🔧 (frontend): refactor authStore to use new cookie hooks for managing access token and api key cookies
🔧 (frontend): refactor use-post-logout and use-post-refresh-access to use new cookie hooks for cookie management
* 📝 (frontend): Remove redundant useGetCookieAuth hook and use direct access to cookies in authStore and related components
🔧 (utils): Refactor getAuthCookie and setAuthCookie functions to use react-cookie directly for better code organization and readability
Increase max file upload size to 1024 MB
Updated the default value of max_file_size_upload from 100 MB to 1024 MB in the Settings class to allow larger file uploads.
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
* 🐛 (chroma.py, local_db.py): Handle ImportError when importing filter_complex_metadata function to avoid crashing the application
💡 (chroma.py, local_db.py): Add try-except block to gracefully handle ImportError and log a warning message if the function cannot be imported
* ♻️ (local_db.py): remove unnecessary try-except block and simplify document adding process in LocalDBComponent
* 🔧 (chroma.py): Remove unused import 'filter_complex_metadata' and add support for filtering complex metadata to prevent ChromaDB errors
🔧 (test_chroma_vector_store_component.py): Add test cases for filtering complex metadata, preserving simple metadata types, handling single file upload scenario, fallback behavior when import fails, and handling empty and None metadata values.
* [autofix.ci] apply automated fixes
* 🐛 (test_chroma_vector_store_component.py): fix failing test due to None value being filtered out by ChromaDB metadata handling
* 🔧 (test_chroma_vector_store_component.py): refactor test method names and data to improve clarity and consistency in metadata filtering and preservation logic
* 🐛 (test_chroma_vector_store_component.py): fix missing variable assignment for error message in mocked import error to improve error handling and debugging in tests
* [autofix.ci] apply automated fixes
* 🔧 (test_chroma_vector_store_component.py): delete the file test_chroma_vector_store_component.py as it is no longer needed in the project
* [autofix.ci] apply automated fixes
* ✨ (test_chroma_vector_store_component.py): add unit tests for ChromaVectorStoreComponent including create_db, create_collection_with_data, similarity_search, mmr_search, search_with_different_types, search_with_score, duplicate_handling, chroma_collection_to_data, metadata_filtering_with_complex_data, metadata_filtering_fallback
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
* ✨ (sql.py): add new output definitions for the SQLAgentComponent to include 'Agent' and 'Response' outputs for better functionality and flexibility
* 📝 (sql.py): update import statement for Output class to match new file structure
♻️ (sql.py): refactor Output class usage to remove unnecessary attributes and improve code readability
---------
Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
✨ (google_generative_ai_constants.py): add new Google Generative AI models (gemini-2.5 and gemini-2.0) to the list of supported models.
Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
* add-desktop-field-and-remove-notion-artifacts
* Apply suggestions from code review
Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>
* stash
* populate-empty-headings
* clarity
---------
Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>
Co-authored-by: April M <april.murphy@datastax.com>