Skip to content

feat(js/plugins/middleware): implemented filesystem middleware#5051

Merged
pavelgj merged 13 commits intopj/gm-middleware-skillsfrom
pj/gm-middleware-filesystem
Apr 10, 2026
Merged

feat(js/plugins/middleware): implemented filesystem middleware#5051
pavelgj merged 13 commits intopj/gm-middleware-skillsfrom
pj/gm-middleware-filesystem

Conversation

@pavelgj
Copy link
Copy Markdown
Member

@pavelgj pavelgj commented Apr 2, 2026

No description provided.

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 new filesystem middleware for Genkit, providing tools for listing, reading, writing, and editing files within a restricted root directory. The review identified several critical issues regarding concurrency and protocol compliance. Specifically, the use of a shared messageQueue in the middleware factory creates a race condition where messages from different requests could be mixed or lost. Additionally, the error handling in the tool execution hook fails to return a required tool response, which would likely cause API errors in subsequent LLM calls. There is also a bug in the search_and_replace tool where special characters in the replacement string could lead to file corruption; a suggestion was provided to use a replacement function to treat the content as a literal.

@github-actions github-actions bot added docs Improvements or additions to documentation config labels Apr 10, 2026
@pavelgj pavelgj merged commit 01f3878 into pj/gm-middleware-skills Apr 10, 2026
6 checks passed
@pavelgj pavelgj deleted the pj/gm-middleware-filesystem branch April 10, 2026 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

config docs Improvements or additions to documentation js

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants