feat(mcp): add project issue context and knowledge search
CI / test (push) Canceled after 0s
CI / test (pull_request) Canceled after 0s

This commit was merged in pull request #6.
This commit is contained in:
thanhnv
2026-09-05 09:32:08 +09:00
parent f9f6bc01fd
commit e5fa21ecfd
13 changed files with 2883 additions and 26 deletions
+17
View File
@@ -85,6 +85,23 @@ class ProviderError(RuntimeError):
self.retryable = retryable
def decode_offset_cursor(cursor: str | None) -> int:
"""Shared opaque-cursor decoding for every paginated provider.
Rejected before any backend call so an invalid cursor never costs an
upstream request.
"""
if cursor is None:
return 0
try:
offset = int(cursor)
except ValueError as exc:
raise ProviderError("INVALID_INPUT", "cursor is not valid.", retryable=False) from exc
if offset < 0:
raise ProviderError("INVALID_INPUT", "cursor is not valid.", retryable=False)
return offset
ToolHandler = Callable[[ContractModel, Any], dict[str, Any]]