feat: ask_user (Q&A) + Monty run_python + SkillsToolset support#88
Merged
Conversation
…fety - antv_chart.py: guard tool discovery with a module-level lock (CrewAI + LangChain loaders) so requests racing in the FastAPI threadpool can't each start an adapter; memoize only on success so a transient sidecar failure (e.g. still warming up) is retried instead of caching [] and pinning AntV off until the process restarts. - docker-compose.yml (prod): drop the host port mapping for the antvis-chart sidecar — the backend reaches it over the internal network; publishing 1122 exposed an unauthenticated MCP/render endpoint. - docker-compose.dev.yml: keep the host port, documented as dev-only. - VARIABLES.md: correct the claim that the sidecar isn't in the prod compose — it is, just profile-gated and off by default. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
aiohttp 3.13.5 has CVE-2026-34993 and CVE-2026-47265 (fixed in 3.14.0). pyjwt 2.12.1 has PYSEC-2026-175/177/178/179 (fixed in 2.13.0). Both are transitive deps pulled in via the project venv; bumping them unblocks the Security Scan CI job and re-enables all template test jobs that were skipping because they need: [security]. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
# Conflicts:
# fastapi_gen/cli.py
# fastapi_gen/config.py
# fastapi_gen/prompts.py
# template/VARIABLES.md
# template/cookiecutter.json
# template/hooks/post_gen_project.py
# template/{{cookiecutter.project_slug}}/backend/.env.example
# template/{{cookiecutter.project_slug}}/backend/app/agents/assistant.py
# template/{{cookiecutter.project_slug}}/backend/app/agents/prompts.py
# template/{{cookiecutter.project_slug}}/backend/app/core/config.py
# template/{{cookiecutter.project_slug}}/backend/pyproject.toml
# template/{{cookiecutter.project_slug}}/frontend/src/components/chat/tool-call-card.tsx
# tests/test_template_integration.py
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Summary
Adds three PydanticAI-only agent capabilities to the generated template, stacked on #83:
ask_user— the agent pauses a run to ask the user one or more questions, then resumes with their answers (interactive multi-step card).run_python— a Monty-sandboxed code-execution tool: compute, transform data, and emit live charts/maps in a single turn.SkillsToolset— loadsSKILL.mdfiles frombackend/skills/as agent tools (loader only; drop in your own skills).Changes
ask_user (Q&A)
ask_usertool: agent pauses, WebSocket session pauses/resumes, frontendQuestionPromptmulti-step card collects answersask_user_responseframe (duplicate / post-reconnect) instead of surfacing a spurious "Empty message" errorCode execution (Monty)
enable_code_executionflag gating arun_pythontool backed bypydantic-montycreate_chart/create_map/current_datetimeemit live, persisted cards viaemit_tool_eventAgentSessionstreams in-sandbox tool calls as the sametool_call/tool_resultevent pair as direct callsSkills (SkillsToolset)
enable_skillsflag + CLI--skills+ interactive promptassistant.py:SkillsToolsetregistration (PydanticAI, gated onbackend/skills/existing — no-ops when empty)pyproject:pydantic-ai-skillsdepload_skill/list_skillstool-call renderingCI / tests
pydantic_ai_code_executionandpydantic_ai_skillsso both paths are linted + type-checked (previously uncovered)uvxin the generated-project tests (matches the post-gen hook; avoids a strayVIRTUAL_ENVbreaking local runs)Testing
pydantic_aiwith--code-executionand with--skills(+ charts/AntV); compile, pass ruff + tytest_template_integration.pygreen (CrewAI ty skipped — known py3.14 limitation)test_config.py/test_cli.py/test_prompts.py— 227 passedmake lint(generator + generated backend)