[AAASM-4585] 🐛 (python-sdk-docs): Fix truncated Google ADK / Pydantic AI / Microsoft Agent Framework quickstart snippets - #253
Conversation
…ft Agent Framework quickstart snippets The 3 vendored snippets were truncated at `) as ctx:` with no `with` body, making them syntactically invalid Python. Re-vendor each from its upstream examples/python/<framework>/src/main.py so the `with` block has a real body (the standard Agent/Gateway/Mode print block + policy rules) and the try/finally each already opens is properly closed, matching the adapter-cleanup pattern the real examples use. Refs AAASM-4585
Byproduct of the vendored-snippet fix in the previous commit: running scripts/generate_quickstart_tabs.py picks up the completed with-blocks for Google ADK, Pydantic AI, and Microsoft Agent Framework so the rendered doc no longer ends the tab mid-statement. Refs AAASM-4585
Review: AAASM-4585 — truncated quickstart tabs fixCI: All 5 checks green (CodeQL, Analyze × 2, Build documentation, and — most relevant to this PR — quick-start tabs drift ✅ pass, 8s). Scope completeness (independently verified, not just trusting the PR description) Checked out All 3 parse cleanly (previously Diffed each re-vendored file's added body against the real upstream source at Regression check
Playwright validation Built and served the docs ( Verdict: READYNo issues found. CI green, scope is tight (exactly the 3 broken tabs + regenerated doc, nothing else touched), the fix is faithful to upstream, and the rendered page confirms the truncation is resolved. — Claude Code |
Description
The Google ADK, Pydantic AI, and Microsoft Agent Framework tabs in
docs/quick-start.md§3 ended with a danglingwith init_assembly(...) as ctx:and zero body lines — syntactically incomplete Python. Root cause: the corresponding vendored source files (quickstart_snippets/google-adk.py,quickstart_snippets/pydantic-ai.py,quickstart_snippets/microsoft-agent-framework-tool-policy.py) were themselves truncated at that exact line since they were first added.This PR re-vendors all 3 snippets from their upstream
examplesrepo sources (examples/python/{google-adk,pydantic-ai,microsoft-agent-framework-tool-policy}/src/main.py), giving each a completewithbody (the standard Agent/Gateway/Mode print block + policy-rules print block, matching the cutoff style already used by other tabs like Haystack/LlamaIndex) and closing thetry:each snippet opens with the matchingfinally:cleanup (ungovern_tool_class(...)/adapter.unregister_hooks()), mirroring the real examples' adapter-cleanup pattern.docs/quick-start.mdwas then regenerated viascripts/generate_quickstart_tabs.pyso the rendered doc picks up the fix.Type of Change
Breaking Changes
Related Issues
Testing
Verification performed:
python3 -c "import ast; ast.parse(open(f).read())"passes for all 3 re-vendoredquickstart_snippets/*.pyfiles (previously aSyntaxError).python scripts/generate_quickstart_tabs.py --checkpasses (doc matches the vendored snippets — this is also what.github/workflows/quickstart-tabs-check.ymlruns on this PR).uv sync --group docs && uv run mkdocs build --strictpasses.mkdocs serve) and visually confirmed via Playwright that the Google ADK, Pydantic AI, and Microsoft Agent Framework tabs now show complete, syntax-highlightedwithbodies (previously truncated at) as ctx:).Checklist