feat(sdk): gRPC session watch, base path fix, and CLI module sync#814
feat(sdk): gRPC session watch, base path fix, and CLI module sync#814markturansky wants to merge 1 commit intomainfrom
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
SummaryPR adds real-time gRPC session watch support to the Go SDK via a new Issues by SeverityBlocker IssuesNone. Critical Issues1.
Major Issues2.
3. Missing tests for new functionality
4.
Minor Issues5.
6. Closed error channel can yield a nil error in the example
7.
Positive Highlights
Recommendations
Review performed by Claude Code using repository standards from |
|
Claude Code Review — PR #814: feat(sdk): add gRPC session watch support Summary This PR adds gRPC-based real-time session watching to the Go SDK ( BLOCKER: Example code calls
c, err := client.NewClientFromEnv(projectName, client.WithTimeout(120*time.Second))
// export AMBIENT_PROJECT=sdk-demo
c, err := client.NewClientFromEnv(client.WithTimeout(120*time.Second))CRITICAL:
MAJOR:
When MAJOR:
Go map iteration order is randomised. If the OpenAPI spec has paths under multiple base prefixes during a migration, the generator could emit different MINOR: Duplicate
MINOR:
MINOR: Event type should use typed constants
MINOR: gRPC connection leaks if context cancelled without
Positive Highlights
Recommendations
🤖 Generated with Claude Code |
Add SessionWatcher for real-time session event streaming via gRPC, session watch types, and a watch example. Adds google.golang.org/grpc and ambient-api-server proto dependencies. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
e7f2951 to
10bd4bb
Compare
|
Claude Code Review Summary: PR 814 adds gRPC session watch to the Go SDK, fixes SDK generator base path derivation, and removes the per-call project override API. The streaming implementation is well-structured. Several issues need attention before merging. Blocker Issues: None. Critical Issues
Major Issues
Minor Issues
Positive Highlights
Recommendations
|
- Fix CLI go.mod replace directive to point to local SDK - Add ProjectID field mapping in SDK session_watch.go - Remove duplicate SessionWatchEvent type declaration - Ensure CLI builds with merged SDK from PR #814 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
|
This PR was combined with #804 |
Summary
gRPC Session Watch
SessionWatcherfor real-time session event streaming via gRPCtypes/session_watch.gowithSessionWatchEventtype andIsCreated/IsUpdated/IsDeletedhelpersexamples/watch/main.godemonstrating watch usagegoogle.golang.org/grpcandambient-api-serverproto dependenciesReview Fixes
defer cancel()blocker:timeoutCancelnow stored onSessionWatcher, called inStop()grpc.DialContext/WithBlockwithgrpc.NewClientderiveGRPCAddresswithurl.Parse+net.JoinHostPortgrpcDefaultPortconstantSDK Generator: Base Path from Spec
/api/ambient/v1) from OpenAPI spec path keys instead of hardcoding/api/ambient-api-server/v1model.go,parser.go, and all three language templates (Go, Python, TypeScript)/api/ambient/v1base pathCLI Module Sync
go mod tidyonambient-clito sync after SDK go version bump (1.21 → 1.24.0)Test plan
go build ./...passes ingo-sdk/go build ./...passes inambient-cli/go vet ./...cleango fmt ./...clean/api/ambient/v1🤖 Generated with Claude Code