chore: updataed for connected-tools new field#884
Open
Anushtha-Rathore wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Other comments (11)
- src/controllers/agentConfig.controller.js (422-422) You're using MongoDB's dot notation (`update_fields["connected_tools.variables_path"]`) for updating nested fields, but this is inconsistent with how you're updating the entire `connected_tools` object elsewhere. This could lead to conflicts if both updates happen. Consider consolidating these updates into the merged_connected_tools object instead.
- src/controllers/template.controller.js (90-92) This PR moves several fields under a new `connected_tools` object, but there's no clear migration strategy for existing data. Consider adding a migration script or ensuring backward compatibility for agents created before this change.
- src/db_services/agentVersion.service.js (433-435) The code is being updated to use `connected_tools.function_ids` instead of `function_ids`, but there's no migration path for existing data. Consider adding a migration script or ensuring backward compatibility by checking both locations in all relevant functions.
- src/controllers/template.controller.js (221-223) Several fields were removed from `template_fields` array (variables_state, built_in_tools, variables_path) without explanation. If these fields contained important data, this change could lead to data loss when creating agents from templates.
-
src/db_services/configuration.service.js (1066-1066)
There's an inconsistency in how function_ids_for_lookup is handled. In line 1066 it's used directly as a string literal, but in line 703 it's wrapped with $ifNull. For consistency, line 1066 should also use $ifNull:
input: { $ifNull: ["$function_ids_for_lookup", []] }, -
src/db_services/agentVersion.service.js (168-170)
There's an inconsistency in how you're checking for the existence of connected agents. On line 168, you check if `"connected_tools.connected_agents"` exists, but on line 170 you use optional chaining `agent.connected_tools?.connected_agents`. For consistency, you should either:
- Check for existence of
connected_toolsfirst:{ org_id, connected_tools: { $exists: true } } - Or use dot notation in the assignment:
const connectedAgents = (agent.connected_tools && agent.connected_tools.connected_agents) || {}
- Check for existence of
- src/db_services/configuration.service.js (1185-1190) This code is duplicating data by setting both agent.function_ids and agent.connected_tools.function_ids. Since you're migrating to the connected_tools structure, consider removing this duplication to avoid confusion about which field should be used.
- src/db_services/agentVersion.service.js (189-191) Similar to the issue above, there's an inconsistency between how you check for existence of connected agents in versions. You should use the same approach for consistency.
- src/db_services/apiCall.service.js (99-103) While updating the path for `function_ids` to be under `connected_tools`, consider adding a check for documents that might still have the old structure. This could prevent potential issues if some documents haven't been migrated yet. You might want to include a migration script or handle both structures during a transition period.
- src/controllers/agentConfig.controller.js (268-275) The PR title contains a typo: 'chore: updataed for connected-tools new field' should be 'chore: updated for connected-tools new field'
- src/controllers/template.controller.js (90-90) The PR title contains a typo: 'updataed' should be 'updated'.
💡 To request another review, post a new comment with "/windsurf-review".
db777f6 to
a0c16bd
Compare
Natwar589
reviewed
Apr 6, 2026
a0c16bd to
f1a3f46
Compare
Collaborator
|
Your card was not found on the dbdash with the branch connected-tools-field-updateasa |
f1a3f46 to
ceb93ac
Compare
Collaborator
|
Your card was not found on the dbdash with the branch connected-tools-field-updateasa |
Natwar589
reviewed
Apr 6, 2026
Natwar589
reviewed
Apr 6, 2026
Natwar589
reviewed
Apr 6, 2026
Collaborator
|
Your card was not found on the dbdash with the branch connected-tools-field-updateasa |
1 similar comment
Collaborator
|
Your card was not found on the dbdash with the branch connected-tools-field-updateasa |
…with MongoDB migration and controller updates
2ff7f03 to
32cd171
Compare
Collaborator
|
Your card was not found on the dbdash with the branch connected-tools-field-updateasa |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
merge d firelds under connected tools