-
Notifications
You must be signed in to change notification settings - Fork 8.2k
feat: Add ALTK Agent with tool validation and comprehensive tests #10587
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add ALTK Agent with tool validation and comprehensive tests #10587
Conversation
- Added agent-lifecycle-toolkit~=0.4.1 dependency to pyproject.toml - Implemented ALTKBaseAgent with comprehensive error handling and tool validation - Added ALTKToolWrappers for SPARC integration and tool execution safety - Created ALTK Agent component with proper LangChain integration - Added comprehensive test suite covering tool validation, conversation context, and edge cases - Fixed docstring formatting to comply with ruff linting standards
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughAdds a modular ALTK agent framework: base agent, tool wrapper pipeline (pre/post validation), SPARC-based tool spec conversion, conversation normalization, and comprehensive unit tests; also tightens the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant ALTK as ALTKAgentComponent
participant TPM as ToolPipelineManager
participant PreW as PreToolValidationWrapper
participant Valid as ValidatedTool
participant PostW as PostToolProcessingWrapper
participant SPARC
participant LLM
User->>ALTK: run_agent(input)
rect rgba(220,235,255,0.35)
ALTK->>ALTK: configure_tool_pipeline()
ALTK->>TPM: add_wrapper(PreW), add_wrapper(PostW)
end
rect rgba(220,255,230,0.35)
ALTK->>ALTK: build_conversation_context()
ALTK->>ALTK: get_user_query()
ALTK->>LLM: send conversation + tool specs
end
LLM-->>ALTK: chooses tool_call
ALTK->>TPM: process_tools(tools)
TPM->>PreW: wrap_tool(original)
PreW->>Valid: produce ValidatedTool
TPM->>PostW: wrap_tool(ValidatedTool)
rect rgba(255,235,220,0.35)
Valid->>SPARC: validate tool call (conversation + spec)
alt SPARC approves
SPARC-->>Valid: ok
Valid->>Valid: execute wrapped tool
else SPARC rejects
SPARC-->>Valid: rejection
Valid-->>ALTK: formatted rejection
end
end
Valid-->>PostW: raw result
PostW->>PostW: optional post-processing / codegen
PostW-->>ALTK: processed result
ALTK-->>User: final message
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Areas to focus on:
Possibly related PRs
Suggested labels
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (2 warnings, 1 inconclusive)
✅ Passed checks (4 passed)
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. Comment |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
uv.lockis excluded by!**/*.lock
📒 Files selected for processing (7)
pyproject.toml(1 hunks)src/backend/tests/unit/components/models_and_agents/test_altk_agent_logic.py(1 hunks)src/backend/tests/unit/components/models_and_agents/test_altk_agent_tool_conversion.py(1 hunks)src/backend/tests/unit/components/models_and_agents/test_conversation_context_ordering.py(1 hunks)src/lfx/src/lfx/base/agents/altk_base_agent.py(1 hunks)src/lfx/src/lfx/base/agents/altk_tool_wrappers.py(1 hunks)src/lfx/src/lfx/components/models_and_agents/altk_agent.py(3 hunks)
⏰ 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). (22)
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 9/13
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 4/13
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 13/13
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 7/13
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 2/13
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 5/13
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 10/13
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 1/13
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 3/13
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 6/13
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 12/13
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 11/13
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 8/13
- GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 2
- 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 Backend Tests / Unit Tests - Python 3.10 - Group 1
- GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 3
- GitHub Check: Run Backend Tests / Integration Tests - Python 3.10
- GitHub Check: Run Backend Tests / LFX Tests - Python 3.10
- GitHub Check: Test Starter Templates
- GitHub Check: Update Starter Projects
src/backend/tests/unit/components/models_and_agents/test_altk_agent_tool_conversion.py
Show resolved
Hide resolved
✅ Actions performedReview triggered.
|
There was a problem hiding this 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 (4)
src/lfx/src/lfx/base/agents/altk_base_agent.py (2)
119-130: Consider mixed args/kwargs handling.If both
argsandkwargsare provided, the current implementation only usesargs(line 122), ignoringkwargsentirely. This could be unexpected behavior for callers.Consider clarifying the precedence or merging both:
def _execute_tool(self, *args, **kwargs) -> str: """Execute the wrapped tool with compatibility across LC versions.""" # BaseTool.run() expects tool_input as first argument if args: # Use first arg as tool_input, pass remaining args tool_input = args[0] - return self.wrapped_tool.run(tool_input, *args[1:]) + # If kwargs provided, merge them into tool_input if it's a dict + if kwargs and isinstance(tool_input, dict): + tool_input = {**tool_input, **kwargs} + return self.wrapped_tool.run(tool_input, *args[1:]) if kwargs: # Use kwargs dict as tool_input return self.wrapped_tool.run(kwargs) # No arguments - pass empty dict as tool_input return self.wrapped_tool.run({})
308-319: Simplify and strengthen chat_history type detection.The current logic has overlapping and fragile type checks. Lines 316-317 check for
"text" in m.datawhich could raiseTypeErrorifm.datais not a dict. Line 318 checksisinstance(m, Message)right after, which overlaps with the previous check.Consider consolidating the checks:
if hasattr(self, "chat_history") and self.chat_history: if ( hasattr(self.chat_history, "to_data") and callable(self.chat_history.to_data) and self.chat_history.__class__.__name__ == "Data" ): input_dict["chat_history"] = data_to_messages(self.chat_history) - # Handle both lfx.schema.message.Message and langflow.schema.message.Message types - if all(hasattr(m, "to_data") and callable(m.to_data) and "text" in m.data for m in self.chat_history): - input_dict["chat_history"] = data_to_messages(self.chat_history) - if all(isinstance(m, Message) for m in self.chat_history): + # Handle both lfx.schema.message.Message and langflow.schema.message.Message types + elif isinstance(self.chat_history, list) and all(isinstance(m, Message) for m in self.chat_history): input_dict["chat_history"] = data_to_messages([m.to_data() for m in self.chat_history])This removes the risky
"text" in m.datacheck and useselifto avoid redundant checks.src/lfx/src/lfx/base/agents/altk_tool_wrappers.py (2)
135-142: Consider caching SPARC component creation.A new
SPARCReflectionComponentis created on every_runcall (lines 137-140). If the tool is invoked multiple times with the same LLM configuration, this could be inefficient.Consider initializing it once if the LLM client remains constant:
def _run(self, *args, **kwargs) -> str: """Execute the tool with validation.""" - self.sparc_component = SPARCReflectionComponent( - config=ComponentConfig(llm_client=self._get_altk_llm_object()), - track=Track.FAST_TRACK, # Use fast track for performance - execution_mode=SPARCExecutionMode.SYNC, # Use SYNC to avoid event loop conflicts - ) + if not self.sparc_component: + self.sparc_component = SPARCReflectionComponent( + config=ComponentConfig(llm_client=self._get_altk_llm_object()), + track=Track.FAST_TRACK, # Use fast track for performance + execution_mode=SPARCExecutionMode.SYNC, # Use SYNC to avoid event loop conflicts + ) return self._validate_and_run(*args, **kwargs)
468-512: Consider more robust error message detection.Line 473 uses a heuristic check for emoji characters (
"❌"or"•") to detect SPARC rejection messages. This could produce false positives if legitimate tool responses contain these characters.Consider a more structured approach, such as checking for a specific error prefix or using a flag passed from the validation layer:
def process_tool_response(self, tool_response: str, **_kwargs) -> str: logger.info("Calling process_tool_response of PostToolProcessor") tool_response_str = self._get_tool_response_str(tool_response) - # First check if this looks like an error message with bullet points (SPARC rejection) - if "❌" in tool_response_str or "•" in tool_response_str: + # Check if this looks like a SPARC rejection message + if tool_response_str.startswith("Tool call validation failed:"): logger.info("Detected error message with special characters, skipping JSON parsing") return tool_response_strThis approach is more specific and less likely to misidentify legitimate content.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
src/backend/tests/unit/components/models_and_agents/test_altk_agent_tool_conversion.py(1 hunks)src/lfx/src/lfx/base/agents/altk_base_agent.py(1 hunks)src/lfx/src/lfx/base/agents/altk_tool_wrappers.py(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-06-12T15:25:01.072Z
Learnt from: edwinjosechittilappilly
Repo: langflow-ai/langflow PR: 8504
File: src/backend/base/langflow/initial_setup/starter_projects/Image Sentiment Analysis.json:391-393
Timestamp: 2025-06-12T15:25:01.072Z
Learning: The repository owner prefers CodeRabbit not to review or comment on JSON files because they are autogenerated.
Applied to files:
src/lfx/src/lfx/base/agents/altk_tool_wrappers.py
⏰ 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). (21)
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 3/13
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 11/13
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 9/13
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 13/13
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 12/13
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 6/13
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 7/13
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 10/13
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 1/13
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 4/13
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 8/13
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 5/13
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 2/13
- GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 3
- GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 4
- GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 2
- GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 5
- GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 1
- GitHub Check: Run Backend Tests / Integration Tests - Python 3.10
- GitHub Check: Test Starter Templates
- GitHub Check: Run Ruff Check and Format
🔇 Additional comments (20)
src/lfx/src/lfx/base/agents/altk_base_agent.py (6)
41-77: LGTM! Well-structured message normalization.The function correctly handles both string and list content formats with appropriate fallbacks for edge cases.
83-101: LGTM! Clean abstraction for tool wrappers.The base class provides a clear contract for tool wrapper implementations.
132-158: Verify API key presence before access.Lines 144 and 150 call
.get_secret_value()on API keys without checking if they're set. If the API key is None or not properly configured, this could raise anAttributeError.Consider adding defensive checks:
if isinstance(llm_object, ChatAnthropic): model_name = f"anthropic/{llm_object.model}" - api_key = llm_object.anthropic_api_key.get_secret_value() + api_key = llm_object.anthropic_api_key.get_secret_value() if llm_object.anthropic_api_key else None + if not api_key: + logger.warning("Anthropic API key is not configured") + return None llm_client_type = "litellm.output_val" if use_output_val else "litellm"Similar pattern for OpenAI at line 150.
161-187: LGTM! Clean pipeline management.The reverse order application (line 184) ensures wrappers are applied in the expected decorator pattern where the first added wrapper becomes the outermost layer.
210-243: LGTM! Comprehensive conversation context building.The method handles multiple input formats with appropriate validation and clear error messages. The type checking at lines 229-234 provides good user feedback.
320-331: Verify content structure before filtering.Lines 323-324 assume all items in
lc_message.contentare dictionaries with agetmethod. If the list contains non-dict items, this will raise anAttributeError.Consider adding a type guard:
if hasattr(lc_message, "content") and isinstance(lc_message.content, list): # ! Because the input has to be a string, we must pass the images in the chat_history - - image_dicts = [item for item in lc_message.content if item.get("type") == "image"] - lc_message.content = [item for item in lc_message.content if item.get("type") != "image"] + + image_dicts = [item for item in lc_message.content if isinstance(item, dict) and item.get("type") == "image"] + lc_message.content = [item for item in lc_message.content if not isinstance(item, dict) or item.get("type") != "image"]src/lfx/src/lfx/base/agents/altk_tool_wrappers.py (8)
27-98: LGTM! Comprehensive type conversion.The function handles all major JSON Schema type constructs including unions, intersections, and arrays with recursive conversion. The fallback to "string" at line 96 is a safe default.
101-133: LGTM! Well-structured validated tool wrapper.The class properly uses
Field(default_factory=...)for mutable defaults, preventing the common Python pitfall of shared mutable default arguments.
144-207: LGTM! Robust validation with appropriate fallbacks.The method includes comprehensive error handling (lines 204-207) that falls back to direct tool execution if SPARC validation fails, ensuring resilience.
209-232: LGTM! Proper Pydantic v2 compatibility.The method correctly handles both Pydantic v1 (
__fields__) and v2 (model_fields) as noted in the addressed past review comment. The fallback logic (lines 228-230) ensures robustness.
234-257: LGTM! User-friendly error formatting.The method provides clear, actionable feedback with emoji indicators and suggested corrections when available.
264-304: LGTM! Clean wrapper implementation.The wrapper correctly handles already-wrapped tools (lines 284-290) and provides clear warning messages when required dependencies are missing (line 295).
306-407: LGTM! Comprehensive tool spec conversion.The method includes:
- Proper unwrapping of nested wrappers with depth protection (line 347)
- Pydantic v2 compatibility for required field detection (lines 375-378)
- Robust error handling with minimal spec fallback (lines 384-403)
- Clear warning when no specs are generated (line 406)
515-556: LGTM! Clean post-processing wrapper.The wrapper follows the same pattern as
PreToolValidationWrapperwith proper checks for required dependencies and handling of already-wrapped tools.src/backend/tests/unit/components/models_and_agents/test_altk_agent_tool_conversion.py (6)
7-53: LGTM! Well-structured test fixtures.The mock tools cover key scenarios: basic tools, no-parameter tools, and schema-based tools with various parameter types.
56-71: LGTM! Comprehensive test for basic tool conversion.The test verifies that LangChain's automatic parameter extraction from method signatures works correctly with the conversion function.
88-146: LGTM! Thorough test for list parameter conversion.The test validates both the Pydantic schema structure and the converted OpenAI function spec, ensuring proper handling of optional array parameters. The logging issue noted in past reviews has been fixed (line 128).
149-170: LGTM! Good test for batch conversion.The test ensures the conversion function correctly handles multiple tools in a single call and maintains their individual specifications.
172-197: LGTM! Good error handling test.The test validates that the conversion function gracefully degrades to a minimal spec when schema access fails, ensuring robustness.
200-248: LGTM! Comprehensive test for complex schemas.The test covers:
- Required vs optional field detection (lines 244-248)
- Union type handling for nullable fields (lines 234-236)
- Array type conversion (lines 239-242)
- Proper type mapping for all JSON Schema types
This provides excellent coverage for real-world tool schemas.
…ngflow-ai#10587) * Add ALTK Agent with tool validation and comprehensive tests - Added agent-lifecycle-toolkit~=0.4.1 dependency to pyproject.toml - Implemented ALTKBaseAgent with comprehensive error handling and tool validation - Added ALTKToolWrappers for SPARC integration and tool execution safety - Created ALTK Agent component with proper LangChain integration - Added comprehensive test suite covering tool validation, conversation context, and edge cases - Fixed docstring formatting to comply with ruff linting standards * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * [autofix.ci] apply automated fixes (attempt 3/3) * minor fix to execute_tool that was left out. * Fixes following coderabbitai comments. * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * Update component_index.json * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * [autofix.ci] apply automated fixes (attempt 3/3) * Add custom message to dict conversion in ValidatedTool * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * [autofix.ci] apply automated fixes (attempt 3/3) * Add Notion integration components to index Updated component_index.json to include new Notion integration components: AddContentToPage, NotionDatabaseProperties, NotionListPages, NotionPageContent, NotionPageCreator, NotionPageUpdate, and NotionSearch. These components provide functionality for interacting with Notion databases and pages, including querying, creating, updating, and retrieving content. * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * [autofix.ci] apply automated fixes (attempt 3/3) * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * [autofix.ci] apply automated fixes (attempt 3/3) * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) --------- Co-authored-by: Koren Lazar <[email protected]> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Edwin Jose <[email protected]>
…ngflow-ai#10587) * Add ALTK Agent with tool validation and comprehensive tests - Added agent-lifecycle-toolkit~=0.4.1 dependency to pyproject.toml - Implemented ALTKBaseAgent with comprehensive error handling and tool validation - Added ALTKToolWrappers for SPARC integration and tool execution safety - Created ALTK Agent component with proper LangChain integration - Added comprehensive test suite covering tool validation, conversation context, and edge cases - Fixed docstring formatting to comply with ruff linting standards * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * [autofix.ci] apply automated fixes (attempt 3/3) * minor fix to execute_tool that was left out. * Fixes following coderabbitai comments. * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * Update component_index.json * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * [autofix.ci] apply automated fixes (attempt 3/3) * Add custom message to dict conversion in ValidatedTool * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * [autofix.ci] apply automated fixes (attempt 3/3) * Add Notion integration components to index Updated component_index.json to include new Notion integration components: AddContentToPage, NotionDatabaseProperties, NotionListPages, NotionPageContent, NotionPageCreator, NotionPageUpdate, and NotionSearch. These components provide functionality for interacting with Notion databases and pages, including querying, creating, updating, and retrieving content. * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * [autofix.ci] apply automated fixes (attempt 3/3) * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * [autofix.ci] apply automated fixes (attempt 3/3) * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) --------- Co-authored-by: Koren Lazar <[email protected]> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Edwin Jose <[email protected]>
…parse errors (#10508) * feat: Add ALTK Agent with tool validation and comprehensive tests (#10587) * Add ALTK Agent with tool validation and comprehensive tests - Added agent-lifecycle-toolkit~=0.4.1 dependency to pyproject.toml - Implemented ALTKBaseAgent with comprehensive error handling and tool validation - Added ALTKToolWrappers for SPARC integration and tool execution safety - Created ALTK Agent component with proper LangChain integration - Added comprehensive test suite covering tool validation, conversation context, and edge cases - Fixed docstring formatting to comply with ruff linting standards * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * [autofix.ci] apply automated fixes (attempt 3/3) * minor fix to execute_tool that was left out. * Fixes following coderabbitai comments. * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * Update component_index.json * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * [autofix.ci] apply automated fixes (attempt 3/3) * Add custom message to dict conversion in ValidatedTool * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * [autofix.ci] apply automated fixes (attempt 3/3) * Add Notion integration components to index Updated component_index.json to include new Notion integration components: AddContentToPage, NotionDatabaseProperties, NotionListPages, NotionPageContent, NotionPageCreator, NotionPageUpdate, and NotionSearch. These components provide functionality for interacting with Notion databases and pages, including querying, creating, updating, and retrieving content. * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * [autofix.ci] apply automated fixes (attempt 3/3) * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * [autofix.ci] apply automated fixes (attempt 3/3) * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) --------- Co-authored-by: Koren Lazar <[email protected]> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Edwin Jose <[email protected]> * feat: Implement dynamic model discovery system (#10523) * add dynamic model request * add description to groq * add cache folder to store cache models json * change git ignore description * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * [autofix.ci] apply automated fixes (attempt 3/3) * add comprehensive tests for Groq dynamic model discovery - Add 101 unit tests covering success, error, and edge cases - Test model discovery, caching, tool calling detection - Test fallback models and backward compatibility - Add support for real GROQ_API_KEY from environment - Fix all lint errors and improve code quality * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * fix Python 3.10 compatibility - replace UTC with timezone.utc Python 3.10 doesn't have datetime.UTC, need to use timezone.utc instead * fix pytest hook signature - use config instead of _config * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes * fix conftest config.py * fix timezone UTC on tests * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> * feat: remove `code` from Transactions to reduce clutter in logs (#10400) * refactor: remove code from transaction model inputs * refactor: remove code from transaction model inputs * tests: add tests to make sure code is not added to transactions data * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * refactor: improve code removal from logs with explicit dict copying --------- Co-authored-by: Edwin Jose <[email protected]> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> * feat: new release for cuga component (#10591) * feat: new release of cuga * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * fix: address review * fix: fixed more bugs * fix: build component index * [autofix.ci] apply automated fixes * fix: update test * chore: update component index * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * [autofix.ci] apply automated fixes (attempt 3/3) --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> * feat: adds Component Inputs telemetry (#10254) * feat: Introduce telemetry tracking for sensitive field types Added a new set of field types that should not be tracked in telemetry due to their sensitive nature, including PASSWORD, AUTH, FILE, CONNECTION, and MCP. Updated relevant input classes to ensure telemetry tracking is disabled for these sensitive fields, enhancing data privacy and security. * feat: Enhance telemetry payloads with additional fields and serialization support Added new fields to the ComponentPayload and ComponentInputsPayload classes, including component_id and component_run_id, to improve telemetry data tracking. Introduced a serialize_input_values function to handle JSON serialization of component input values, ensuring robust handling of input data for telemetry purposes. * feat: Implement telemetry input tracking and caching Added functionality to track and cache telemetry input values within the Component class. Introduced a method to determine if inputs should be tracked based on sensitivity and an accessor for retrieving cached telemetry data, enhancing the robustness of telemetry handling. * feat: Add logging for component input telemetry Introduced a new method, log_package_component_inputs, to the TelemetryService for logging telemetry data related to component inputs. This enhancement improves the tracking capabilities of the telemetry system, allowing for more detailed insights into component interactions. * feat: Enhance telemetry logging for component execution Added functionality to log component input telemetry both during successful execution and error cases. Introduced a unique component_run_id for each execution to improve tracking. This update ensures comprehensive telemetry data collection, enhancing the robustness of the telemetry system. * feat: Extend telemetry payload tests and enhance serialization Added tests for the new component_id and component_run_id fields in ComponentPayload and ComponentInputsPayload classes. Introduced a new test suite for ComponentInputTelemetry, covering serialization of various data types and handling of edge cases. This update improves the robustness and coverage of telemetry data handling in the system. * fix: Update default telemetry tracking behavior in BaseInputMixin Changed the default value of track_in_telemetry from True to False in the BaseInputMixin class. Updated documentation to clarify that telemetry tracking is now opt-in and can be explicitly enabled for individual input types, enhancing data privacy and control. * fix: Update telemetry tracking defaults for input types Modified the default value of `track_in_telemetry` for various input classes to enhance data privacy. Regular inputs now default to False, while safe inputs like `IntInput` and `BoolInput` default to True, ensuring explicit opt-in for telemetry tracking. Updated related tests to reflect these changes. * feat: add chunk_index and total_chunks fields to ComponentInputsPayload This commit adds two new optional fields to ComponentInputsPayload: - chunk_index: Index of this chunk in a split payload sequence - total_chunks: Total number of chunks in the split sequence Both fields default to None and use camelCase aliases for serialization. This is Task 1 of the telemetry query parameter splitting implementation. Tests included: - Verify fields exist and can be set - Verify camelCase serialization aliases work correctly - Verify fields default to None when not provided Generated with Claude Code (https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * refactor: update ComponentInputsPayload to support automatic splitting of oversized inputs This commit enhances the ComponentInputsPayload class by implementing functionality to automatically split input values into multiple chunks if they exceed the maximum URL size limit. Key changes include: - Added methods for calculating URL size, truncating oversized values, and splitting payloads. - Updated component_inputs field to accept a dictionary instead of a string for better handling of input values. - Improved documentation for the ComponentInputsPayload class to reflect the new splitting behavior and usage examples. These changes aim to improve telemetry data handling and ensure compliance with URL length restrictions. * refactor: enhance log_package_component_inputs to handle oversized payloads This commit updates the log_package_component_inputs method in the TelemetryService class to split component input payloads into multiple requests if they exceed the maximum URL size limit. Key changes include: - Added logic to split the payload using the new split_if_needed method. - Each chunk is queued separately for telemetry logging. These improvements ensure better handling of telemetry data while adhering to URL length restrictions. * refactor: centralize maximum telemetry URL size constant This commit introduces a centralized constant, MAX_TELEMETRY_URL_SIZE, to define the maximum URL length for telemetry GET requests. Key changes include: - Added MAX_TELEMETRY_URL_SIZE constant to schema.py for better maintainability. - Updated split_if_needed method in ComponentInputsPayload to use the new constant instead of a hardcoded value. - Adjusted the TelemetryService to reference the centralized constant for URL size limits. These changes enhance code clarity and ensure consistent handling of URL size limits across the telemetry service. * refactor: update ComponentInputsPayload tests to use dictionary inputs This commit modifies the tests for ComponentInputsPayload to utilize a dictionary for component inputs instead of a serialized JSON string. Key changes include: - Renamed the test method to reflect the new input type. - Removed unnecessary serialization steps and assertions related to JSON strings. - Added assertions to verify the correct handling of dictionary inputs. These changes streamline the testing process and improve clarity in how component inputs are represented. * test: add integration tests for telemetry service payload splitting This commit introduces integration tests for the TelemetryService to verify its handling of large and small payloads. Key changes include: - Added tests to ensure large payloads are split into multiple chunks and queued correctly. - Implemented a test to confirm that small payloads are not split and result in a single queued event. - Created a mock settings service for testing purposes. These tests enhance the reliability of the telemetry service by ensuring proper payload management. * test: enhance ComponentInputsPayload tests with additional scenarios This commit expands the test suite for ComponentInputsPayload by adding various scenarios to ensure robust handling of input payloads. Key changes include: - Introduced tests for calculating URL size, ensuring it returns a positive integer and accounts for encoding. - Added tests to verify the splitting logic for large payloads, including checks for chunk metadata and preservation of fixed fields. - Implemented property-based tests using Hypothesis to validate that all chunks respect the maximum URL size and preserve original data. These enhancements improve the reliability and coverage of the ComponentInputsPayload tests, ensuring proper functionality under various conditions. * [autofix.ci] apply automated fixes * optimize query param encoding Co-authored-by: codeflash-ai[bot] <148906541+codeflash-ai[bot]@users.noreply.github.com> * refactor: extract telemetry logging logic into a separate function This commit introduces a new function, _log_component_input_telemetry, to centralize the logic for logging component input telemetry. The function is called in two places within the generate_flow_events function, improving code readability and maintainability by reducing duplication. This change enhances the clarity of telemetry handling in the flow generation process. * refactor: optimize truncation logic in ComponentInputsPayload This commit refines the truncation logic for input values in the ComponentInputsPayload class. The previous binary search method for string values has been simplified, allowing for direct truncation of both string and non-string values. This change enhances code clarity and maintains functionality while ensuring optimal handling of oversized inputs. * refactor: update telemetry tracking logic to respect opt-in flag This commit modifies the telemetry tracking logic in the Component class to change the default behavior of the `track_in_telemetry` attribute from True to False. This adjustment enhances user privacy by requiring explicit consent for tracking input objects in telemetry. The change ensures that sensitive field types are still auto-excluded from tracking, maintaining the integrity of the telemetry data. * refactor: update tests to use dictionary format for component inputs This commit modifies the integration tests for telemetry payload validation and component input telemetry to utilize dictionaries for component inputs instead of serialized JSON strings. Key changes include: - Updated assertions to compare dictionary inputs directly. - Enhanced clarity and maintainability of the test cases by removing unnecessary serialization steps. These changes improve the representation of component inputs in tests, aligning with recent refactoring efforts. * [autofix.ci] apply automated fixes * refactor: specify type for current_chunk_inputs in ComponentInputsPayload This commit updates the type annotation for the current_chunk_inputs variable in the ComponentInputsPayload class to explicitly define it as a dictionary. This change enhances code clarity and maintainability by providing better type information for developers working with the code. * test: add component_id to ComponentPayload tests This commit enhances the test cases for the ComponentPayload class by adding a component_id parameter to various initialization tests. The updates ensure that the component_id is properly tested across different scenarios, including valid parameters, error messages, and edge cases. This change improves the robustness of the tests and aligns with recent updates to the ComponentPayload structure. * [autofix.ci] apply automated fixes * feat: add component_id to ComponentPayload in build_vertex function * fix: update MAX_TELEMETRY_URL_SIZE to 2048 and adjust related tests This commit increases the maximum URL size for telemetry GET requests from 2000 to 2048 bytes to align with Scarf's specifications. Corresponding test assertions have been updated to reference the new constant, ensuring consistency across the codebase. * [autofix.ci] apply automated fixes * feat(telemetry): add track_in_telemetry field to starter project configurations * refactor(telemetry): remove unused blank line in test imports * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * [autofix.ci] apply automated fixes (attempt 3/3) * update starter templates * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * [autofix.ci] apply automated fixes (attempt 3/3) * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) --------- Co-authored-by: Claude <[email protected]> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: codeflash-ai[bot] <148906541+codeflash-ai[bot]@users.noreply.github.com> * feat: Add gpt-5.1 model to Language models (#10590) * Add gpt-5.1 model to starter projects Added 'gpt-5.1' to the list of available models in all starter project JSON files to support the new model version. This update ensures users can select gpt-5.1 in agent configurations. * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * [autofix.ci] apply automated fixes (attempt 3/3) * Update component_index.json * [autofix.ci] apply automated fixes * Update component_index.json * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * [autofix.ci] apply automated fixes (attempt 3/3) --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> * fix: Use the proper Embeddings import for Qdrant vector store (#10613) * Use the proper Embeddings import for Qdrant vector store * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * [autofix.ci] apply automated fixes (attempt 3/3) --------- Co-authored-by: Madhavan <[email protected]> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> * fix: Ensure split text test is more robust (#10622) * fix: Ensure split text test is more robust * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * [autofix.ci] apply automated fixes (attempt 3/3) --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> * fix: use issubclass in the pool creation (#10232) * use issubclass in the pool creation * [autofix.ci] apply automated fixes * add poolclass pytests * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * [autofix.ci] apply automated fixes (attempt 3/3) --------- Co-authored-by: Hamza Rashid <[email protected]> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: cristhianzl <[email protected]> * feat: make it possible to load graphs using `get_graph` function in scripts (#9913) * feat: Enhance graph loading functionality to support async retrieval - Updated `load_graph_from_script` to be an async function, allowing for the retrieval of the graph via an async `get_graph` function if available. - Implemented fallback to the existing `graph` variable for backward compatibility. - Enhanced `find_graph_variable` to identify both `get_graph` function definitions and `graph` variable assignments, improving flexibility in script handling. * feat: Update load_graph_from_script to support async graph retrieval - Refactored `load_graph_from_script` to be an async function, enabling the use of an async `get_graph` function for graph retrieval. - Implemented a fallback mechanism to access the `graph` variable for backward compatibility. - Enhanced error handling to provide clearer messages when neither `graph` nor `get_graph()` is found in the script. * feat: Refactor simple_agent.py to support async graph creation - Introduced an async `get_graph` function to handle the initialization of components and graph creation without blocking. - Updated the logging configuration and component setup to be part of the async function, improving the overall flow and responsiveness. - Enhanced documentation for the `get_graph` function to clarify its purpose and return type. * feat: Update serve_command and run functions to support async graph loading - Refactored `serve_command` to be an async function using `syncify`, allowing for non-blocking execution. - Updated calls to `load_graph_from_path` and `load_graph_from_script` within `serve_command` and `run` to await their results, enhancing performance and responsiveness. - Improved overall async handling in the CLI commands for better integration with async workflows. * feat: Refactor load_graph_from_path to support async execution - Changed `load_graph_from_path` to an async function, enabling non-blocking graph loading. - Updated the call to `load_graph_from_script` to use await, improving performance during graph retrieval. - Enhanced the overall async handling in the CLI for better integration with async workflows. * feat: Enhance async handling in simple_agent and related tests - Updated `get_graph` function in `simple_agent.py` to utilize async component initialization for improved responsiveness. - Modified test cases in `test_simple_agent_in_lfx_run.py` to validate the async behavior of `get_graph`. - Refactored various test functions across multiple files to support async execution, ensuring compatibility with the new async workflows. - Improved documentation for async functions to clarify their purpose and usage. * docs: Implement async get_graph function for improved component initialization - Introduced an async `get_graph` function in `README.md` to facilitate non-blocking component initialization. - Enhanced the logging configuration and component setup within the async function, ensuring a smoother flow. - Updated documentation to clarify the purpose and return type of the `get_graph` function, aligning with the async handling improvements. * refactor: reorder imports in simple_agent test file * style: reorder imports in simple_agent test file * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * [autofix.ci] apply automated fixes (attempt 3/3) * update component index * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * [autofix.ci] apply automated fixes (attempt 3/3) * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * [autofix.ci] apply automated fixes (attempt 3/3) --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> * feat: Add ALTK Agent with tool validation and comprehensive tests (#10587) * Add ALTK Agent with tool validation and comprehensive tests - Added agent-lifecycle-toolkit~=0.4.1 dependency to pyproject.toml - Implemented ALTKBaseAgent with comprehensive error handling and tool validation - Added ALTKToolWrappers for SPARC integration and tool execution safety - Created ALTK Agent component with proper LangChain integration - Added comprehensive test suite covering tool validation, conversation context, and edge cases - Fixed docstring formatting to comply with ruff linting standards * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * [autofix.ci] apply automated fixes (attempt 3/3) * minor fix to execute_tool that was left out. * Fixes following coderabbitai comments. * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * Update component_index.json * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * [autofix.ci] apply automated fixes (attempt 3/3) * Add custom message to dict conversion in ValidatedTool * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * [autofix.ci] apply automated fixes (attempt 3/3) * Add Notion integration components to index Updated component_index.json to include new Notion integration components: AddContentToPage, NotionDatabaseProperties, NotionListPages, NotionPageContent, NotionPageCreator, NotionPageUpdate, and NotionSearch. These components provide functionality for interacting with Notion databases and pages, including querying, creating, updating, and retrieving content. * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * [autofix.ci] apply automated fixes (attempt 3/3) * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * [autofix.ci] apply automated fixes (attempt 3/3) * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) --------- Co-authored-by: Koren Lazar <[email protected]> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Edwin Jose <[email protected]> * feat: Implement dynamic model discovery system (#10523) * add dynamic model request * add description to groq * add cache folder to store cache models json * change git ignore description * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * [autofix.ci] apply automated fixes (attempt 3/3) * add comprehensive tests for Groq dynamic model discovery - Add 101 unit tests covering success, error, and edge cases - Test model discovery, caching, tool calling detection - Test fallback models and backward compatibility - Add support for real GROQ_API_KEY from environment - Fix all lint errors and improve code quality * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * fix Python 3.10 compatibility - replace UTC with timezone.utc Python 3.10 doesn't have datetime.UTC, need to use timezone.utc instead * fix pytest hook signature - use config instead of _config * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes * fix conftest config.py * fix timezone UTC on tests * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> * feat: remove `code` from Transactions to reduce clutter in logs (#10400) * refactor: remove code from transaction model inputs * refactor: remove code from transaction model inputs * tests: add tests to make sure code is not added to transactions data * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * refactor: improve code removal from logs with explicit dict copying --------- Co-authored-by: Edwin Jose <[email protected]> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> * feat: new release for cuga component (#10591) * feat: new release of cuga * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * fix: address review * fix: fixed more bugs * fix: build component index * [autofix.ci] apply automated fixes * fix: update test * chore: update component index * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * [autofix.ci] apply automated fixes (attempt 3/3) --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> * feat: adds Component Inputs telemetry (#10254) * feat: Introduce telemetry tracking for sensitive field types Added a new set of field types that should not be tracked in telemetry due to their sensitive nature, including PASSWORD, AUTH, FILE, CONNECTION, and MCP. Updated relevant input classes to ensure telemetry tracking is disabled for these sensitive fields, enhancing data privacy and security. * feat: Enhance telemetry payloads with additional fields and serialization support Added new fields to the ComponentPayload and ComponentInputsPayload classes, including component_id and component_run_id, to improve telemetry data tracking. Introduced a serialize_input_values function to handle JSON serialization of component input values, ensuring robust handling of input data for telemetry purposes. * feat: Implement telemetry input tracking and caching Added functionality to track and cache telemetry input values within the Component class. Introduced a method to determine if inputs should be tracked based on sensitivity and an accessor for retrieving cached telemetry data, enhancing the robustness of telemetry handling. * feat: Add logging for component input telemetry Introduced a new method, log_package_component_inputs, to the TelemetryService for logging telemetry data related to component inputs. This enhancement improves the tracking capabilities of the telemetry system, allowing for more detailed insights into component interactions. * feat: Enhance telemetry logging for component execution Added functionality to log component input telemetry both during successful execution and error cases. Introduced a unique component_run_id for each execution to improve tracking. This update ensures comprehensive telemetry data collection, enhancing the robustness of the telemetry system. * feat: Extend telemetry payload tests and enhance serialization Added tests for the new component_id and component_run_id fields in ComponentPayload and ComponentInputsPayload classes. Introduced a new test suite for ComponentInputTelemetry, covering serialization of various data types and handling of edge cases. This update improves the robustness and coverage of telemetry data handling in the system. * fix: Update default telemetry tracking behavior in BaseInputMixin Changed the default value of track_in_telemetry from True to False in the BaseInputMixin class. Updated documentation to clarify that telemetry tracking is now opt-in and can be explicitly enabled for individual input types, enhancing data privacy and control. * fix: Update telemetry tracking defaults for input types Modified the default value of `track_in_telemetry` for various input classes to enhance data privacy. Regular inputs now default to False, while safe inputs like `IntInput` and `BoolInput` default to True, ensuring explicit opt-in for telemetry tracking. Updated related tests to reflect these changes. * feat: add chunk_index and total_chunks fields to ComponentInputsPayload This commit adds two new optional fields to ComponentInputsPayload: - chunk_index: Index of this chunk in a split payload sequence - total_chunks: Total number of chunks in the split sequence Both fields default to None and use camelCase aliases for serialization. This is Task 1 of the telemetry query parameter splitting implementation. Tests included: - Verify fields exist and can be set - Verify camelCase serialization aliases work correctly - Verify fields default to None when not provided Generated with Claude Code (https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * refactor: update ComponentInputsPayload to support automatic splitting of oversized inputs This commit enhances the ComponentInputsPayload class by implementing functionality to automatically split input values into multiple chunks if they exceed the maximum URL size limit. Key changes include: - Added methods for calculating URL size, truncating oversized values, and splitting payloads. - Updated component_inputs field to accept a dictionary instead of a string for better handling of input values. - Improved documentation for the ComponentInputsPayload class to reflect the new splitting behavior and usage examples. These changes aim to improve telemetry data handling and ensure compliance with URL length restrictions. * refactor: enhance log_package_component_inputs to handle oversized payloads This commit updates the log_package_component_inputs method in the TelemetryService class to split component input payloads into multiple requests if they exceed the maximum URL size limit. Key changes include: - Added logic to split the payload using the new split_if_needed method. - Each chunk is queued separately for telemetry logging. These improvements ensure better handling of telemetry data while adhering to URL length restrictions. * refactor: centralize maximum telemetry URL size constant This commit introduces a centralized constant, MAX_TELEMETRY_URL_SIZE, to define the maximum URL length for telemetry GET requests. Key changes include: - Added MAX_TELEMETRY_URL_SIZE constant to schema.py for better maintainability. - Updated split_if_needed method in ComponentInputsPayload to use the new constant instead of a hardcoded value. - Adjusted the TelemetryService to reference the centralized constant for URL size limits. These changes enhance code clarity and ensure consistent handling of URL size limits across the telemetry service. * refactor: update ComponentInputsPayload tests to use dictionary inputs This commit modifies the tests for ComponentInputsPayload to utilize a dictionary for component inputs instead of a serialized JSON string. Key changes include: - Renamed the test method to reflect the new input type. - Removed unnecessary serialization steps and assertions related to JSON strings. - Added assertions to verify the correct handling of dictionary inputs. These changes streamline the testing process and improve clarity in how component inputs are represented. * test: add integration tests for telemetry service payload splitting This commit introduces integration tests for the TelemetryService to verify its handling of large and small payloads. Key changes include: - Added tests to ensure large payloads are split into multiple chunks and queued correctly. - Implemented a test to confirm that small payloads are not split and result in a single queued event. - Created a mock settings service for testing purposes. These tests enhance the reliability of the telemetry service by ensuring proper payload management. * test: enhance ComponentInputsPayload tests with additional scenarios This commit expands the test suite for ComponentInputsPayload by adding various scenarios to ensure robust handling of input payloads. Key changes include: - Introduced tests for calculating URL size, ensuring it returns a positive integer and accounts for encoding. - Added tests to verify the splitting logic for large payloads, including checks for chunk metadata and preservation of fixed fields. - Implemented property-based tests using Hypothesis to validate that all chunks respect the maximum URL size and preserve original data. These enhancements improve the reliability and coverage of the ComponentInputsPayload tests, ensuring proper functionality under various conditions. * [autofix.ci] apply automated fixes * optimize query param encoding Co-authored-by: codeflash-ai[bot] <148906541+codeflash-ai[bot]@users.noreply.github.com> * refactor: extract telemetry logging logic into a separate function This commit introduces a new function, _log_component_input_telemetry, to centralize the logic for logging component input telemetry. The function is called in two places within the generate_flow_events function, improving code readability and maintainability by reducing duplication. This change enhances the clarity of telemetry handling in the flow generation process. * refactor: optimize truncation logic in ComponentInputsPayload This commit refines the truncation logic for input values in the ComponentInputsPayload class. The previous binary search method for string values has been simplified, allowing for direct truncation of both string and non-string values. This change enhances code clarity and maintains functionality while ensuring optimal handling of oversized inputs. * refactor: update telemetry tracking logic to respect opt-in flag This commit modifies the telemetry tracking logic in the Component class to change the default behavior of the `track_in_telemetry` attribute from True to False. This adjustment enhances user privacy by requiring explicit consent for tracking input objects in telemetry. The change ensures that sensitive field types are still auto-excluded from tracking, maintaining the integrity of the telemetry data. * refactor: update tests to use dictionary format for component inputs This commit modifies the integration tests for telemetry payload validation and component input telemetry to utilize dictionaries for component inputs instead of serialized JSON strings. Key changes include: - Updated assertions to compare dictionary inputs directly. - Enhanced clarity and maintainability of the test cases by removing unnecessary serialization steps. These changes improve the representation of component inputs in tests, aligning with recent refactoring efforts. * [autofix.ci] apply automated fixes * refactor: specify type for current_chunk_inputs in ComponentInputsPayload This commit updates the type annotation for the current_chunk_inputs variable in the ComponentInputsPayload class to explicitly define it as a dictionary. This change enhances code clarity and maintainability by providing better type information for developers working with the code. * test: add component_id to ComponentPayload tests This commit enhances the test cases for the ComponentPayload class by adding a component_id parameter to various initialization tests. The updates ensure that the component_id is properly tested across different scenarios, including valid parameters, error messages, and edge cases. This change improves the robustness of the tests and aligns with recent updates to the ComponentPayload structure. * [autofix.ci] apply automated fixes * feat: add component_id to ComponentPayload in build_vertex function * fix: update MAX_TELEMETRY_URL_SIZE to 2048 and adjust related tests This commit increases the maximum URL size for telemetry GET requests from 2000 to 2048 bytes to align with Scarf's specifications. Corresponding test assertions have been updated to reference the new constant, ensuring consistency across the codebase. * [autofix.ci] apply automated fixes * feat(telemetry): add track_in_telemetry field to starter project configurations * refactor(telemetry): remove unused blank line in test imports * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * [autofix.ci] apply automated fixes (attempt 3/3) * update starter templates * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * [autofix.ci] apply automated fixes (attempt 3/3) * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) --------- Co-authored-by: Claude <[email protected]> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: codeflash-ai[bot] <148906541+codeflash-ai[bot]@users.noreply.github.com> * feat: Add gpt-5.1 model to Language models (#10590) * Add gpt-5.1 model to starter projects Added 'gpt-5.1' to the list of available models in all starter project JSON files to support the new model version. This update ensures users can select gpt-5.1 in agent configurations. * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * [autofix.ci] apply automated fixes (attempt 3/3) * Update component_index.json * [autofix.ci] apply automated fixes * Update component_index.json * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * [autofix.ci] apply automated fixes (attempt 3/3) --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> * fix: Use the proper Embeddings import for Qdrant vector store (#10613) * Use the proper Embeddings import for Qdrant vector store * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * [autofix.ci] apply automated fixes (attempt 3/3) --------- Co-authored-by: Madhavan <[email protected]> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> * fix: Ensure split text test is more robust (#10622) * fix: Ensure split text test is more robust * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * [autofix.ci] apply automated fixes (attempt 3/3) --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> * fix: use issubclass in the pool creation (#10232) * use issubclass in the pool creation * [autofix.ci] apply automated fixes * add poolclass pytests * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * [autofix.ci] apply automated fixes (attempt 3/3) --------- Co-authored-by: Hamza Rashid <[email protected]> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: cristhianzl <[email protected]> * feat: make it possible to load graphs using `get_graph` function in scripts (#9913) * feat: Enhance graph loading functionality to support async retrieval - Updated `load_graph_from_script` to be an async function, allowing for the retrieval of the graph via an async `get_graph` function if available. - Implemented fallback to the existing `graph` variable for backward compatibility. - Enhanced `find_graph_variable` to identify both `get_graph` function definitions and `graph` variable assignments, improving flexibility in script handling. * feat: Update load_graph_from_script to support async graph retrieval - Refactored `load_graph_from_script` to be an async function, enabling the use of an async `get_graph` function for graph retrieval. - Implemented a fallback mechanism to access the `graph` variable for backward compatibility. - Enhanced error handling to provide clearer messages when neither `graph` nor `get_graph()` is found in the script. * feat: Refactor simple_agent.py to support async graph creation - Introduced an async `get_graph` function to handle the initialization of components and graph creation without blocking. - Updated the logging configuration and component setup to be part of the async function, improving the overall flow and responsiveness. - Enhanced documentation for the `get_graph` function to clarify its purpose and return type. * feat: Update serve_command and run functions to support async graph loading - Refactored `serve_command` to be an async function using `syncify`, allowing for non-blocking execution. - Updated calls to `load_graph_from_path` and `load_graph_from_script` within `serve_command` and `run` to await their results, enhancing performance and responsiveness. - Improved overall async handling in the CLI commands for better integration with async workflows. * feat: Refactor load_graph_from_path to support async execution - Changed `load_graph_from_path` to an async function, enabling non-blocking graph loading. - Updated the call to `load_graph_from_script` to use await, improving performance during graph retrieval. - Enhanced the overall async handling in the CLI for better integration with async workflows. * feat: Enhance async handling in simple_agent and related tests - Updated `get_graph` function in `simple_agent.py` to utilize async component initialization for improved responsiveness. - Modified test cases in `test_simple_agent_in_lfx_run.py` to validate the async behavior of `get_graph`. - Refactored various test functions across multiple files to support async execution, ensuring compatibility with the new async workflows. - Improved documentation for async functions to clarify their purpose and usage. * docs: Implement async get_graph function for improved component initialization - Introduced an async `get_graph` function in `README.md` to facilitate non-blocking component initialization. - Enhanced the logging configuration and component setup within the async function, ensuring a smoother flow. - Updated documentation to clarify the purpose and return type of the `get_graph` function, aligning with the async handling improvements. * refactor: reorder imports in simple_agent test file * style: reorder imports in simple_agent test file * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * [autofix.ci] apply automated fixes (attempt 3/3) * update component index * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * [autofix.ci] apply automated fixes (attempt 3/3) * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * [autofix.ci] apply automated fixes (attempt 3/3) --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> * fix: prevent UI from getting stuck when switching to cURL mode after parse errors * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * [autofix.ci] apply automated fixes (attempt 3/3) * [autofix.ci] apply automated fixes --------- Co-authored-by: Koren Lazar <[email protected]> Co-authored-by: Koren Lazar <[email protected]> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Edwin Jose <[email protected]> Co-authored-by: Cristhian Zanforlin Lousa <[email protected]> Co-authored-by: Gabriel Luiz Freitas Almeida <[email protected]> Co-authored-by: Sami Marreed <[email protected]> Co-authored-by: Claude <[email protected]> Co-authored-by: codeflash-ai[bot] <148906541+codeflash-ai[bot]@users.noreply.github.com> Co-authored-by: Madhavan <[email protected]> Co-authored-by: Madhavan <[email protected]> Co-authored-by: Eric Hare <[email protected]> Co-authored-by: ming <[email protected]> Co-authored-by: Hamza Rashid <[email protected]>
Summary by CodeRabbit
New Features
Tests
Chores