Repository navigation
feat(agents): add the Pydantic AI agent - #338
mpfaffenberger wants to merge 2 commits into
Conversation
Ship a Pydantic AI agent in the agents bundle, beside Claude Code and the others, at @local/agentenv-framework/agents/pydantic-ai (alias `pydantic-ai`). The agent-env protocol SDK serves the A2A endpoint and its extensions; each turn runs a Pydantic AI Agent in process with the Pydantic AI Harness Coder tools (shell, file tools, sub-agents) in a LocalWorkspace, the task's MCP servers as MCPToolsets and installed skills through the harness's Skills. A context's message history is persisted, so later turns continue it, its messages are the live trajectory, and snapshots carry it with the files attached in it. The model is called through the [model] endpoint as an OpenAI-compatible one; a `vllm:` prefix picks Pydantic AI's vLLM provider. Pydantic AI's own Agent.to_a2a is not used: it serves plain A2A, without the agent-env extensions the validator checks. Also: the fake OpenAI endpoint answers streamed requests with server-sent chunks, which Pydantic AI always asks for.
…hreaded writes before a cancel lets go of the locks A snapshot whose messages.json was JSON but not Pydantic AI messages replaced the conversation and workspace, then failed the next turn; the runtime now validates the messages before anything is replaced. A turn or snapshot cancelled while a thread wrote its files released its locks before the write ended; to_completion waits for the thread before re-raising.
|
🤖 Automated Claude routine — Env Pod PR Context Review. This is a bot, not Edgar Arakelyan; not a human review. Context from a sibling PR and from #345 adds a second agent (
Separately, this branch looks behind bundles = [image.name for image in BUNDLE_IMAGES]
…
assert "agentenv-gateway" in planned["infra"] and bundles == [
"agentenv-claude-code", "agentenv-codex", "agentenv-gemini", "agentenv-opencode", "agentenv-openhands",
"agentenv-pi", "agentenv-proxy", "agentenv-mail-mcp"]So after a rebase the list also needs Each reviewer sees one diff at a time, so none of this shows up on either PR on its own. Offering the comparison, not a verdict on merge order. Generated by Claude Code |
Ship a Pydantic AI agent in the agents bundle, beside Claude Code and the others, at
@local/agentenv-framework/agents/pydantic-ai (alias
pydantic-ai).The agent-env protocol SDK serves the A2A endpoint and its extensions; each turn runs a Pydantic AI
Agent in process with the Pydantic AI Harness Coder tools (shell, file tools, sub-agents) in a
LocalWorkspace, the task's MCP servers as MCPToolsets and installed skills through the harness's
Skills. A context's message history is persisted, so later turns continue it, its messages are the
live trajectory, and snapshots carry it with the files attached in it. The model is called through
the [model] endpoint as an OpenAI-compatible one; a
vllm:prefix picks Pydantic AI's vLLM provider.Pydantic AI's own Agent.to_a2a is not used: it serves plain A2A, without the agent-env extensions
the validator checks.
Also: the fake OpenAI endpoint answers streamed requests with server-sent chunks, which Pydantic AI
always asks for.
Verified: unit tests (
tst/unit/agents/pydantic_ai, 34),tst/integration/cli/run_bundle_pydantic_ai_test.py(6, real Docker against the fake OpenAI endpoint),ruff check, andagent-env a2a-agent validatelocally against an OpenAI-compatible vLLM endpoint: every extension the agent advertises passed (agent-config, mcp-config, trajectory, skill-config, snapshot, peer-agents, install/v1); the snapshot changelog is not implemented, as for OpenHands.The PR still needs protection against a second cancellation while a threaded write finishes.
Summary
Adds a Pydantic AI coding agent to the shipped bundle.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart LR A[A2A task] --> B[Pydantic AI agent] B --> C[Model endpoint] B --> D[Coding tools, MCP tools, and skills] B --> E[Saved conversation and attachments] E --> F[Snapshot save and restore]Reviews (2) · Last reviewed commit: "fix(agents): validate a snapshot's Pydan..." · Reviewed by Greptile