Skip to content

fix(grpc): commit protobuf-5.x runtime files to source tree (#173) - #185

Merged
waylandzhang merged 1 commit into
mainfrom
fix/173-commit-grpc-runtime-files
Jun 2, 2026
Merged

fix(grpc): commit protobuf-5.x runtime files to source tree (#173)#185
waylandzhang merged 1 commit into
mainfrom
fix/173-commit-grpc-runtime-files

Conversation

@waylandzhang

Copy link
Copy Markdown
Collaborator

Summary

Fixes #173 — the gRPC runtime files (*_pb2.py / *_pb2_grpc.py) for the Python llm-service were never committed, so source tags and images built from them were missing the runtime modules and crashed on import. The reported workaround was running make proto-local before building.

Root cause

.gitignore globally ignores **/*_pb2.py and **/*_pb2_grpc.py. The intended unignore for grpc_gen/ was left commented out, so the files stayed untracked. The llm-service Dockerfile copies python/llm-service/ wholesale, so any image CI builds from a tagged source ends up missing the runtime files.

Changes

  • Add explicit .gitignore negations for the grpc_gen runtime files
  • Force-add the 14 nested protobuf-5.x _pb2.py / _pb2_grpc.py files (matches the protobuf==5.x pin in requirements.txt)
  • Regenerate orchestrator stubs to match the committed proto contract (cache-token fields: cache_read_tokens, cache_creation_tokens, cache_creation_1h_tokens — already present in protos/orchestrator/orchestrator.proto)
  • Remove stale flat protobuf-6.x duplicates (unimported; the service imports the nested grpc_gen.<pkg> layout, and 6.x-generated code would crash under the pinned 5.x runtime)

Verification

  • All staged _pb2.py files report protobuf major version 5
  • All grpc_gen modules import cleanly
  • Generated code matches the committed .proto contract
  • llm-service image build + in-container import smoke confirmed the runtime modules load and cache-token fields exist at runtime

Note for adopters

This fixes the source-build path. The one-command install pulls prebuilt images, so adopters get the fix only once the published llm-service image/tag is rebuilt from a tree containing this commit.

The .gitignore globally ignored **/*_pb2.py and **/*_pb2_grpc.py, so the
generated gRPC runtime files never made it into the source tag. The
llm-service Dockerfile copies python/llm-service/ wholesale, so images
built from a tagged source were missing the runtime files and crashed on
import (workaround was 'make proto-local' before build).

- Add explicit .gitignore negations for grpc_gen runtime files
- Force-add the 14 nested protobuf-5.x _pb2.py/_pb2_grpc.py files
- Regenerate orchestrator stubs to match committed proto (cache-token fields)
- Remove stale flat protobuf-6.x duplicates (unimported, would crash 5.x runtime)

Fixes #173
@waylandzhang
waylandzhang merged commit e8f5545 into main Jun 2, 2026
6 checks passed
@waylandzhang
waylandzhang deleted the fix/173-commit-grpc-runtime-files branch June 2, 2026 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing runtime files

1 participant