Skip to content

feat(js/ai): expose restartTool/respondTool helper function in addition to tool.respond/restart#5046

Open
pavelgj wants to merge 8 commits intopj/gm-middleware-reflectionfrom
pj/gm-expose-interrupt-respond-restart-hlpers
Open

feat(js/ai): expose restartTool/respondTool helper function in addition to tool.respond/restart#5046
pavelgj wants to merge 8 commits intopj/gm-middleware-reflectionfrom
pj/gm-expose-interrupt-respond-restart-hlpers

Conversation

@pavelgj
Copy link
Copy Markdown
Member

@pavelgj pavelgj commented Apr 1, 2026

No description provided.

@github-actions github-actions bot added the js label Apr 1, 2026
@pavelgj pavelgj changed the title Pj/gm expose interrupt respond restart hlpers eat(js/ai): expose restartTool/respondTool helper function in addition to tool.respond/restart Apr 1, 2026
@pavelgj pavelgj changed the title eat(js/ai): expose restartTool/respondTool helper function in addition to tool.respond/restart feat(js/ai): expose restartTool/respondTool helper function in addition to tool.respond/restart Apr 1, 2026
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 adds restartTool and respondTool utility functions to the js/ai and js/genkit packages. These functions facilitate re-triggering tool requests with updated inputs or providing manual tool responses independently of a ToolAction instance. I have no feedback to provide.

@pavelgj
Copy link
Copy Markdown
Member Author

pavelgj commented Apr 1, 2026

/gemini review

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 respondTool and restartTool as standalone utility functions to handle tool interrupts and restarts, refactoring existing logic in implementTool to use these new helpers. The review feedback identifies several instances where logical OR (||) or simple truthiness checks are used for optional parameters; these should be replaced with nullish coalescing (??) or explicit undefined checks to correctly handle valid falsy values like 0, false, or empty strings.

@pavelgj pavelgj force-pushed the pj/gm-expose-interrupt-respond-restart-hlpers branch from f43948d to 5573649 Compare April 1, 2026 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant