You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(grpc): apply non-blocking review nits flagged across the three review passes
Bundle of low-risk, non-blocking improvements that surfaced during the
deep review iterations. Each item below was explicitly classified as
fix-now in the review summary; broader / design-dependent items were
filed as follow-ups under #4612 and #4613.
* Schema parity (#1): add grpc_service_id to ToolRead in schemas.py
alongside the existing gateway_id field so API consumers can identify
gRPC-discovered tools (review S2.4 / TD1).
* db.py cleanup (#2): drop redundant nullable=True from
Tool.grpc_service_id; Mapped[Optional[str]] already implies it and
the sibling gateway_id column omits it (review TD2).
* translate_grpc.load_file_descriptors (#3): widen the parameter type
from List[bytes] to Sequence[bytes] and reject a single bytes object
passed by mistake. Without the guard Python would silently iterate
byte-by-byte (review TD3).
* translate_grpc descriptor pool conflict (#4): replace the inaccurate
'no-op if already added' comment with an explicit TypeError handler.
protobuf raises TypeError when a file with the same name has
conflicting content; the existing descriptor stays authoritative
(review S3.3).
* test_sync_tools_removes_stale_tools (#5): replace the brittle
string-match assertion ('DELETE' in str(call)) with an explicit
call_count == 4 (1 select + 3 deletes), which no longer depends on
the SQLAlchemy Delete object repr (review S2.6).
* translate_grpc close() (#6): convert the f-string log to lazy
%-style for consistency with the rest of this PR's logging
(review N2.1).
* grpc_service _sync_tools_from_reflection (#7): document why
input_schema['properties'] is empty by design — gRPC arg shape is
validated at the protobuf invocation layer, not the MCP tool-call
layer; the actual proto types live in the x-grpc-* extensions
(review N2.2).
* TestInvokeMethodGuards (#8): add 5 edge-case tests covering
invoke_method paths the previous suite did not exercise:
- service-not-found -> GrpcServiceNotFoundError
- disabled service -> GrpcServiceError('is disabled')
- invalid method format (no dot) -> GrpcServiceError
- _validate_grpc_target spy called with service.target
- _validate_tls_path spy called for both cert and key paths
525 targeted tests pass (was 520). Lint clean.
Branch: GrpcMethodsAsTools-2854
Signed-off-by: Jonathan Springer <jps@s390x.com>
0 commit comments