Home

giogio / openez-graph

public
Overview Code History Branches Pull requestsIssuesInsights
main
HomeOverview Code PRsIssues

fix(context7): add call timeout, negative cache, singleton disposal, stale warn

3 months ago

a1f524f
Authored
asta-nguyen8/5/2026, 6:26:08 AM
- Add 30s timeout (configurable via callTimeoutMs) to callTool() to prevent
  hangs when Context7 subprocess is unresponsive
- Cache negative library resolutions (sentinel empty library_id) with 1-day
  TTL to skip repeated Context7 round-trips for bad library names
- Export disposeSharedClient() and wire to SIGTERM/SIGINT/exit handlers in
  MCP server to prevent orphaned Context7 subprocesses
- Add console.warn when falling back to stale cache for operator visibility
- Remove misleading FetchedDocs.tokens field (always 0; caller computes)

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>

Parentcb25c0d

7 files changed
  • apps/mcp/src/mcp-core.ts+13−0
  • packages/core/src/external-docs/context7-client.ts+27−4
  • packages/core/src/external-docs/docs-cache.ts+17−0
  • packages/core/src/external-docs/index.ts+1−1
  • packages/core/src/external-docs/library-docs.ts+25−0
  • tests/context7-client.test.ts+42−0
  • tests/context7-orchestration.test.ts+52−2