fix(ts): restore session.toolkits() pagination and CLI commands#3026
fix(ts): restore session.toolkits() pagination and CLI commands#3026
session.toolkits() pagination and CLI commands#3026Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
The Please review and fix the vulnerabilities. You can try running: pnpm audit --fix --prodAudit output |
- Extract shared timeout-helpers.ts and toolkit-ranking.ts modules - Remove limits.ts re-export indirection; import clamp-limit directly - Simplify info command: replace triple-nested Effect.raceFirst with flat Effect.all - Reduce timeout constants (60s→10s, 45s→10s, 30s→8s, 15s→5s) - Cap session-fallback pagination loop at 10 pages - Add jitter to transient HTTP retry delays - Fix searchToolkitsWithFallback return type that broke CI typecheck - Replace mutable let variables with const in list command - Add top-level SessionToolkitsResponse type import - Document intentional DateTimeUtc cast in toolkitFromSession
The refactored list command now tries an exact detailed lookup before falling back to the search endpoint, so the E2E test assertion must check for the detailed request path.
The triggers list command requires a positional toolkit argument. Without it, @effect/cli fails on argument parsing before reaching validateLimit, producing a non-Error object that breaks the assertion.
- Fix falsy `!nextDelay` check to `nextDelay === undefined` in retry logic - Compute jitter per-call instead of once at module load - Remove `.strict()` from ToolRouterToolkitsOptionsSchema (breaking change) - Extract shared `getExactToolkitMatch` to toolkit-ranking.ts - Use shared `rankToolkit` for `hasPreciseMatch` in list command - Let semantic errors (InvalidToolkitsError) propagate in getToolkitsBySlugs - Restore `concurrency: 'unbounded'` in ts.generate.cmd.ts - Remove unused toolkitFromDetailed imports from command files
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit bb19d37. Configure here.
| */ | ||
| export const rankToolkit = (toolkit: Toolkit, query: string): number | undefined => { | ||
| const normalizedQuery = query.trim().toLowerCase(); | ||
| if (!normalizedQuery) return 0; |
There was a problem hiding this comment.
Empty query yields best match rank in rankToolkit
Low Severity
rankToolkit returns 0 (the best possible rank, same as an exact slug match) when normalizedQuery is empty after trimming. This affects callers like getCatalogToolkitsWithFallback which checks rankToolkit(toolkit, query) to determine hasPreciseMatch — a whitespace-only --query " " would cause every toolkit to be ranked as an exact match, bypassing the broader catalog fallback and producing incorrect search behavior.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit bb19d37. Configure here.
| () => [] as { label: string; command: string }[] | ||
| ) | ||
| .map(s => ` ${s.label}`) | ||
| .join('\n'); |
There was a problem hiding this comment.
Suggestions unwrapped from Option redundantly twice
Low Severity
The suggestions Option is unwrapped with Option.getOrElse(suggestions, () => []) on line 241 to destructure first, then a second identical Option.getOrElse call is made on line 246 to build lines. Extracting the unwrapped array into a single local variable would remove the duplication and improve readability.
Reviewed by Cursor Bugbot for commit bb19d37. Configure here.
| "source-map-js": "^1.2.1", | ||
| "superjson": "^2.2.2", | ||
| "ts-morph": "^26.0.0", | ||
| "typescript": "catalog:", |
There was a problem hiding this comment.
Any reason for moving this to dependencies?
|
Deprecated by #3193 |


This PR:
session.toolkits()pagination in@composio/coreby teaching the SDK to acceptcursor,page, andoffsetinstead of silently dropping thempageandoffsetinto the backend cursor format, while keepingnextCursorbackward-compatible and treatingcursoras an aliasoffsetvalues with explicit validation errors