Skip to content

Initial gRPC server implementation - #67

Open
garado wants to merge 19 commits into
feat/grpcfrom
feat/grpc-basic-server
Open

Initial gRPC server implementation#67
garado wants to merge 19 commits into
feat/grpcfrom
feat/grpc-basic-server

Conversation

@garado

@garado garado commented Aug 30, 2026

Copy link
Copy Markdown
Owner

Basic gRPC daemon implementation. Token-authenticated, loopback-only, and only one RPC implemented for now (listing music tracks).

First step to closing #62

garado added 10 commits August 29, 2026 16:20
the tui has its own worker thread implementation still, but im going to
rewrite the tui soon, so i'm leaving that alone for now
tui still has its own worker thread implementation, but i'm going to
rewrite the tui soon, so i'll leave it alone
IT WORKS WITH GRPCURL AND IT'S SO FAST LETSGOOOO LETSGOOOOOO

- add `light-daemon` entrypoint, which accepts user credentials the same
  way the cli does
- `light-daemon` now runs a frfr worker thread
@garado
garado requested a balanced review from Copilot August 30, 2026 00:42
@garado garado changed the title Feat/grpc basic server Initial gRPC server implementation Aug 30, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Runtime dependency constraints are incompatible with generated code, and startup/shutdown handling contains race and test-hang risks.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds a token-authenticated, loopback-only gRPC daemon supporting music track listing.

Changes:

  • Adds the daemon server, authentication, reflection, error mapping, and CLI entrypoint.
  • Defines and generates the MusicService protobuf API.
  • Adds worker-thread support and comprehensive daemon tests.
File summaries
File Description
uv.lock Locks daemon and gRPC dependencies.
pyproject.toml Adds the daemon workspace package and tooling.
light_api/light_api/worker.py Adds serialized Light API worker access.
light_daemon/pyproject.toml Defines daemon packaging and dependencies.
light_daemon/README.md Documents daemon purpose and layout.
light_daemon/scripts/generate.sh Generates protobuf modules.
light_daemon/proto/light_daemon/v1/music.proto Defines the track-listing service.
light_daemon/light_daemon/__init__.py Initializes the daemon package.
light_daemon/light_daemon/__main__.py Implements daemon CLI startup.
light_daemon/light_daemon/auth.py Implements bearer-token authentication.
light_daemon/light_daemon/errors.py Maps API failures to gRPC statuses.
light_daemon/light_daemon/mapping.py Converts API tracks to protobuf messages.
light_daemon/light_daemon/server.py Builds and runs the gRPC server.
light_daemon/light_daemon/servicers.py Implements track listing.
light_daemon/light_daemon/testing.py Provides in-memory test fakes.
light_daemon/light_daemon/v1/__init__.py Initializes generated modules.
light_daemon/light_daemon/v1/music_pb2.py Generated protobuf messages.
light_daemon/light_daemon/v1/music_pb2.pyi Generated protobuf type declarations.
light_daemon/light_daemon/v1/music_pb2_grpc.py Generated gRPC bindings.
tests/test_daemon_auth.py Tests token authentication.
tests/test_daemon_errors.py Tests error-status mapping.
tests/test_daemon_gen.py Tests generated bindings.
tests/test_daemon_main.py Tests CLI configuration.
tests/test_daemon_reflection.py Tests authenticated reflection.
tests/test_daemon_server.py Tests server behavior end-to-end.
tests/test_daemon_shutdown.py Tests signal-based shutdown.
Review details

Files not reviewed (1)

  • light_daemon/light_daemon/v1/music_pb2.py: Generated file
  • Files reviewed: 24/26 changed files
  • Comments generated: 3
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread light_daemon/pyproject.toml Outdated
Comment thread light_daemon/light_daemon/server.py Outdated
Comment thread tests/test_daemon_shutdown.py Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Worker lifecycle, graceful shutdown, executor availability, error mapping, and a flaky test need correction.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details

Files not reviewed (1)

  • light_daemon/light_daemon/v1/music_pb2.py: Generated file
  • Files reviewed: 25/27 changed files
  • Comments generated: 5
  • Review effort level: Balanced

Comment thread light_api/light_api/worker.py
Comment thread tests/test_worker.py
Comment thread light_daemon/light_daemon/server.py Outdated
Comment thread light_daemon/light_daemon/errors.py
Comment thread light_daemon/light_daemon/server.py

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

A failed port bind can produce a successful but unusable daemon handshake.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details

Files not reviewed (1)

  • light_daemon/light_daemon/v1/music_pb2.py: Generated file

Suppressed comments (2)

Previously missed (2) — in code that hasn't changed since the last review.

light_daemon/light_daemon/auth.py:4

  • Use the standard compound adjective “server-side.”
`authorization: bearer <token>` metadata. A serverside interceptor rejects the rest

light_daemon/light_daemon/v1/init.py:1

  • This package is generated for light_daemon.v1, not light.v1; the module documentation currently names a different service namespace.
"""Generated protobuf / gRPC modules for the light.v1 service surface.
  • Files reviewed: 25/27 changed files
  • Comments generated: 1
  • Review effort level: Balanced

server,
)

bound_port = server.add_insecure_port(f"{host}:{port}")
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.

2 participants