Skip to content

fix(langflow): resolve #13231 by correcting Composio tool schema type normalization#13308

Open
gingeekrishna wants to merge 3 commits into
langflow-ai:mainfrom
gingeekrishna:fix/13231-composio-tool-schema-type
Open

fix(langflow): resolve #13231 by correcting Composio tool schema type normalization#13308
gingeekrishna wants to merge 3 commits into
langflow-ai:mainfrom
gingeekrishna:fix/13231-composio-tool-schema-type

Conversation

@gingeekrishna

@gingeekrishna gingeekrishna commented May 23, 2026

Copy link
Copy Markdown
Contributor

… normalization

Summary by CodeRabbit

  • Bug Fixes

    • Automatic tool argument schema repair: Missing type declarations in tool schemas are now inferred and corrected, preventing compatibility issues with tool-calling stacks.
    • Robust error handling: Tool configuration failures are now caught and logged without interrupting the setup process.
  • Tests

    • Added test suite for schema sanitization logic.

Review Change Stack

Copilot AI review requested due to automatic review settings May 23, 2026 16:23
@coderabbitai

coderabbitai Bot commented May 23, 2026

Copy link
Copy Markdown
Contributor

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.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d1c3d431-a959-4095-8375-62abd7fb02b8

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

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

This PR adds JSON Schema sanitization utilities for Composio tools to repair missing type declarations, which are required by certain tool-calling frameworks. The implementation provides schema inference and recursive in-place sanitization, integrates into tool configuration and tool building pipelines with exception suppression, and includes unit tests validating the repair behavior.

Changes

Composio Tool Argument Schema Sanitization

