Skip to content

Comments

feat(dir/importer): rate limiting, debug dry-run and clear session#888

Merged
paralta merged 5 commits intomainfrom
refactor/importer-reliability
Feb 3, 2026
Merged

feat(dir/importer): rate limiting, debug dry-run and clear session#888
paralta merged 5 commits intomainfrom
refactor/importer-reliability

Conversation

@paralta
Copy link
Member

@paralta paralta commented Jan 30, 2026

This PR improves the reliability and debuggability of the importer by adding rate limiting for LLM API calls and enhancing dry-run mode to output transformed records.

Changes

  • Add rate limiting for LLM API calls to avoid provider rate limit errors (default: 10 requests/minute, configurable via --enrich-rate-limit flag)
  • Enhance dry-run mode to save transformed records to a timestamped JSONL file (import-dry-<timestamp>-run.jsonl)
  • Add max-steps parameter to MCPHost model configuration to prevent runaway LLM invocations
  • Clear MCPHost session after each prompt to prevent context accumulation (fixes 128k token limit errors when processing many records)

Testing
Tested successfully with bin/dirctl import --type=mcp --url=https://registry.modelcontextprotocol.io/v0.1 --dry-run --limit 100 --enrich-rate-limit=2

Signed-off-by: Catarina Paralta <clouropa@cisco.com>
@paralta paralta requested a review from a team as a code owner January 30, 2026 14:27
@github-actions
Copy link
Contributor

github-actions bot commented Jan 30, 2026

The latest Buf updates on your PR. Results from workflow Buf CI / verify-proto (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed⏩ skipped⏩ skipped✅ passedFeb 2, 2026, 5:16 PM

@github-actions github-actions bot added the size/S Denotes a PR that changes 50-199 lines label Jan 30, 2026
Signed-off-by: Catarina Paralta <clouropa@cisco.com>
@paralta paralta force-pushed the refactor/importer-reliability branch from 0b6c239 to 1d3975b Compare January 30, 2026 14:29
@paralta paralta changed the title feat(dir/importer): importer improvements feat(dir/importer): improvements Jan 30, 2026
…to a file

Signed-off-by: Catarina Paralta <clouropa@cisco.com>
…ing import

Signed-off-by: Catarina Paralta <clouropa@cisco.com>
…umulation

Signed-off-by: Catarina Paralta <clouropa@cisco.com>
@paralta paralta changed the title feat(dir/importer): improvements feat(dir/importer): rate limiting, debug dry-run and clear session Feb 3, 2026
@paralta paralta requested a review from akijakya February 3, 2026 09:11
@paralta paralta merged commit d7681e1 into main Feb 3, 2026
38 checks passed
@paralta paralta deleted the refactor/importer-reliability branch February 3, 2026 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/S Denotes a PR that changes 50-199 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants