Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
Mirrored from https://github.com/Camo67/composio.git
Synced Nov 22, 08:15 UTC
cli: avoid descriptor traversal cycles
jkomyno committed
Feb 19, 2026 at 11:14 UTC
d72a1f5a4004bd950f1127fb023ee58b2e4b2813
1 file changed
+5
ts/packages/cli/src/bin.ts
+5
@@ -125,7 +125,12 @@ const collectValueOptionNamesFromUsage = (usage: Usage.Usage, acc: Set<string>)
125
126
const valueOptionNames = (() => {
127
const names = new Set<string>();
128
+ const visited = new Set<CommandDescriptor.Command<unknown>>();
129
const visit = (command: CommandDescriptor.Command<unknown>) => {
130
+ if (visited.has(command)) {
131
+ return;
132
+ }
133
+ visited.add(command);
134
collectValueOptionNamesFromUsage(CommandDescriptor.getUsage(command), names);
135
for (const [, subcommand] of HashMap.toEntries(CommandDescriptor.getSubcommands(command))) {
136
visit(subcommand);