Skip to content

[AAASM-4585] 🐛 (python-sdk-docs): Fix truncated Google ADK / Pydantic AI / Microsoft Agent Framework quickstart snippets - #253

Merged
Chisanan232 merged 2 commits into
masterfrom
v0.1.0/AAASM-4585/fix/truncated_quickstart_tabs
Jul 14, 2026
Merged

[AAASM-4585] 🐛 (python-sdk-docs): Fix truncated Google ADK / Pydantic AI / Microsoft Agent Framework quickstart snippets#253
Chisanan232 merged 2 commits into
masterfrom
v0.1.0/AAASM-4585/fix/truncated_quickstart_tabs

Conversation

@Chisanan232

@Chisanan232 Chisanan232 commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Description

The Google ADK, Pydantic AI, and Microsoft Agent Framework tabs in docs/quick-start.md §3 ended with a dangling with 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 examples repo sources (examples/python/{google-adk,pydantic-ai,microsoft-agent-framework-tool-policy}/src/main.py), giving each a complete with body (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 the try: each snippet opens with the matching finally: cleanup (ungovern_tool_class(...) / adapter.unregister_hooks()), mirroring the real examples' adapter-cleanup pattern. docs/quick-start.md was then regenerated via scripts/generate_quickstart_tabs.py so the rendered doc picks up the fix.

Type of Change

  • ✨ New feature
  • 🔧 Bug fix
  • ♻️ Refactoring
  • 🍀 Performance improvement
  • 📚 Documentation update
  • 🚀 Release

Breaking Changes

  • No
  • Yes (please describe below)

Related Issues

Testing

  • Unit tests added/updated
  • Integration tests added/updated
  • Manual testing performed
  • No additional automated tests required (docs-only content fix; validated via the existing drift-check generator + ast.parse + a rendered-page check below)

Verification performed:

  • python3 -c "import ast; ast.parse(open(f).read())" passes for all 3 re-vendored quickstart_snippets/*.py files (previously a SyntaxError).
  • python scripts/generate_quickstart_tabs.py --check passes (doc matches the vendored snippets — this is also what .github/workflows/quickstart-tabs-check.yml runs on this PR).
  • uv sync --group docs && uv run mkdocs build --strict passes.
  • Rendered the built site locally (mkdocs serve) and visually confirmed via Playwright that the Google ADK, Pydantic AI, and Microsoft Agent Framework tabs now show complete, syntax-highlighted with bodies (previously truncated at ) as ctx:).

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • Comments added for complex logic
  • Documentation updated if needed
  • All tests passing

…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
@Chisanan232

Copy link
Copy Markdown
Contributor Author

Review: AAASM-4585 — truncated quickstart tabs fix

CI: 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 v0.1.0/AAASM-4585/fix/truncated_quickstart_tabs locally and ran:

python3 -c "import ast; ast.parse(open('quickstart_snippets/google-adk.py').read())"
python3 -c "import ast; ast.parse(open('quickstart_snippets/pydantic-ai.py').read())"
python3 -c "import ast; ast.parse(open('quickstart_snippets/microsoft-agent-framework-tool-policy.py').read())"

All 3 parse cleanly (previously SyntaxError at the dangling with ... as ctx:).

Diffed each re-vendored file's added body against the real upstream source at examples/python/{google-adk,pydantic-ai,microsoft-agent-framework-tool-policy}/src/main.py — the added print(...) block and the finally: cleanup (ungovern_tool_class(DemoTool) / adapter.unregister_hooks() / the if adapter is not None: guard for the Microsoft Agent Framework case) are byte-for-byte identical to upstream, not just "something that happens to parse."

Regression check

  • scripts/generate_quickstart_tabs.py --check passes locally — docs/quick-start.md matches the vendored snippets exactly, no drift.
  • git diff against the pre-PR merge base shows exactly 4 files changed (the 3 vendored snippets + docs/quick-start.md), 74 insertions, 0 deletions. docs/quick-start.md's diff is 3 hunks, one per previously-truncated tab (Google ADK, Microsoft Agent Framework, Pydantic AI) — every other tab (Haystack, OpenAI Agents SDK, Semantic Kernel, etc.) is byte-for-byte untouched.

Playwright validation

Built and served the docs (uv sync --group docs && uv run mkdocs serve), then drove a headless Chromium session (dedicated instance — the shared Playwright MCP browser had cross-session tab contention today) to §3 "Govern your first agent" and clicked through all three previously-broken tabs. Each now renders a complete, syntax-highlighted try: / with ... as ctx: / finally: block ending in the correct cleanup call — no truncation at as ctx:. Screenshots confirm this visually for Google ADK, Pydantic AI, and Microsoft Agent Framework.

Verdict: READY

No 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

@Chisanan232
Chisanan232 merged commit 2256c69 into master Jul 14, 2026
8 checks passed
@Chisanan232
Chisanan232 deleted the v0.1.0/AAASM-4585/fix/truncated_quickstart_tabs branch July 14, 2026 14: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.

1 participant