Repository navigation
feat(agents): add the Pydantic AI agent - #338
Open
mpfaffenberger wants to merge 2 commits into
Open
mpfaffenberger wants to merge 2 commits into
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.
This branch has not been deployed
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.
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