-
Notifications
You must be signed in to change notification settings - Fork 634
Add TypedDict for ping() and stop() return types #216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: friggeri <106686+friggeri@users.noreply.github.com>
Co-authored-by: friggeri <106686+friggeri@users.noreply.github.com>
Co-authored-by: friggeri <106686+friggeri@users.noreply.github.com>
Cross-SDK Consistency ReviewI've reviewed this PR for consistency with the other SDK implementations (Node.js/TypeScript, Go, and .NET). The Python SDK is converting response types from TypedDict to dataclasses, which is great for consistency within Python. However, I've identified one cross-SDK inconsistency to consider: ❌ Inconsistency Found:
|
Co-authored-by: friggeri <106686+friggeri@users.noreply.github.com>
Cross-SDK Consistency Review ✅I've reviewed this PR for consistency across all four SDK implementations (Python, TypeScript, Go, and .NET). SummaryThis PR successfully aligns the Python SDK with the other SDKs by converting return types from raw dicts (TypedDict) to dataclasses. This is excellent for API consistency! Current State After This PR
Minor Inconsistency Noted (Not a blocker for this PR)The TypeScript SDK's Promise<{ message: string; timestamp: number; protocolVersion?: number }>While all other SDKs (including Python after this PR) use a named type like Recommendation✅ This PR maintains good cross-SDK consistency. The Python SDK now properly returns typed objects instead of raw dicts, matching the pattern used in Go and .NET. No changes needed to this PR. Great work on improving the Python SDK's type consistency!
|
Verification: Type Checking Status ✅
Current Status
The type checking with
uv run ty check copilotis now passing successfully.What Was Already Fixed
The previous commit (342039c) "Fix ty type checker errors after dataclass conversion" already resolved all the type checking issues:
PingResponse.get()error - changed to attribute access.protocolVersioncast(bytes, ...)call# type: ignorecommentcastimportVerification Results
$ uv run ty check copilot Checking ------------------------------------------------------------ 1/7 files Checking ------------------------------------------------------------ 2/7 files Checking ------------------------------------------------------------ 3/7 files Checking ------------------------------------------------------------ 4/7 files Checking ------------------------------------------------------------ 5/7 files Checking ------------------------------------------------------------ 6/7 files Checking ------------------------------------------------------------ 7/7 files All checks passed!✅ All type checks are passing - no further action needed.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.