Layer / File(s) Summary
Schema sanitization utilities
src/lfx/src/lfx/base/composio/schema_utils.py
Introduces _infer_schema_type() to determine missing JSON Schema types from object/array indicators, union variants, and enum values; _sanitize_schema_in_place() to recursively traverse and fill missing type fields; and sanitize_tool_args_schema() to normalize a tool's args schema and detect changes.
Unit tests for schema sanitization
src/backend/tests/unit/components/bundles/composio/test_schema_utils.py
Validates that sanitize_tool_args_schema repairs missing type fields in tool.args and updates the schema when needed, and verifies the sanitizer is a no-op for already-valid schemas.
Base component integration
src/lfx/src/lfx/base/composio/composio_base.py
Adds import and best-effort invocation of sanitize_tool_args_schema() during configure_tools(), suppressing exceptions to prevent tool configuration failures.
API component integration
src/lfx/src/lfx/components/composio/composio_api.py
Adds import and applies sanitize_tool_args_schema() in tool building after filtering by action name, logging sanitization errors while preserving the filtered tool list.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 7 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Test Quality And Coverage ⚠️ Warning Only 2 smoke tests cover 1 public function; critical branches in _infer_schema_type (enums, items, defaults) and _sanitize_schema_in_place recursion are untested. Add tests for enum inference, array schemas, nested recursion, edge cases (null args_schema), and complex nested schemas to improve branch coverage.
✅ Passed checks (7 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Test Coverage For New Implementations ✅ Passed Unit tests for new sanitize_tool_args_schema() function are included with proper naming conventions and pytest markers. Tests validate core functionality effectively.
Test File Naming And Structure ✅ Passed Test file follows correct patterns: test_*.py naming, proper pytest structure, descriptive function names, logical organization, and covers positive and negative scenarios.
Excessive Mock Usage Warning ✅ Passed The test file uses zero mocks. It uses real/lightweight test doubles (SimpleNamespace, real classes), calls actual dependencies, and tests real behavior—excellent design.
Title check ✅ Passed The title 'fix(langflow): resolve #13231 by correcting Composio tool schema type normalization' directly matches the main changes: it describes fixing Composio tool schema type normalization by adding schema_utils.py with sanitization logic and integrating it into the tool configuration pipeline.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 bug Something isn't working label May 23, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR introduces a sanitization step for Composio tool argument JSON schemas to prevent downstream tool-calling failures when schemas are missing type declarations.

Changes:

  • Add sanitize_tool_args_schema utility to normalize/repair tool args and args_schema JSON schemas.
  • Apply schema sanitization when selecting/configuring Composio tools in both the component API and base wrapper.
  • Add unit tests validating schema repair behavior and no-op behavior for already-valid schemas.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
src/lfx/src/lfx/components/composio/composio_api.py Sanitizes selected Composio tools’ args schemas after filtering actions.
src/lfx/src/lfx/base/composio/schema_utils.py Adds schema inference + recursive sanitizer and a public sanitize_tool_args_schema helper.
src/lfx/src/lfx/base/composio/composio_base.py Sanitizes each tool’s args schema during configure_tools.
src/backend/tests/unit/components/bundles/composio/test_schema_utils.py Adds unit tests for schema sanitization behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/lfx/src/lfx/base/composio/schema_utils.py Outdated
Comment thread src/lfx/src/lfx/base/composio/schema_utils.py Outdated
Comment thread src/lfx/src/lfx/components/composio/composio_api.py Outdated
Comment thread src/lfx/src/lfx/base/composio/composio_base.py Outdated
@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels May 23, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (3)
src/lfx/src/lfx/components/composio/composio_api.py (1)

260-263: ⚡ Quick win

Include exception details when sanitization is skipped.

The current log drops the error context, which makes root-cause analysis harder.

Suggested fix
-        for tool in selected_tools:
-            try:
-                sanitize_tool_args_schema(tool)
-            except (TypeError, ValueError, AttributeError):
-                self.log(f"Skipping args schema sanitization for tool: {getattr(tool, 'name', 'unknown')}")
+        for tool in selected_tools:
+            try:
+                sanitize_tool_args_schema(tool)
+            except (TypeError, ValueError, AttributeError) as e:
+                self.log(
+                    f"Skipping args schema sanitization for tool: {getattr(tool, 'name', 'unknown')} ({e})"
+                )
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/lfx/src/lfx/components/composio/composio_api.py` around lines 260 - 263,
The log inside the except block for sanitize_tool_args_schema(tool) currently
omits the exception details; update the except handling for (TypeError,
ValueError, AttributeError) to capture the exception (e) and include its
message/representation in the self.log call so the log reads something like
"Skipping args schema sanitization for tool: <name> - <exception>" using
getattr(tool, 'name', 'unknown') and the caught exception to aid debugging.
src/lfx/src/lfx/base/composio/composio_base.py (1)

2364-2365: ⚡ Quick win

Avoid silent suppression of sanitization failures.

This currently drops all sanitization exceptions with no signal. Logging at debug level here would make schema issues diagnosable without breaking tool configuration.

Suggested fix
-            with suppress(ValueError, TypeError, AttributeError):
-                sanitize_tool_args_schema(tool)
+            try:
+                sanitize_tool_args_schema(tool)
+            except (ValueError, TypeError, AttributeError) as e:
+                logger.debug("Skipping args schema sanitization for tool '%s': %s", getattr(tool, "name", "unknown"), e)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/lfx/src/lfx/base/composio/composio_base.py` around lines 2364 - 2365,
Replace the silent suppression around sanitize_tool_args_schema(tool) (currently
using suppress(ValueError, TypeError, AttributeError)) with an explicit
try/except that catches ValueError, TypeError and AttributeError and logs the
exception at debug level (including exc_info/stacktrace) along with a brief
context (e.g., the tool identifier) before continuing; keep the same non-fatal
behavior so configuration proceeds after logging.
src/backend/tests/unit/components/bundles/composio/test_schema_utils.py (1)

39-72: ⚡ Quick win

Add one malformed-schema test case for the error path.

Current tests validate positive/no-op behavior, but they don’t assert behavior when args_schema.model_json_schema() returns invalid data (e.g., non-dict). A small negative test here would lock in the best-effort contract.

As per coding guidelines "**/test_*.py: Consider including edge cases and error conditions for comprehensive test coverage" and "Verify tests cover both positive and negative scenarios where appropriate."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/backend/tests/unit/components/bundles/composio/test_schema_utils.py`
around lines 39 - 72, Add a negative test that ensures sanitize_tool_args_schema
handles a malformed args_schema.model_json_schema() return (non-dict) without
raising and treats it as a no-op: create a SimpleNamespace tool with args (e.g.,
subject/type string) and an args_schema object whose model_json_schema() returns
an invalid type (like None or a string), call sanitize_tool_args_schema(tool),
assert it returns False, and assert tool.args remains unchanged; reference
sanitize_tool_args_schema, tool.args, and args_schema.model_json_schema in the
test (suggested name: test_sanitize_tool_args_schema_handles_malformed_schema).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/lfx/src/lfx/base/composio/schema_utils.py`:
- Around line 56-59: Ruff flags nested ifs in _sanitize_schema_in_place where
you check isinstance(properties, dict) then iterate and nest
isinstance(prop_schema, dict) and another conditional; refactor each nested
conditional (the blocks around properties.values(), the prop_schema dict check,
and the inner conditional at/near lines 56-59, 62-65, 68-69) into single
combined conditionals (e.g., combine isinstance checks and the inner predicate
with and/or short-circuiting) or return early to avoid nesting; update the logic
in the _sanitize_schema_in_place function so each branch uses a flat if with
combined conditions or early continue/return while preserving existing behavior
and references to properties and prop_schema.
- Around line 44-47: The code currently overwrites schema["type"] whenever
schema_type is not a str; change this to only overwrite when schema_type is
neither a str nor a valid list/tuple of str (e.g., preserve unions like
["string","null"]). In the block around schema_type and _infer_schema_type,
check isinstance(schema_type, (list, tuple)) and validate all elements are str
before leaving it alone; only call _infer_schema_type and set schema["type"] =
_infer_schema_type(schema) (and changed = True) when schema_type is invalid (not
a str and not a list/tuple of str).

---

Nitpick comments:
In `@src/backend/tests/unit/components/bundles/composio/test_schema_utils.py`:
- Around line 39-72: Add a negative test that ensures sanitize_tool_args_schema
handles a malformed args_schema.model_json_schema() return (non-dict) without
raising and treats it as a no-op: create a SimpleNamespace tool with args (e.g.,
subject/type string) and an args_schema object whose model_json_schema() returns
an invalid type (like None or a string), call sanitize_tool_args_schema(tool),
assert it returns False, and assert tool.args remains unchanged; reference
sanitize_tool_args_schema, tool.args, and args_schema.model_json_schema in the
test (suggested name: test_sanitize_tool_args_schema_handles_malformed_schema).

In `@src/lfx/src/lfx/base/composio/composio_base.py`:
- Around line 2364-2365: Replace the silent suppression around
sanitize_tool_args_schema(tool) (currently using suppress(ValueError, TypeError,
AttributeError)) with an explicit try/except that catches ValueError, TypeError
and AttributeError and logs the exception at debug level (including
exc_info/stacktrace) along with a brief context (e.g., the tool identifier)
before continuing; keep the same non-fatal behavior so configuration proceeds
after logging.

In `@src/lfx/src/lfx/components/composio/composio_api.py`:
- Around line 260-263: The log inside the except block for
sanitize_tool_args_schema(tool) currently omits the exception details; update
the except handling for (TypeError, ValueError, AttributeError) to capture the
exception (e) and include its message/representation in the self.log call so the
log reads something like "Skipping args schema sanitization for tool: <name> -
<exception>" using getattr(tool, 'name', 'unknown') and the caught exception to
aid debugging.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: dc4b9989-3a0a-4cad-98e5-647fa21ea063

📥 Commits

Reviewing files that changed from the base of the PR and between b0b5849 and 480c7ae.

📒 Files selected for processing (4)
  • src/backend/tests/unit/components/bundles/composio/test_schema_utils.py
  • src/lfx/src/lfx/base/composio/composio_base.py
  • src/lfx/src/lfx/base/composio/schema_utils.py
  • src/lfx/src/lfx/components/composio/composio_api.py

Comment thread src/lfx/src/lfx/base/composio/schema_utils.py Outdated
Comment thread src/lfx/src/lfx/base/composio/schema_utils.py Outdated
@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels May 23, 2026
@gingeekrishna gingeekrishna changed the title fix(langflow): resolve #13231 by correcting Composio tool schema type… fix(langflow): resolve #13231 by correcting Composio tool schema type normalization May 23, 2026
@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels May 23, 2026
@gingeekrishna
gingeekrishna requested a review from Copilot May 23, 2026 16:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

Comment thread src/lfx/src/lfx/base/composio/schema_utils.py Outdated
Comment thread src/lfx/src/lfx/components/composio/composio_api.py Outdated
Comment thread src/lfx/src/lfx/base/composio/composio_base.py Outdated
Comment thread src/lfx/src/lfx/base/composio/schema_utils.py
@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels May 23, 2026
@gingeekrishna
gingeekrishna requested a review from Copilot May 23, 2026 17:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

Comment thread src/lfx/src/lfx/base/composio/schema_utils.py Outdated
Comment thread src/lfx/src/lfx/components/composio/composio_api.py Outdated
Comment thread src/lfx/src/lfx/components/composio/composio_api.py Outdated
@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels May 23, 2026
@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels May 23, 2026
@gingeekrishna
gingeekrishna requested a review from Copilot May 23, 2026 18:19
@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels May 23, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

Comment on lines +24 to +39
for union_key in ("anyOf", "oneOf", "allOf"):
variants = schema.get(union_key)
if isinstance(variants, list):
non_null_type: str | None = None
has_null_variant = False
for variant in variants:
if not isinstance(variant, dict):
continue
variant_type = variant.get("type")
if isinstance(variant_type, str):
if variant_type == "null":
has_null_variant = True
elif non_null_type is None:
non_null_type = variant_type
if non_null_type is not None:
return [non_null_type, "null"] if has_null_variant else non_null_type
Comment on lines +56 to +62
def _needs_schema_sanitization(schema: dict[str, Any]) -> bool:
"""Check if a JSON schema needs sanitization (read-only traversal)."""
if "type" not in schema or schema["type"] is None:
return True

if schema.get("type") == "object" and "properties" in schema and schema["properties"] is None:
return True
},
args_schema=None,
)

