feat: add an option to use custom creds for toolkits with Composio managed auth.#10229
Conversation
…ug fixes and improved DX
|
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 predefined hidden auth placeholders to the base schema, consolidates toolkit schema retrieval, and expands auth-mode handling. Introduces helpers for inserting fields before action buttons, clearing/hiding dynamic auth fields, and tracking auth field names. Refactors text-field creation and custom auth rendering. Updates build-config logic for connected states and auth-mode pill UI. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant UI as Component UI
participant Comp as ComposioBaseComponent
participant TK as Toolkit Schema
participant Auth as Auth State
User->>UI: Open/Configure tool
UI->>Comp: build_config update
Comp->>TK: get(slug=app_slug)
TK-->>Comp: toolkit schema (auth fields, modes)
Comp->>Comp: collect auth field names / insert placeholders
alt Managed auth available
Comp->>Comp: prepend "Composio_Managed" mode
end
alt Not connected
Comp->>UI: render auth fields before action_button
else Connected
Comp->>UI: convert auth_mode dropdown -> pill
Comp->>Comp: clear/hide dynamic auth fields
end
User->>UI: Change auth mode / connect
UI->>Comp: state change
Comp->>Comp: reset/rehydrate visibility and values
Comp->>UI: updated field ordering and visibility
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 error, 2 warnings)
✅ 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/lfx/src/lfx/base/composio/composio_base.py(17 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/lfx/src/lfx/base/composio/composio_base.py (3)
src/lfx/src/lfx/inputs/inputs.py (3)
SecretStrInput(286-341)StrInput(126-182)TabInput(547-577)src/lfx/src/lfx/inputs/input_mixin.py (1)
to_dict(100-101)src/lfx/src/lfx/components/agents/agent.py (1)
update_input_types(467-475)
⏰ 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). (1)
- GitHub Check: Update Starter Projects
| def process_fields(field_list: list, *, required: bool) -> None: | ||
| for field in field_list: | ||
| name = field.get("name") | ||
| if not name: | ||
| continue | ||
| # Skip Access Token field (bearer_token) | ||
| if name == "bearer_token": | ||
| continue | ||
| # Skip fields with default values for both required and optional fields | ||
| default_val = field.get("default") | ||
| if default_val is not None: | ||
| continue | ||
| disp = field.get("display_name") or field.get("displayName") or name | ||
| desc = field.get("description") | ||
| self._add_text_field(build_config, name, disp, desc, required=required, default_value=default_val) |
There was a problem hiding this comment.
Don't drop schema fields just because they define defaults.
process_fields exits early for every entry where the schema provides a default, so any credential whose schema ships with a placeholder (many Composio toolkits set required fields to "" or preset URLs) never renders. That breaks the new “custom creds” flow because the user cannot override those values, nor satisfy required fields. Show the field and pass the default through instead of skipping it.
- default_val = field.get("default")
- if default_val is not None:
- continue
+ default_val = field.get("default")📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| def process_fields(field_list: list, *, required: bool) -> None: | |
| for field in field_list: | |
| name = field.get("name") | |
| if not name: | |
| continue | |
| # Skip Access Token field (bearer_token) | |
| if name == "bearer_token": | |
| continue | |
| # Skip fields with default values for both required and optional fields | |
| default_val = field.get("default") | |
| if default_val is not None: | |
| continue | |
| disp = field.get("display_name") or field.get("displayName") or name | |
| desc = field.get("description") | |
| self._add_text_field(build_config, name, disp, desc, required=required, default_value=default_val) | |
| def process_fields(field_list: list, *, required: bool) -> None: | |
| for field in field_list: | |
| name = field.get("name") | |
| if not name: | |
| continue | |
| # Skip Access Token field (bearer_token) | |
| if name == "bearer_token": | |
| continue | |
| # Skip fields with default values for both required and optional fields | |
| - default_val = field.get("default") | |
| - if default_val is not None: | |
| default_val = field.get("default") | |
| disp = field.get("display_name") or field.get("displayName") or name | |
| desc = field.get("description") | |
| self._add_text_field(build_config, name, disp, desc, required=required, default_value=default_val) |
🤖 Prompt for AI Agents
In src/lfx/src/lfx/base/composio/composio_base.py around lines 1331 to 1345, the
current logic skips any schema field that has a default value which causes
fields with placeholders to never render; instead, remove the early "continue"
for default_val and always call self._add_text_field for the field (except when
name is missing or name == "bearer_token"), passing default_val through as the
default_value argument so the UI shows the field and pre-populates the provided
default while still allowing the user to override it.
|
@Uday-sidagana Please fix the conflicts. |
|
…naged auth. (#10229) feat: add cutom fields for toolkits with Composio managed and minor bug fixes and improved DX Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
…naged auth. (langflow-ai#10229) feat: add cutom fields for toolkits with Composio managed and minor bug fixes and improved DX Co-authored-by: Edwin Jose <edwin.jose@datastax.com>



The PR includes updated base component and minor bug fixes:
— Custom credentials option added for toolkits with composition-managed authentication. Fixed persistent authentication fields after connection in Tool mode.
Backend changes:
src/lfx/src/lfx/base/composio/composio_base.pySummary by CodeRabbit
New Features
Improvements
Refactor