Fix Python async syntax errors in copilot-sdk-python instructions#618
Merged
Conversation
Co-authored-by: aaronpowell <434140+aaronpowell@users.noreply.github.com>
Co-authored-by: aaronpowell <434140+aaronpowell@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix Python docstring example for async usage
Fix Python async syntax errors in copilot-sdk-python instructions
Jan 28, 2026
aaronpowell
approved these changes
Jan 29, 2026
aaronpowell
marked this pull request as ready for review
January 29, 2026 03:15
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes Python syntax errors in the copilot-sdk-python.instructions.md file where standalone code examples used async/await syntax at module level, which would cause SyntaxError: 'async with' outside async function when executed.
Changes:
- Wrapped the "Basic Client Setup" example in an
async def main()function withasyncio.run(main()) - Wrapped the "Manual Server Control" example in an
async def main()function withasyncio.run(main()) - Added necessary
import asynciostatements to both examples
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Checklist
npm startand verified thatREADME.mdis up to date.Description
Code examples in
copilot-sdk-python.instructions.mdusedasync withandawaitat module level, causingSyntaxError: 'async with' outside async functionwhen executed.Fixed sections:
async def main()with proper importsasync def main()with proper importsBefore:
After:
Examples are now self-contained, executable Python code consistent with the complete examples elsewhere in the document.
Type of Contribution
Additional Notes
Changes are minimal and surgical - only the two introductory examples that would fail standalone execution. Fragment examples showing code within an existing async context remain unchanged.
By submitting this pull request, I confirm that my contribution abides by the Code of Conduct and will be licensed under the MIT License.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.