Skip to content

feat: migrate Thin SDK to sidecar control session - #4

Merged
chuntaojun merged 1 commit into
developfrom
codex/service-session-v2
Aug 5, 2026
Merged

feat: migrate Thin SDK to sidecar control session#4
chuntaojun merged 1 commit into
developfrom
codex/service-session-v2

Conversation

@chuntaojun

Copy link
Copy Markdown
Contributor

概要

  • 使用 OpenControlSession 双向 UDS 会话
  • 增加本地服务注册、注销、状态与重连重放
  • 契约固定到 specification develop@2642bc29

验证

  • Python 单测 15/15
  • compileall
  • git diff --check

Copilot AI lite review requested due to automatic review settings August 5, 2026 18:28

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.

Pull request overview

This PR migrates the Python Thin SDK’s bootstrap/session implementation from the legacy OpenSession server-streaming flow to the OpenControlSession bidirectional control stream (wire v2), adding local service registration lifecycle support and updating the vendored contract + generated stubs accordingly.

Changes:

  • Switch SidecarSession connection logic to OpenControlSession and introduce a request-queue based client event stream.
  • Add local service registration/unregistration APIs, status tracking, and replay of desired registrations after reconnect.
  • Update contract assets (proto, version, checksums), generated protobuf/gRPC code, tests, and README to reflect Session v2.

Reviewed changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/test_thin_sdk.py Updates UDS session tests to validate OpenControlSession, and adds coverage for local service registration/status replay/unregistration and stream close behavior.
src/pole_client/bootstrap.py Implements v2 control session, client event queueing, local service registration APIs, and status handling.
src/pole_client/_generated/bootstrap_pb2.py Updates generated protobuf definitions for ClientEvent, local service messages, and OpenControlSession.
src/pole_client/_generated/bootstrap_pb2_grpc.py Updates generated gRPC stubs/servicer definitions to include OpenControlSession.
src/pole_client/init.py Exposes new local-service public API types from the package root.
README.md Documents the new control-session flow and local service registration APIs.
contract/VERSION Bumps Sidecar session wire version to 2 and pins specification commit.
contract/SHA256SUMS Updates checksums for the updated vendored bootstrap.proto.
contract/bootstrap.proto Adds OpenControlSession and local service registration/status messages + documentation.
context-kg/tasks/todo.md Records the v2 migration task checklist and verification notes.
context-kg/tasks/lessons.md Updates process guidance about pinning merged specification commits before submitting.
Files not reviewed (1)
  • src/pole_client/_generated/bootstrap_pb2.py: Generated file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +258 to +265
def unregister_local_service(self, registration_id: str) -> bool:
normalized_registration_id = _normalize_required_text(
registration_id, "registration_id"
)
with self._lock:
registration = self._desired_registrations.pop(
normalized_registration_id, None
)
Comment on lines 318 to 320
first_event = next(stream)
self._install_snapshot(self._parse_initial_event(first_event))
delay = self._reconnect_initial_backoff_seconds
Comment thread README.md
Comment on lines +15 to 17
`pole.sidecar.v1.SidecarSessionService/OpenControlSession`;包内 `_generated/` 是其通过官方
`grpcio-tools 1.71.0` 生成的 Python 代码。语言原生测试执行全部 TargetService SDK
向量,并验证 UDS server-streaming 的会话行为。
@chuntaojun
chuntaojun merged commit 235f0af into develop Aug 5, 2026
11 checks passed
@chuntaojun
chuntaojun deleted the codex/service-session-v2 branch August 5, 2026 19:38
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