Skip to content

Feat/agentflow Support for Additional Load Methods#6003

Merged
j-sanaa merged 5 commits intomainfrom
feat/agentflow-additional-async-support-clean
Mar 17, 2026
Merged

Feat/agentflow Support for Additional Load Methods#6003
j-sanaa merged 5 commits intomainfrom
feat/agentflow-additional-async-support-clean

Conversation

@j-sanaa
Copy link
Copy Markdown
Contributor

@j-sanaa j-sanaa commented Mar 17, 2026

FLOWISE-266

  • Fixed itemKeys generation for MessagesInput, ConditionBuilder, ArrayInput and StructuredOutputBuilder
  • Added support for listActions and listTables
  • Added a generic fallback method for loadMethods that have not been registered
image image

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the Agentflow UI by improving the stability of dynamic list rendering in several key components through the introduction of a new useStableKeys React hook. Concurrently, it expands the system's backend capabilities by adding listActions and listTables methods to the loadMethodRegistry, allowing for more dynamic and context-aware data fetching for node configurations.

Highlights

  • Improved UI Component Stability: Refactored item key generation in ArrayInput, ConditionBuilder, MessagesInput, and StructuredOutputBuilder components to utilize a new useStableKeys custom React hook. This change ensures more stable and correct rendering of dynamic lists by providing persistent keys, preventing issues related to index-based keys.
  • Extended Dynamic Data Loading Capabilities: Added support for listActions and listTables methods within the loadMethodRegistry. These new methods enable dynamic retrieval of actions for specific nodes (e.g., Composio) and tables for storage nodes (e.g., AWS DynamoDB), enhancing the flexibility of the agentflow system.
Changelog
  • packages/agentflow/src/atoms/ArrayInput.tsx
    • Removed internal state and refs for managing item keys.
    • Integrated the new useStableKeys hook for stable item key generation.
    • Updated item deletion logic to use the removeKey function from the useStableKeys hook.
  • packages/agentflow/src/atoms/ConditionBuilder.tsx
    • Removed internal state and refs for managing item keys.
    • Integrated the new useStableKeys hook for stable item key generation.
    • Updated item deletion logic to use the removeKey function from the useStableKeys hook.
    • Modified JSX key attribute to use effectiveKeys from the new hook.
  • packages/agentflow/src/atoms/MessagesInput.tsx
    • Removed internal state and refs for managing item keys.
    • Integrated the new useStableKeys hook for stable item key generation.
    • Updated content change, message deletion, and expand dialog confirmation logic to use effectiveKeys and removeKey from the useStableKeys hook.
    • Modified JSX key attribute to use effectiveKeys from the new hook.
  • packages/agentflow/src/atoms/StructuredOutputBuilder.tsx
    • Removed internal state and refs for managing item keys.
    • Integrated the new useStableKeys hook for stable item key generation.
    • Updated entry deletion logic to use the removeKey function from the useStableKeys hook.
    • Modified JSX key attribute to use effectiveKeys from the new hook.
  • packages/agentflow/src/atoms/useStableKeys.ts
    • Added a new custom React hook useStableKeys to provide stable, unique keys for dynamic lists, managing key generation, growth, and removal.
  • packages/agentflow/src/infrastructure/api/loadMethodRegistry.test.ts
    • Added comprehensive unit tests for the new listActions method, covering various input scenarios and error handling.
    • Added comprehensive unit tests for the new listTables method, covering various input scenarios and error handling.
  • packages/agentflow/src/infrastructure/api/loadMethodRegistry.ts
    • Updated documentation to include descriptions for the new listActions and listTables methods.
    • Implemented the listActions method to dynamically fetch actions for a given node.
    • Implemented the listTables method to dynamically fetch tables for a given node.
Activity
  • No human activity has been recorded on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a useStableKeys hook to centralize logic for managing stable keys in array-based inputs, which is a great refactoring. It also adds support for listActions and listTables load methods.

My main concern is a critical bug in the implementation of useStableKeys that breaks key stability on deletion. I've left a specific comment with details. Once that is addressed, this PR will be a solid improvement.

@j-sanaa
Copy link
Copy Markdown
Contributor Author

j-sanaa commented Mar 17, 2026

/gemini review

@j-sanaa j-sanaa requested a review from jocelynlin-wd March 17, 2026 22:41
@j-sanaa j-sanaa marked this pull request as ready for review March 17, 2026 22:42
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces two main improvements. First, it refactors the logic for generating stable keys for array-based inputs into a new useStableKeys custom hook. This is an excellent change that centralizes duplicated logic from ArrayInput, ConditionBuilder, MessagesInput, and StructuredOutputBuilder, significantly improving code reuse and maintainability. Second, it adds support for new loadMethods (listActions and listTables) and enhances getLoadMethod with a generic fallback for unregistered methods, making the system more flexible. My review includes a suggestion to further simplify the loadMethodRegistry by leveraging this new generic fallback to remove what are now redundant handlers. This specific comment aligns with general best practices for code maintainability and conciseness and does not contradict any of the provided rules.

Copy link
Copy Markdown
Contributor

@jocelynlin-wd jocelynlin-wd left a comment

Choose a reason for hiding this comment

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

lgtm, no blockers

@j-sanaa j-sanaa merged commit 07e7604 into main Mar 17, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants