Skip to content

feat(agent): add clarification extensibility hook#33452

Open
Haohao-end wants to merge 4 commits intolanggenius:mainfrom
Haohao-end:feat/33401-agent-node-hitl-clean
Open

feat(agent): add clarification extensibility hook#33452
Haohao-end wants to merge 4 commits intolanggenius:mainfrom
Haohao-end:feat/33401-agent-node-hitl-clean

Conversation

@Haohao-end
Copy link
Contributor

Summary

This PR adds a minimal extensibility hook for future human-in-the-loop clarification support in Agent nodes.

What is included

  • add enable_human_clarification to agent node data/schema
  • expose the config in the agent node panel
  • add en-US i18n text for the new config
  • add a lightweight clarification helper module for future extension
  • add unit tests for clarification helper/config behavior

What is intentionally NOT included

  • no new pause reason type
  • no workflow pause/resume integration
  • no persistence/model/repository changes
  • no clarification form UI
  • no full HITL execution flow

Why this scope

The latest workflow refactor changed the internal structure of the agent node, so this PR keeps the scope intentionally small and non-breaking.

This version focuses on configuration infrastructure and extension points only, which makes it easier to review and safer to merge as a first step.

Notes

  • default behavior is unchanged
  • the new config is off by default
  • the current extensibility hook is a no-op placeholder for future HITL work

Test

Intended test target:

python -m pytest api/tests/unit_tests/core/workflow/nodes/agent/test_clarification_helper.py -v

In the current local environment, full test execution is still blocked by missing project dependencies.

@github-actions github-actions bot added the web This relates to changes on the web. label Mar 14, 2026
@gemini-code-assist
Copy link
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 establishes a foundational extensibility hook for future human-in-the-loop (HITL) clarification capabilities within agent nodes. It introduces a new configuration option to enable human clarification, integrates it into the agent node's data schema and UI, and provides a lightweight, placeholder module for the clarification logic. The scope is intentionally minimal to ensure non-breaking changes and ease of integration following recent workflow refactors, setting the stage for more comprehensive HITL features later.

Highlights

  • Configuration: Introduced enable_human_clarification configuration to agent node data, allowing future human-in-the-loop support.
  • User Interface: Exposed the new enable_human_clarification configuration option in the agent node's UI panel for user control.
  • Internationalization: Added internationalization (i18n) text for the new human clarification setting in the UI.
  • Extensibility Hook: Created a new clarification_helper.py module and integrated a conditional no-op placeholder in agent_node.py to serve as an extensibility hook for future human-in-the-loop (HITL) clarification logic.
  • Testing: Implemented unit tests to verify the behavior of the clarification helper functions and the new configuration field in AgentNodeData.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • api/core/workflow/nodes/agent/agent_node.py
    • Imported should_enable_clarification from the new helper module.
    • Added a conditional no-op placeholder for future clarification logic within the _run method.
  • api/core/workflow/nodes/agent/clarification_helper.py
    • Added a new module containing should_enable_clarification and extract_clarification_request functions, serving as placeholders for future HITL implementation.
  • api/core/workflow/nodes/agent/entities.py
    • Added enable_human_clarification: bool = False to the AgentNodeData Pydantic model.
  • api/tests/unit_tests/core/workflow/nodes/agent/test_clarification_helper.py
    • Added a new test file with unit tests for should_enable_clarification, extract_clarification_request, and the enable_human_clarification field in AgentNodeData.
  • web/app/components/workflow/nodes/agent/panel.tsx
    • Imported FormInputBoolean component.
    • Integrated a new FormInputBoolean field into the Agent panel to control the enable_human_clarification setting.
  • web/app/components/workflow/nodes/agent/types.ts
    • Added enable_human_clarification?: boolean to the AgentNodeType TypeScript type definition.
  • web/i18n/en-US/workflow.json
    • Added new internationalization keys for the "Enable Human Clarification" label and its tooltip.
Activity
  • The author has provided a detailed summary of included and intentionally excluded items, outlining the PR's focused scope.
  • Unit tests for the clarification helper and configuration behavior have been added.
  • Full test execution in the local environment is currently blocked by missing project dependencies.
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.

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. 💪 enhancement New feature or request 🤖 feat:agent Agent related topics labels Mar 14, 2026
@github-actions
Copy link
Contributor

Pyrefly Diff

No changes detected.

Copy link
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 foundational extensibility hook for future human-in-the-loop (HITL) clarification support in agent nodes. The changes are well-scoped and non-breaking, adding the necessary configuration options, UI elements, and placeholder logic without implementing the full feature. The new code is accompanied by unit tests. My review includes a couple of suggestions to improve code clarity and test maintainability.

@github-actions
Copy link
Contributor

Pyrefly Diff

No changes detected.

@Haohao-end Haohao-end changed the title Add clarification extensibility hook for agent nodes feat(agent): add human clarification extensibility hook Mar 14, 2026
@Haohao-end Haohao-end changed the title feat(agent): add human clarification extensibility hook feat(agent): add clarification extensibility hook Mar 15, 2026
@github-actions
Copy link
Contributor

Pyrefly Diff

No changes detected.

@github-actions
Copy link
Contributor

Pyrefly Diff

No changes detected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💪 enhancement New feature or request 🤖 feat:agent Agent related topics size:L This PR changes 100-499 lines, ignoring generated files. web This relates to changes on the web.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant