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

This commit is contained in:
thanhnv
2026-09-05 09:23:45 +09:00
parent 86c27e2e79
commit 3bd58b4ecb
13 changed files with 2846 additions and 25 deletions
+17
View File
@@ -62,6 +62,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]]