-
Notifications
You must be signed in to change notification settings - Fork 28k
refactor: Simplify agent request store #15743
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
refactor: Simplify agent request store #15743
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cubic found 2 issues across 7 files. Review them in cubic.dev
React with 👍 or 👎 to teach cubic. Tag @cubic-dev-ai
to give specific feedback.
fix(editor): Simplify agentRequest store
d577967
to
c4510f2
Compare
Codecov ReportAttention: Patch coverage is
📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! Code looks much more clear now. I had only one small question/comment, feel free to merge as is if it's not relevant.
}; | ||
}; | ||
|
||
const clearAgentRequests = (workflowId: string, nodeId: string): void => { | ||
if (agentRequests.value[workflowId]) { | ||
agentRequests.value[workflowId][nodeId] = {}; | ||
agentRequests.value[workflowId][nodeId] = { query: {} }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we just delete it instead of setting to empty content here? And maybe even delete agentRequests.value[workflowId]
as well if it was the last key?
Workflow Test Results 📊
|
Workflow ID | Workflow Name | Reason |
---|---|---|
237 | BasicLLMChain:AzureChat | Workflow contains new data that previously did not exist. |
35 | Slack:User:getPresence info:UserProfile:get update... | Workflow contains new data that previously did not exist. |
257 | Agent:auto-fix:anthropic | Workflow contains new data that previously did not exist. |
53 | ConvertKit:CustomField:create getAll update delete... | Workflow contains new data that previously did not exist. |
|
…llution-vulnerability-detected
Summary
This PR simplifies the agent request store and removes unneeded code. The store is now more focused on its intend and doesn't need complex logic to build the object that's being sent to the backend. It is making now use of
useLocalStorage
instead of handling that inside the store and naming of functions have been adjusted. This should also address a potential security vulnerability caused by the old handling.Related Linear tickets, Github issues, and Community forum posts
https://linear.app/n8n/issue/AI-950/prototype-pollution-vulnerability-detected
Review / Merge checklist
release/backport
(if the PR is an urgent fix that needs to be backported)