Skip to content

Add runtime gRPC server helpers and proto guard#18

Merged
cpdata merged 2 commits intomainfrom
codex/conduct-comprehensive-codebase-review-y49vjd
Oct 17, 2025
Merged

Add runtime gRPC server helpers and proto guard#18
cpdata merged 2 commits intomainfrom
codex/conduct-comprehensive-codebase-review-y49vjd

Conversation

@cpdata
Copy link
Owner

@cpdata cpdata commented Oct 16, 2025

Summary

  • add an asyncio-backed gRPC server module plus smoke tests and packaging checks to exercise the generated protobuf schema end to end
  • wire Makefile, CI, and new maintenance scripts to regenerate/verify protobuf bindings and fail fast on drift
  • refresh README, setup/operations docs, planning notes, and backlog to capture the gRPC runtime workflow and follow-up tasks

Testing

  • pytest meshmind/tests/test_grpc_runtime.py meshmind/tests/test_protos_packaging.py meshmind/tests/test_setup_scripts.py

https://chatgpt.com/codex/tasks/task_b_68ee1c9ee92c83218cbbebce8b0667b8

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting

Comment on lines +194 to +199
def delete_triplet(self, subj: str, pred: str, obj: str) -> None:
predicate = self._sanitize_predicate(pred)
cypher = (
"MATCH (a {uuid: $subj})-[r:`{predicate}`]->(b {uuid: $obj}) "
"DELETE r"
)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Format dynamic predicate in Memgraph triplet deletion

The delete_triplet Cypher query embeds {predicate} inside backticks but the string is not an f-string, so {predicate} is never replaced with the sanitized relationship type. As written the driver sends MATCH (a {uuid: $subj})-[r:{predicate}]->(b {uuid: $obj}) DELETE r, which is invalid Cypher and the call fails for every predicate. This method therefore cannot delete any triplet. Format the string (or build it with parameters) before executing.

Useful? React with 👍 / 👎.

Comment on lines +175 to +186
def search(self, payload: SearchPayload) -> Sequence[Memory]:
proto = pb2.SearchPayload(
query=payload.query,
namespace=payload.namespace or "",
top_k=payload.top_k,
encoder=payload.encoder or "",
entity_labels=list(payload.entity_labels or []),
rerank_model=payload.rerank_model or "",
use_llm_rerank=payload.use_llm_rerank,
llm_models=dict(payload.llm_models or {}),
llm_base_urls=dict(payload.llm_base_urls or {}),
llm_api_key=payload.llm_api_key or "",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Filter None values before populating gRPC map fields

The convenience GrpcServiceStub.search forwards payload.llm_base_urls directly into pb2.SearchPayload. SearchPayload.llm_base_urls allows Dict[str, Optional[str]], so callers may include entries with None values, but protobuf map fields accept only concrete strings. Passing { "default": None } raises TypeError when the request is built, preventing gRPC calls that rely on the optional override keys. Drop keys with None values (or cast to empty strings) before constructing the protobuf message.

Useful? React with 👍 / 👎.

@cpdata cpdata merged commit 5290a99 into main Oct 17, 2025
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant