[AAASM-4592] 🐛 (python-sdk-docs): Fix truncated smolagents quick-start snippet#256
Conversation
quickstart_snippets/smolagents-tool-policy.py ended at a dangling `with init_assembly(...) as ctx:` with zero body lines, failing ast.parse (IndentationError). Re-vendor the standard Agent/Gateway/Mode + policy-rules print block from the upstream examples repo source (examples/python/smolagents-tool-policy/src/main.py), mirroring the cutoff style AAASM-4585 used for the Google ADK/Pydantic AI/Microsoft Agent Framework tabs. Refs AAASM-4592
Rebuild the generated framework-tabs region via scripts/generate_quickstart_tabs.py so the rendered smolagents tab picks up the completed with-body from the previous commit. Refs AAASM-4592
Review: AAASM-4592 — smolagents quick-start truncation fixCI: All 5 checks passing, 0 failing. Scope completeness:
Regression check: Full diff of Playwright validation: Built docs with Verdict: READY — scope is complete and faithful to the ticket, no regressions, docs build and render correctly, CI green. — Claude Code |
Description
quickstart_snippets/smolagents-tool-policy.pyended with a danglingwith init_assembly(...) as ctx:and zero body lines — syntactically incomplete Python (ast.parseraisedIndentationError).docs/quick-start.md's "smolagents" tab (generated from it) carried the same truncation.Re-vendored the snippet from the upstream
examplesrepo (examples/python/smolagents-tool-policy/src/main.py), adding the standard Agent/Gateway/Mode print block + policy-rules print block as thewithbody — mirroring the cutoff style AAASM-4585 (PR #253) used to fix the same defect class for the Google ADK, Pydantic AI, and Microsoft Agent Framework tabs (a complete-but-short stopping point after the standard header block, matching the AutoGen tab's precedent of stopping on a valid statement rather than vendoring the entire example). Regenerateddocs/quick-start.mdviascripts/generate_quickstart_tabs.pyso the rendered doc picks up the fix.No other content in either file changes.
Type of Change
Breaking Changes
Related Issues
Testing
Verification performed:
python3 -c "import ast; ast.parse(open('quickstart_snippets/smolagents-tool-policy.py').read())"passes (previously aSyntaxError/IndentationError).python scripts/generate_quickstart_tabs.py --checkpasses (doc matches the vendored snippet — 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 confirmed via an isolated Playwright check that the smolagents tab now shows the complete, syntax-highlightedwithbody (previously truncated at) as ctx:), with §2's hand-authored "Local-mode transports" note unaffected.Checklist