Comment thread src/lfx/src/lfx/base/composio/composio_base.py Outdated
@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels May 23, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

Comment on lines +59 to +69
enum_values = schema.get("enum")
if isinstance(enum_values, list) and enum_values:
first = enum_values[0]
if isinstance(first, bool):
return "boolean"
if isinstance(first, int):
return "integer"
if isinstance(first, float):
return "number"
if isinstance(first, str):
return "string"
Comment thread src/lfx/src/lfx/base/composio/schema_utils.py Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

Comment thread src/lfx/src/lfx/base/composio/schema_utils.py Outdated
Comment thread src/lfx/src/lfx/base/composio/schema_utils.py Outdated
Comment thread src/lfx/src/lfx/components/composio/composio_api.py Outdated
Comment thread src/lfx/src/lfx/base/composio/schema_utils.py Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

Comment thread src/lfx/src/lfx/base/composio/schema_utils.py
Comment thread src/lfx/src/lfx/base/composio/schema_utils.py
Comment thread src/lfx/src/lfx/base/composio/schema_utils.py

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Comment on lines +26 to +59
for union_key in ("anyOf", "oneOf"):
variants = schema.get(union_key)
if isinstance(variants, list):
concrete_types: list[str] = []
has_null_variant = False
for variant in variants:
if not isinstance(variant, dict):
continue
variant_type = variant.get("type")
if isinstance(variant_type, str):
if variant_type == "null":
has_null_variant = True
elif variant_type not in concrete_types:
concrete_types.append(variant_type)
elif isinstance(variant_type, list):
for t in variant_type:
if isinstance(t, str):
if t == "null":
has_null_variant = True
elif t not in concrete_types:
concrete_types.append(t)
else:
# No explicit type — infer from the variant's structure so that,
# e.g., enum-only variants like {"enum": ["a","b"]} are not
# silently treated as missing a concrete type.
inferred = _infer_schema_type(variant)
for t in [inferred] if isinstance(inferred, str) else inferred:
if t == "null":
has_null_variant = True
elif t not in concrete_types:
concrete_types.append(t)
if concrete_types:
result: list[str] = concrete_types + (["null"] if has_null_variant else [])
return result[0] if len(result) == 1 else result
Comment on lines +215 to +224
raw_schema = args_schema.model_json_schema()
if not isinstance(raw_schema, dict):
return changed

