a2a-loopback-tests
Skill8 starsChanged 5 months agoMITView on GitHub
Use this skill in test-author mode when writing integration tests that exercise multiple agents without Docker.
In this repository8 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- aca-bicepSkill
- aks-helmSkill
- copilot-sdk-gpt55Skill
- maf-agent-skeletonSkill
- mcp-server-skeletonSkill
- pydantic-contractsSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 0 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 3
Use this skill in test-author mode when writing integration tests that exercise multiple agents without Docker.
- Very specific: line 46
Never: import GitHubCopilotAgent directly in a test — always patch its import site so the real SDK / Node CLI never runs.
- Very specific: line 47
Never: start a real network server (no uvicorn.run).
- Very specific: line 48
Do not patch MCPStreamableHTTPTool — it is not used in this repo.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Skill: A2A Loopback Tests
Use this skill in test-author mode when writing integration tests that exercise multiple agents without Docker.
The fixture
# tests/integration/conftest.py
import httpx
import pytest
from httpx import ASGITransport
from agent_framework.testing import MockChatClient
from src.agents.inventory.server import app as inventory_app
from src.agents.supplier.server import app as supplier_app
# ...orchestrator etc.
@pytest.fixture
async def fleet(monkeypatch):
# 1. Patch GitHubCopilotAgent at every agent's import site so the
# real SDK / bundled Node CLI never starts.
fake = MockChatClient() # exposes async .run(message) -> AgentResponse[None]
for mod in (
"src.agents.inventory.agent",
"src.agents.supplier.agent",
"src.agents.logistics.agent",
"src.agents.pricing.agent",
"src.agents.orchestrator.agent",
):
monkeypatch.setattr(f"{mod}.GitHubCopilotAgent", lambda **_: fake)
# 2. Mount each FastAPI app behind ASGITransport.
clients = {
"inventory": httpx.AsyncClient(transport=ASGITransport(app=inventory_app),
base_url="http://inventory"),
# ... etc
}
yield clients
for c in clients.values():
await c.aclose()Rules
- Never import
GitHubCopilotAgentdirectly in a test — always patch its import site so the real SDK / Node CLI never runs. - Never start a real network server (no
uvicorn.run). ASGITransport only. - Do not patch
MCPStreamableHTTPTool— it is not used in this repo. MCP wiring lives insideGitHubCopilotOptions(mcp_servers={...}); the agent is already mocked at step 1, so MCP is short-circuited automatically. - Assert structure (
response.json()["tool_calls"]) and keyword presence ("store-101" in response.json()["output"]). No exact string equality. - Mark every test
pytest.mark.asyncio(or rely onasyncio_mode = "auto"inpyproject.toml).
Eval runner shape
# tests/evals/run_evals.py
async def run() -> int:
failures = 0
async with httpx.AsyncClient(base_url=os.environ.get("ZAVA_ENDPOINT", "http://localhost:8000")) as c:
for line in scenarios_path.read_text().splitlines():
sc = json.loads(line)
r = (await c.post("/invoke", json={"run_id": sc["id"], "goal": sc["goal"]})).json()
failures += not all(kw in r["output"] for kw in sc["must_mention"])
failures += not set(sc["must_call"]).issubset(set(r["tool_calls"]))
return failuresDoes it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

