- WebSocket connection to
/workerwith Phoenix channel protocol - Agent + tool registration on join
llm_taskhandling (calls Anthropic API)tool_taskhandling (calls local tool functions, sync + async)- Heartbeat, auto-reconnect
@tooldecorator with JSON Schema inference from type hintsAgentdataclass with all AgentDef fields
- HTTP client with auth (
httpx) list_agents(),get_agent(id_or_name)send_message()with fire-and-forget andwait=True(polling)get_run(),get_events()list_conversations(),get_conversation(),delete_conversation()stream()via WebSocket (generator yieldingStreamEvent)- Response models (
RunResponse,EventResponse, etc.) - Error handling, context manager
- 29 tests passing (agent, schema, client with HTTP mocking)
1. Agent lookup by name — NICE TO HAVE
The client resolves names by listing all agents and filtering. This works but is O(n). Add GET /api/v1/agents?name=support-bot or make GET /api/v1/agents/:id accept a name string.
3. End-to-end integration test — IMPORTANT
No test actually connects to a running Norns instance. We have unit tests with HTTP mocking, but no proof that the SDK talks to the real server correctly. Need:
- A test that starts Norns (via docker compose), creates a tenant, runs a worker, sends a message via the client, and verifies the result
- Can be a separate test suite that requires
NORNS_URLto be set
4. Worker: handle agent registration response — MINOR
The worker sends agents in the join payload but doesn't check if the server accepted them. Should validate the join reply and log/raise if registration failed.
5. Worker: rate limit handling — MINOR
When the Anthropic API returns 429, the worker returns the error to the orchestrator. But the worker could handle retries locally (with backoff) instead of pushing the problem back to the orchestrator. This would make the rate limit invisible to Norns.
6. Worker: graceful shutdown — MINOR
norns.run() blocks forever with no way to stop cleanly. Should handle SIGINT/SIGTERM, finish in-progress tasks, then disconnect.
7. Pydantic support for tool schemas — NICE TO HAVE
Currently schemas are inferred from type hints only. If a user passes a Pydantic model as a type hint, the SDK should use model.model_json_schema() to generate the schema. Check if Pydantic is installed and use it opportunistically.
8. Multiple agents per worker — NICE TO HAVE
Currently norns.run(agent) takes one agent. Should support norns.run([agent1, agent2]) for workers that handle multiple agent types.
9. Publish to PyPI — when ready for external users
10. Add examples directory — concrete examples:
examples/slack_bot.py— Slack integrationexamples/research_agent.py— multi-step researchexamples/support_bot.py— customer support with tools
- End-to-end integration test (proves the whole thing works)
- Worker graceful shutdown (SIGINT handling)
- Examples (shows people how to use it)
- Everything else