schema_copy = deepcopy(raw_schema)
schema_changed = _sanitize_schema_in_place(schema_copy)
if schema_changed:
tool.args_schema = create_input_schema_from_json_schema(schema_copy)
changed = True
return changed
Comment thread .github/workflows/typescript_test.yml Outdated
Comment on lines +357 to +359
echo "npx playwright test ${{ inputs.tests_folder }} ${{ needs.determine-test-suite.outputs.test_grep }} --trace on --shard ${{ matrix.shardIndex }}/${{ matrix.shardTotal }} --workers 2 --pass-with-no-tests --retries=3"

npx playwright test ${{ inputs.tests_folder }} ${{ needs.determine-test-suite.outputs.test_grep }} --trace on --shard ${{ matrix.shardIndex }}/${{ matrix.shardTotal }} --workers 2 --retries=3
npx playwright test ${{ inputs.tests_folder }} ${{ needs.determine-test-suite.outputs.test_grep }} --trace on --shard ${{ matrix.shardIndex }}/${{ matrix.shardTotal }} --workers 2 --pass-with-no-tests --retries=3

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Comment thread src/lfx/src/lfx/base/composio/schema_utils.py
Comment thread src/lfx/src/lfx/base/composio/schema_utils.py
Comment thread .github/workflows/py_autofix.yml Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Comment thread src/lfx/src/lfx/base/composio/schema_utils.py Outdated
Comment thread .github/workflows/typescript_test.yml Outdated
Comment thread src/lfx/src/lfx/base/composio/schema_utils.py Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Comment thread .github/workflows/typescript_test.yml Outdated
Comment thread .github/workflows/typescript_test.yml Outdated
Comment thread .github/workflows/typescript_test.yml Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.

