-
Notifications
You must be signed in to change notification settings - Fork 11.7k
Labels
area/coreIssues related to User Interface, OS Support, Core FunctionalityIssues related to User Interface, OS Support, Core Functionalitystatus/need-triageIssues that need to be triaged by the triage automation.Issues that need to be triaged by the triage automation.workstream-rollupLabel used to tag epics and features that are associated with one of the three primary workstreamsLabel used to tag epics and features that are associated with one of the three primary workstreams🔒 maintainer only⛔ Do not contribute. Internal roadmap item.⛔ Do not contribute. Internal roadmap item.
Description
For performance, it's better to create the Set of tool names once at the beginning of the getCoreSystemPrompt method, rather than creating it inside this factory function every time it's called. This also allows you to reuse the Set for other checks.
I suggest adding this at the top of the function:
const enabledToolNames = new Set(toolNames);Then you can use enabledToolNames.has(t) here. This would also be beneficial for the primaryWorkflows section, where toolNames.includes(...) can be replaced with enabledToolNames.has(...) for an O(1) lookup instead of O(n).
planModeToolsList: PLAN_MODE_TOOLS.filter((t) =>
enabledToolNames.has(t),Originally posted by @gemini-code-assist[bot] in #18258 (comment)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area/coreIssues related to User Interface, OS Support, Core FunctionalityIssues related to User Interface, OS Support, Core Functionalitystatus/need-triageIssues that need to be triaged by the triage automation.Issues that need to be triaged by the triage automation.workstream-rollupLabel used to tag epics and features that are associated with one of the three primary workstreamsLabel used to tag epics and features that are associated with one of the three primary workstreams🔒 maintainer only⛔ Do not contribute. Internal roadmap item.⛔ Do not contribute. Internal roadmap item.
Type
Projects
Status
Closed