Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
116 changes: 116 additions & 0 deletions .github/workflows/release-go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
name: Release gRPC goLang packages

on:
push:
branches: [main]
paths:
- 'crates/grpc_client/go/**'
- 'crates/grpc_client/proto/**'
pull_request:
branches: [main]
paths:
- 'crates/grpc_client/go/**'
- 'crates/grpc_client/proto/**'
workflow_dispatch:

permissions:
contents: write

jobs:
test:
name: Test Go Client
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.25'

- name: Install protoc
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ github.token }}

- name: Install protoc-gen-go
run: |
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest

- name: Generate Code
run: bash crates/grpc_client/go/generate.sh

# Generated files are ignored, so we don't need to verify clean git tree here.

- name: Test
run: cd crates/grpc_client/go && go test ./...

release:
name: Tag Release
needs: test
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.25'

- name: Install protoc
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ github.token }}

- name: Install protoc-gen-go
run: |
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest

- name: Generate Code
run: bash crates/grpc_client/go/generate.sh

- name: Commit Generated Code
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add -f crates/grpc_client/go/generated
if [ -d "crates/grpc_client/go/proto" ]; then
git add -f crates/grpc_client/go/proto
fi
if ! git diff --cached --quiet; then
git commit -m "chore: include generated code for release [skip ci]"
fi
Comment on lines +77 to +87

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Release commit is created but not pushed before tagging.

The workflow commits generated code locally but doesn't push the commit before creating the tag. The tag will be created on the local commit (with generated code), but this commit won't be pushed to the main branch. This means:

  1. The tag points to a commit that doesn't exist on main
  2. Consumers fetching the tag will get the generated code, but the commit history diverges from main

If this is intentional (tags are orphaned commits with generated code), consider documenting this behavior. Otherwise, you may want to push to a release branch or reconsider the release strategy.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/release-go.yml around lines 77 - 87, The workflow commits
generated code in the "Commit Generated Code" step but never pushes that commit
before creating the release tag; update the step to push the committed changes
(git push origin HEAD:<branch> or equivalent) before the tag creation step
(and/or ensure the tag is created from the remote branch), or alternatively
create and push the tag that points to the new commit (push the commit first
then push the tag); modify the step that performs the commit so it runs a push
when a commit was created and ensure downstream steps that create tags use the
pushed commit (reference the "Commit Generated Code" step and the tag creation
step when making the change).


- name: Read Version
id: version
run: |
if [ ! -f crates/grpc_client/go/VERSION ]; then
echo "Error: VERSION file missing"
exit 1
fi
VERSION=$(cat crates/grpc_client/go/VERSION | tr -d '[:space:]')
echo "version=$VERSION" >> $GITHUB_OUTPUT
Comment on lines +89 to +97

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Quote variable to prevent word splitting (SC2086).

The $VERSION variable should be quoted to prevent potential issues with word splitting, even though tr -d '[:space:]' should have removed whitespace.

♻️ Suggested fix
       - name: Read Version
         id: version
         run: |
           if [ ! -f crates/grpc_client/go/VERSION ]; then
             echo "Error: VERSION file missing"
             exit 1
           fi
-          VERSION=$(cat crates/grpc_client/go/VERSION | tr -d '[:space:]')
+          VERSION="$(cat crates/grpc_client/go/VERSION | tr -d '[:space:]')"
           echo "version=$VERSION" >> $GITHUB_OUTPUT
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Read Version
id: version
run: |
if [ ! -f crates/grpc_client/go/VERSION ]; then
echo "Error: VERSION file missing"
exit 1
fi
VERSION=$(cat crates/grpc_client/go/VERSION | tr -d '[:space:]')
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Read Version
id: version
run: |
if [ ! -f crates/grpc_client/go/VERSION ]; then
echo "Error: VERSION file missing"
exit 1
fi
VERSION="$(cat crates/grpc_client/go/VERSION | tr -d '[:space:]')"
echo "version=$VERSION" >> $GITHUB_OUTPUT
🧰 Tools
🪛 actionlint (1.7.11)

[error] 91-91: shellcheck reported issue in this script: SC2086:info:6:28: Double quote to prevent globbing and word splitting

(shellcheck)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/release-go.yml around lines 89 - 97, In the "Read Version"
step the VERSION variable should be safely quoted to avoid word-splitting;
update the write to GitHub Actions output to use a quoted expansion and file
target (e.g., emit "version=$VERSION" using a quoted variable and quote
$GITHUB_OUTPUT as well) so change the current echo/write that references VERSION
and GITHUB_OUTPUT in the step with id "version" to use quoted expansions.


- name: Check if tag exists
id: check_tag
run: |
TAG="crates/grpc_client/go/v${{ steps.version.outputs.version }}"
if git rev-parse "$TAG" >/dev/null 2>&1; then
echo "exists=true" >> $GITHUB_OUTPUT
else
echo "exists=false" >> $GITHUB_OUTPUT
fi
Comment on lines +99 to +107

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Quote variable expansion in tag check (SC2086).

The $TAG variable should be quoted in the git rev-parse command and output statements.

♻️ Suggested fix
       - name: Check if tag exists
         id: check_tag
         run: |
-          TAG="crates/grpc_client/go/v${{ steps.version.outputs.version }}"
+          TAG="crates/grpc_client/go/v${{ steps.version.outputs.version }}"
           if git rev-parse "$TAG" >/dev/null 2>&1; then
-            echo "exists=true" >> $GITHUB_OUTPUT
+            echo "exists=true" >> "$GITHUB_OUTPUT"
           else
-            echo "exists=false" >> $GITHUB_OUTPUT
+            echo "exists=false" >> "$GITHUB_OUTPUT"
           fi
🧰 Tools
🪛 actionlint (1.7.11)

[error] 101-101: shellcheck reported issue in this script: SC2086:info:3:25: Double quote to prevent globbing and word splitting

(shellcheck)


[error] 101-101: shellcheck reported issue in this script: SC2086:info:5:26: Double quote to prevent globbing and word splitting

(shellcheck)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/release-go.yml around lines 99 - 107, The TAG variable in
the check_tag step is not quoted when used; update the git rev-parse and echo
lines to quote "$TAG" (and any other expansions) so the command and outputs
handle tags with spaces or special chars correctly—specifically change uses of
git rev-parse $TAG to git rev-parse "$TAG" and echo "exists=true" >>
$GITHUB_OUTPUT (if echoing TAG include "$TAG") in the step with id check_tag
where TAG="crates/grpc_client/go/v${{ steps.version.outputs.version }}".


- name: Create and Push Tag
if: steps.check_tag.outputs.exists == 'false'
run: |
TAG="crates/grpc_client/go/v${{ steps.version.outputs.version }}"
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag "$TAG"
git push origin "$TAG"
3 changes: 3 additions & 0 deletions crates/grpc_client/go/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Generated files
generated/
proto/
45 changes: 45 additions & 0 deletions crates/grpc_client/go/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# SMG gRPC Client (Go)

This module contains auto-generated Go gRPC code for Shepherd Model Gateway services (SGLang, vLLM, TRT-LLM).

## Installation

To use this module in your Go project:

```bash
go get github.com/lightseek/smg/crates/grpc_client/go
```

## Package Structure

The generated code is divided into packages under the `generated` directory:

- `generated/common`: Common types (e.g., KV Events)
- `generated/sglang_encoder`: SGLang Encoder service
- `generated/sglang_scheduler`: SGLang Scheduler service
- `generated/trtllm`: TensorRT-LLM Service
- `generated/vllm`: vLLM Engine service

## Generation

To regenerate the code from `.proto` files:

1. Install prerequisites:
```bash
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
```
2. Run the generation script:
```bash
bash generate.sh
```
Comment on lines +27 to +35

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Add blank lines around fenced code blocks for markdown compliance.

The fenced code blocks within the numbered list items should be surrounded by blank lines per markdown standards (MD031).

♻️ Suggested fix
 1.  Install prerequisites:
+
     ```bash
     go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
     go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
     ```
+
 2.  Run the generation script:
+
     ```bash
     bash generate.sh
     ```
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
1. Install prerequisites:
```bash
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
```
2. Run the generation script:
```bash
bash generate.sh
```
1. Install prerequisites:
🧰 Tools
🪛 markdownlint-cli2 (0.21.0)

[warning] 28-28: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


[warning] 31-31: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


[warning] 33-33: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@crates/grpc_client/go/README.md` around lines 27 - 35, The markdown fenced
code blocks in the numbered list (the two ```bash blocks) violate MD031 because
they lack blank lines before and after the fences; edit the README.md content
around those code blocks so there is an empty line immediately before each
opening ```bash and an empty line immediately after each closing ``` to separate
the code blocks from the surrounding list text.


The generated code is committed to **Git release tags** automatically by the CI pipeline for convenience.

> [!IMPORTANT]
> When consuming this module in external projects, you **must** specify a version tag (e.g., `@v1.0.0`). Consuming the `main` branch directly will result in missing generated files due to full-tree `.gitignore`.


## Release

Releases are created automatically when the version in the `VERSION` file is updated and merged into `main`. It will create a Git tag: `crates/grpc_client/go/v<VERSION>`.
1 change: 1 addition & 0 deletions crates/grpc_client/go/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.1.0
3 changes: 3 additions & 0 deletions crates/grpc_client/go/generate.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Package go_client is used to trigger code generation.
//go:generate bash ./generate.sh
package go_client
Comment on lines +1 to +3

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The package name go_client is not idiomatic. Go package names should be short, concise, all lowercase, and should not use underscores. Please consider renaming it to goclient for better adherence to Go conventions.

Suggested change
// Package go_client is used to trigger code generation.
//go:generate bash ./generate.sh
package go_client
// Package goclient is used to trigger code generation.
//go:generate bash ./generate.sh
package goclient

Comment on lines +1 to +3

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Non-idiomatic Go package name.

Go package names should be lowercase without underscores. Consider renaming go_client to goclient.

♻️ Suggested fix
-// Package go_client is used to trigger code generation.
+// Package goclient is used to trigger code generation.
 //go:generate bash ./generate.sh
-package go_client
+package goclient
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// Package go_client is used to trigger code generation.
//go:generate bash ./generate.sh
package go_client
// Package goclient is used to trigger code generation.
//go:generate bash ./generate.sh
package goclient
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@crates/grpc_client/go/generate.go` around lines 1 - 3, The package
declaration uses a non-idiomatic name `go_client`; change the package name to
`goclient` by updating the `package go_client` declaration in this file and any
other files in the same package to `package goclient`, then update all import
sites that reference `go_client` to import `goclient` instead (and run go build
or `go vet` to find remaining references); ensure the `//go:generate` directive
and any generated artifacts still work with the new package name.

114 changes: 114 additions & 0 deletions crates/grpc_client/go/generate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
#!/bin/bash
set -e

# Paths
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROTO_SOURCE_DIR="$SCRIPT_DIR/../proto"
GO_PROTO_DIR="$SCRIPT_DIR/proto"
OUTPUT_DIR="$SCRIPT_DIR/generated"

# Ensure directories exist
mkdir -p "$GO_PROTO_DIR"
rm -rf "$OUTPUT_DIR"
mkdir -p "$OUTPUT_DIR/common"
mkdir -p "$OUTPUT_DIR/sglang_encoder"
mkdir -p "$OUTPUT_DIR/sglang_scheduler"
mkdir -p "$OUTPUT_DIR/trtllm"
mkdir -p "$OUTPUT_DIR/vllm"

# Copy proto files
echo "Copying proto files..."
cp "$PROTO_SOURCE_DIR"/*.proto "$GO_PROTO_DIR"/

# Find tools in PATH or GOPATH
PROTOC_GEN_GO=$(which protoc-gen-go || echo "$(go env GOPATH)/bin/protoc-gen-go")
PROTOC_GEN_GO_GRPC=$(which protoc-gen-go-grpc || echo "$(go env GOPATH)/bin/protoc-gen-go-grpc")

if [ ! -f "$PROTOC_GEN_GO" ]; then
echo "Error: protoc-gen-go not found. Please install with: go install google.golang.org/protobuf/cmd/protoc-gen-go@latest"
exit 1
fi

if [ ! -f "$PROTOC_GEN_GO_GRPC" ]; then
echo "Error: protoc-gen-go-grpc not found. Please install with: go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest"
exit 1
fi

# Common mappings for imports
MAPPINGS="--go_opt=Mcommon.proto=github.com/lightseek/smg/crates/grpc_client/go/generated/common"
MAPPINGS_GRPC="--go-grpc_opt=Mcommon.proto=github.com/lightseek/smg/crates/grpc_client/go/generated/common"

echo "Generating Go code..."

cd "$GO_PROTO_DIR"

# Common
protoc \
--plugin=protoc-gen-go="$PROTOC_GEN_GO" \
--proto_path=. \
--go_out="$OUTPUT_DIR/common" \
--go_opt=paths=source_relative \
--go_opt=Mcommon.proto=github.com/lightseek/smg/crates/grpc_client/go/generated/common \
common.proto

# SGLang Encoder
protoc \
--plugin=protoc-gen-go="$PROTOC_GEN_GO" \
--plugin=protoc-gen-go-grpc="$PROTOC_GEN_GO_GRPC" \
--proto_path=. \
--go_out="$OUTPUT_DIR/sglang_encoder" \
--go_opt=paths=source_relative \
$MAPPINGS \
--go_opt=Msglang_encoder.proto=github.com/lightseek/smg/crates/grpc_client/go/generated/sglang_encoder \
--go-grpc_out="$OUTPUT_DIR/sglang_encoder" \
--go-grpc_opt=paths=source_relative \
$MAPPINGS_GRPC \
--go-grpc_opt=Msglang_encoder.proto=github.com/lightseek/smg/crates/grpc_client/go/generated/sglang_encoder \
sglang_encoder.proto

# SGLang Scheduler
protoc \
--plugin=protoc-gen-go="$PROTOC_GEN_GO" \
--plugin=protoc-gen-go-grpc="$PROTOC_GEN_GO_GRPC" \
--proto_path=. \
--go_out="$OUTPUT_DIR/sglang_scheduler" \
--go_opt=paths=source_relative \
$MAPPINGS \
--go_opt=Msglang_scheduler.proto=github.com/lightseek/smg/crates/grpc_client/go/generated/sglang_scheduler \
--go-grpc_out="$OUTPUT_DIR/sglang_scheduler" \
--go-grpc_opt=paths=source_relative \
$MAPPINGS_GRPC \
--go-grpc_opt=Msglang_scheduler.proto=github.com/lightseek/smg/crates/grpc_client/go/generated/sglang_scheduler \
sglang_scheduler.proto

# TRT-LLM Service
protoc \
--plugin=protoc-gen-go="$PROTOC_GEN_GO" \
--plugin=protoc-gen-go-grpc="$PROTOC_GEN_GO_GRPC" \
--proto_path=. \
--go_out="$OUTPUT_DIR/trtllm" \
--go_opt=paths=source_relative \
$MAPPINGS \
--go_opt=Mtrtllm_service.proto=github.com/lightseek/smg/crates/grpc_client/go/generated/trtllm \
--go-grpc_out="$OUTPUT_DIR/trtllm" \
--go-grpc_opt=paths=source_relative \
$MAPPINGS_GRPC \
--go-grpc_opt=Mtrtllm_service.proto=github.com/lightseek/smg/crates/grpc_client/go/generated/trtllm \
trtllm_service.proto

# vLLM Engine
protoc \
--plugin=protoc-gen-go="$PROTOC_GEN_GO" \
--plugin=protoc-gen-go-grpc="$PROTOC_GEN_GO_GRPC" \
--proto_path=. \
--go_out="$OUTPUT_DIR/vllm" \
--go_opt=paths=source_relative \
$MAPPINGS \
--go_opt=Mvllm_engine.proto=github.com/lightseek/smg/crates/grpc_client/go/generated/vllm \
--go-grpc_out="$OUTPUT_DIR/vllm" \
--go-grpc_opt=paths=source_relative \
$MAPPINGS_GRPC \
--go-grpc_opt=Mvllm_engine.proto=github.com/lightseek/smg/crates/grpc_client/go/generated/vllm \
vllm_engine.proto
Comment on lines +54 to +112

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The protoc commands for generating code for each service (SGLang Encoder, SGLang Scheduler, TRT-LLM Service, vLLM Engine) are very similar and repetitive. This makes the script harder to maintain. Consider refactoring this section into a loop or a function to reduce duplication.

For example, you could define a function:

generate_service() {
    local service_name="$1"
    local proto_file="$2"
    local output_dir="$OUTPUT_DIR/$service_name"

    echo "Generating for $service_name..."

    protoc \
      --plugin=protoc-gen-go="$PROTOC_GEN_GO" \
      --plugin=protoc-gen-go-grpc="$PROTOC_GEN_GO_GRPC" \
      --proto_path=. \
      --go_out="$output_dir" \
      --go_opt=paths=source_relative \
      $MAPPINGS \
      --go_opt=M${proto_file}=github.com/lightseek/smg/crates/grpc_client/go/generated/${service_name} \
      --go-grpc_out="$output_dir" \
      --go-grpc_opt=paths=source_relative \
      $MAPPINGS_GRPC \
      --go-grpc_opt=M${proto_file}=github.com/lightseek/smg/crates/grpc_client/go/generated/${service_name} \
      "$proto_file"
}

And then call it for each service:

generate_service "sglang_encoder" "sglang_encoder.proto"
generate_service "sglang_scheduler" "sglang_scheduler.proto"
generate_service "trtllm" "trtllm_service.proto"
generate_service "vllm" "vllm_engine.proto"

This would make the script cleaner and easier to extend with new services.


echo "Generation complete!"
15 changes: 15 additions & 0 deletions crates/grpc_client/go/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module github.com/lightseek/smg/crates/grpc_client/go

go 1.25.0

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

🧩 Analysis chain

🌐 Web query:

What is the latest stable version of Go programming language?

💡 Result:

The latest stable version of the Go programming language is 1.26.1.

Citations:


Go 1.25.0 is a released version. It is stable and supported. If desired, consider updating to Go 1.26.1, the current latest stable version.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@crates/grpc_client/go/go.mod` at line 3, Update the Go version declaration in
go.mod from "go 1.25.0" to the desired newer stable version (e.g., "go 1.26.1")
by changing the module's go directive so the line reading go 1.25.0 is replaced
with go 1.26.1; ensure the go.mod's go directive matches the target Go toolchain
you intend to use.


require (
google.golang.org/grpc v1.79.3
google.golang.org/protobuf v1.36.11
)
Comment on lines +1 to +8

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check if bindings/golang module exists and what it provides
echo "=== Checking existing Go module at bindings/golang ==="
if [ -f "bindings/golang/go.mod" ]; then
  cat bindings/golang/go.mod
  echo ""
  echo "=== Directory structure ==="
  tree bindings/golang -L 3 2>/dev/null || find bindings/golang -type f -name "*.go" | head -20
fi

Repository: lightseekorg/smg

Length of output: 1788


🏁 Script executed:

#!/bin/bash
# Check if crates/grpc_client/go exists and what it contains
echo "=== Checking crates/grpc_client/go ==="
if [ -d "crates/grpc_client/go" ]; then
  echo "Directory exists. Contents:"
  find crates/grpc_client/go -type f -name "*.pb.go" -o -name "*.proto" | head -30
  echo ""
  echo "=== Directory tree ==="
  tree crates/grpc_client/go -L 3 2>/dev/null || find crates/grpc_client/go -type f | head -30
else
  echo "Directory does not exist"
fi

echo ""
echo "=== Checking what protos are used by bindings/golang ==="
# Check if there are other proto generated files in bindings/golang
find bindings/golang -type f \( -name "*.pb.go" -o -name "*.proto" \) 2>/dev/null

echo ""
echo "=== Checking grpc_client directory structure ==="
# Check what's in the grpc_client directory
if [ -d "crates/grpc_client" ]; then
  find crates/grpc_client -maxdepth 2 -type d
fi

Repository: lightseekorg/smg

Length of output: 651


🏁 Script executed:

#!/bin/bash
# Check what the generate scripts do
echo "=== generate.sh ==="
cat crates/grpc_client/go/generate.sh

echo ""
echo "=== generate.go ==="
cat crates/grpc_client/go/generate.go

echo ""
echo "=== README.md ==="
cat crates/grpc_client/go/README.md

Repository: lightseekorg/smg

Length of output: 5626


Duplicate sglang_scheduler generation with different import paths.

This module generates Go code for sglang_scheduler.proto to generated/sglang_scheduler/ with import path github.com/lightseek/smg/crates/grpc_client/go/generated/sglang_scheduler, while the existing bindings/golang module generates the same proto to internal/proto/ with path github.com/lightseek/smg/go-grpc-sdk/internal/proto. Consumers importing both modules will face import conflicts.

While these modules serve different purposes (raw auto-generated bindings vs. higher-level wrapper SDK), consider documenting which module consumers should prefer, or ensuring the two modules target different subsets of services to avoid overlap.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@crates/grpc_client/go/go.mod` around lines 1 - 8, The repo currently
generates duplicate Go bindings for sglang_scheduler.proto into
generated/sglang_scheduler (import path
github.com/lightseek/smg/crates/grpc_client/go/generated/sglang_scheduler) while
bindings/golang emits the same types into internal/proto
(github.com/lightseek/smg/go-grpc-sdk/internal/proto), causing import conflicts
for consumers; fix by choosing one of three options and applying it: (A) stop
generating sglang_scheduler in crates/grpc_client/go (remove that proto from its
generator config) and add a short README in crates/grpc_client/go explaining
consumers should use bindings/golang for sglang_scheduler, (B) change the
generated package/module path for crates/grpc_client/go (or its output folder)
to a distinct import path to avoid collision, or (C) limit each generator to a
non‑overlapping subset of services (e.g., only low‑level bindings in one and SDK
wrappers in the other) and document the intended consumer preference in both
module READMEs; update generator configs and add the documentation accordingly
so imports no longer collide.


require (
golang.org/x/net v0.48.0 // indirect
golang.org/x/sys v0.39.0 // indirect
golang.org/x/text v0.32.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 // indirect
)
Comment on lines +1 to +15

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

critical

The go.mod file contains invalid versions for Go and its dependencies. This will prevent the module from being built or used.

  • The Go version 1.25.0 is not a valid Go version. The latest stable version is 1.22.x. Please use a valid and preferably widely-adopted version.
  • The dependency versions also appear to be invalid or from the future (e.g., google.golang.org/grpc v1.79.3 when the latest is v1.64.0, google.golang.org/genproto/... v0.0.0-2025...).

Please run go mod tidy to clean up the go.mod and go.sum files with correct, existing versions of the dependencies.

References
  1. Ensure that all external resource versions specified in scripts (or configuration files like go.mod that dictate build processes) are accurate and exist, as incorrect versions can lead to build failures.

38 changes: 38 additions & 0 deletions crates/grpc_client/go/go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=
github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64=
go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y=
go.opentelemetry.io/otel v1.39.0 h1:8yPrr/S0ND9QEfTfdP9V+SiwT4E0G7Y5MO7p85nis48=
go.opentelemetry.io/otel v1.39.0/go.mod h1:kLlFTywNWrFyEdH0oj2xK0bFYZtHRYUdv1NklR/tgc8=
go.opentelemetry.io/otel/metric v1.39.0 h1:d1UzonvEZriVfpNKEVmHXbdf909uGTOQjA0HF0Ls5Q0=
go.opentelemetry.io/otel/metric v1.39.0/go.mod h1:jrZSWL33sD7bBxg1xjrqyDjnuzTUB0x1nBERXd7Ftcs=
go.opentelemetry.io/otel/sdk v1.39.0 h1:nMLYcjVsvdui1B/4FRkwjzoRVsMK8uL/cj0OyhKzt18=
go.opentelemetry.io/otel/sdk v1.39.0/go.mod h1:vDojkC4/jsTJsE+kh+LXYQlbL8CgrEcwmt1ENZszdJE=
go.opentelemetry.io/otel/sdk/metric v1.39.0 h1:cXMVVFVgsIf2YL6QkRF4Urbr/aMInf+2WKg+sEJTtB8=
go.opentelemetry.io/otel/sdk/metric v1.39.0/go.mod h1:xq9HEVH7qeX69/JnwEfp6fVq5wosJsY1mt4lLfYdVew=
go.opentelemetry.io/otel/trace v1.39.0 h1:2d2vfpEDmCJ5zVYz7ijaJdOF59xLomrvj7bjt6/qCJI=
go.opentelemetry.io/otel/trace v1.39.0/go.mod h1:88w4/PnZSazkGzz/w84VHpQafiU4EtqqlVdxWy+rNOA=
golang.org/x/net v0.48.0 h1:zyQRTTrjc33Lhh0fBgT/H3oZq9WuvRR5gPC70xpDiQU=
golang.org/x/net v0.48.0/go.mod h1:+ndRgGjkh8FGtu1w1FGbEC31if4VrNVMuKTgcAAnQRY=
golang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk=
golang.org/x/sys v0.39.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
golang.org/x/text v0.32.0 h1:ZD01bjUt1FQ9WJ0ClOL5vxgxOI/sVCNgX1YtKwcY0mU=
golang.org/x/text v0.32.0/go.mod h1:o/rUWzghvpD5TXrTIBuJU77MTaN0ljMWE47kxGJQ7jY=
gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk=
gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E=
google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 h1:gRkg/vSppuSQoDjxyiGfN4Upv/h/DQmIR10ZU8dh4Ww=
google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217/go.mod h1:7i2o+ce6H/6BluujYR+kqX3GKH+dChPTQU19wjRPiGk=
google.golang.org/grpc v1.79.3 h1:sybAEdRIEtvcD68Gx7dmnwjZKlyfuc61Dyo9pGXXkKE=
google.golang.org/grpc v1.79.3/go.mod h1:KmT0Kjez+0dde/v2j9vzwoAScgEPx/Bw1CYChhHLrHQ=
google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE=
google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=