Comment thread .github/workflows/typescript_test.yml
Comment thread .github/workflows/typescript_test.yml
Comment thread src/lfx/src/lfx/base/composio/composio_base.py Outdated
Comment thread src/lfx/src/lfx/base/composio/schema_utils.py

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Comment thread src/lfx/src/lfx/base/composio/composio_base.py
Comment thread src/lfx/src/lfx/base/composio/schema_utils.py

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.

Comment on lines +2357 to +2361
tools = list(composio.tools.get(user_id=self.entity_id, toolkits=[self.app_name.lower()], limit=limit))
sanitized_tools, excluded_summary = sanitize_tools_with_fallback(tools, logger.debug)
failure_count = len(tools) - len(sanitized_tools)
configured_tools = []
for tool in tools:
for tool in sanitized_tools:
Comment on lines +2370 to +2375
if failure_count > 0:
logger.warning(
"Excluded %d tool(s) due to args schema sanitization failures: %s",
failure_count,
excluded_summary,
)
Comment thread .github/workflows/typescript_test.yml Outdated
# Join tags with | for OR logic
REGEX_PATTERN=$(IFS='|'; echo "${TAGS[*]}")
TEST_GREP='--grep="${REGEX_PATTERN}"'
TEST_GREP="--grep \"${REGEX_PATTERN}\""
Comment thread .github/workflows/typescript_test.yml Outdated
Comment on lines +356 to +364
PASS_WITH_NO_TESTS=""
if [ "${{ matrix.shardTotal }}" -gt 1 ]; then
PASS_WITH_NO_TESTS="--pass-with-no-tests"
fi

# Echo command before running for easier debugging.
echo "npx playwright test ${{ inputs.tests_folder }} ${{ needs.determine-test-suite.outputs.test_grep }} --trace on --shard ${{ matrix.shardIndex }}/${{ matrix.shardTotal }} --workers 2 ${PASS_WITH_NO_TESTS} --retries=3"

npx playwright test ${{ inputs.tests_folder }} ${{ needs.determine-test-suite.outputs.test_grep }} --trace on --shard ${{ matrix.shardIndex }}/${{ matrix.shardTotal }} --workers 2 --retries=3
npx playwright test ${{ inputs.tests_folder }} ${{ needs.determine-test-suite.outputs.test_grep }} --trace on --shard ${{ matrix.shardIndex }}/${{ matrix.shardTotal }} --workers 2 ${PASS_WITH_NO_TESTS} --retries=3

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Comment thread .github/workflows/typescript_test.yml Outdated
Comment thread src/lfx/src/lfx/base/composio/schema_utils.py

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Comment thread src/lfx/src/lfx/base/composio/schema_utils.py
Comment on lines +164 to +172
properties = schema.get("properties")
if isinstance(properties, dict):
for prop_schema in properties.values():
if isinstance(prop_schema, dict) and _needs_schema_sanitization(prop_schema):
return True

items = schema.get("items")
if isinstance(items, dict) and _needs_schema_sanitization(items):
return True
Comment thread .github/workflows/typescript_test.yml

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Comment thread .github/workflows/typescript_test.yml Outdated
Comment thread src/lfx/src/lfx/base/composio/composio_base.py
@gingeekrishna

gingeekrishna commented May 31, 2026

Copy link
Copy Markdown
Contributor Author

CI Failure Note: test_vector_store_rag is a pre-existing issue

The current failing check Run Backend Tests / Unit Tests - Python 3.14 - Group 2 is unrelated to this PR.

Failing test: src/backend/tests/unit/initial_setup/starter_projects/test_vector_store_rag.py::test_vector_store_rag

Error: ComponentBuildError: Error building Component OpenAI Embeddings: Missing credentials ... set the OPENAI_API_KEY or OPENAI_ADMIN_KEY environment variable

Why it's not caused by this PR:

  • This file has zero diff against main — we never touched it.
  • The test sets openai_api_key="sk-123" as a fake key, but the OpenAI SDK still requires OPENAI_API_KEY to be set as an environment variable, which is not available in fork PR CI runs (GitHub does not pass secrets to fork PRs).
  • This failure was already present in earlier CI runs of this PR, but was hidden because Group 2 was being cancelled when our own Group 5 test failed first. After fixing the Group 5 failure, Group 2 now runs to completion and surfaces this pre-existing issue.

gingeekrishna and others added 3 commits June 11, 2026 16:06
…schema type normalization

Adds schema_utils.py with sanitize_tool_args_schema / sanitize_tools_with_fallback
helpers that infer missing JSON Schema 'type' fields for Composio tool arguments.
Tools that fail sanitization are excluded and logged rather than crashing tool loading.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants