Repository navigation
fix: serve a2a/unified and agent register route deliver what they advertise - #5974
Conversation
…ertise (fixes #5973) - serve a2a: message/send runs the --file agents YAML via praisonai.arun instead of echoing; missing file rejected; non-localhost requires --api-key. - serve unified: mounts POST /agents and /a2a when --file exists; discovery, banner and / list only mounted providers (recipe/mcp are separate servers). - POST /agents/{id}/register returns 501 instead of a no-op 200. - discovery/health handlers annotate Request so FastAPI no longer 422s. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
|
@coderabbitai review |
|
/review |
|
|
ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing |
[Medium impact] The PR appears safe to merge; both previous findings are addressed and no new actionable issues were found. SummaryThe PR makes the advertised serve routes run their workflows and returns 501 for unsupported HTTP registration.
Reviews (2) · Last reviewed commit: "fix: reject non-object /agents bodies an..." · Reviewed by Greptile |
|
@claude You are the FINAL architecture reviewer. If the branch is under MervinPraison/PraisonAI (not a fork), you are able to make modifications to this branch and push directly. SCOPE: Review changes in this PR. Python SDK: praisonaiagents, praisonai. TypeScript SDK: src/praisonai-ts/. Do NOT modify src/praisonai-rust. Read ALL comments above from Gemini, Qodo, CodeRabbit, and Copilot carefully before responding. MANDATORY READ (before reviewing):
Phase 1: Review per AGENTS.md
MANDATORY COMMENT FORMAT — include this Phase 1 table in your review comment: Phase 1 — AGENTS.md review
For TypeScript PRs (src/praisonai-ts/), also add: Phase 2: FIX Valid Issues Phase 3: Final Verdict |
…lient errors Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Final architecture review — PR #5974Phase 1 — AGENTS.md review
Phase 2 — Fixes pushed (71e47ff)
Tests: Skipped: nothing from reviewer feedback. CodeRabbit and Qodo raised no actionable items. Phase 3 — Verdict✅ Approve. Every Phase 1 row passes and both review findings are fixed. |
|
Merge gate scan — eligible for assessment. Claude merge gate will assess and may auto-merge on an APPROVE verdict. |
|
MERGE_GATE_VERDICT: APPROVE
|
|
Merged by Claude PR merge gate ( |
Fixes #5973
All changes are in the wrapper (
src/praisonai). There are no new dependencies and no changes to the core SDK orAgent.Changes
praisonai serve a2a:message/sendnow runs the--fileagents YAML viapraisonai.arun. This is the same YAML-to-agent path thatserve agentsfalls back to. Before, it returnedReceived: <text>.-32602.-32603./a2anow runs tools, binding to a non-localhost host requires--api-key(orPRAISONAI_SERVE_API_KEY), the same ruleserve agentsandserve unifieduse.--api-keywas already listed as a common option.praisonai serve unified: the server now advertises only what it mounts.--fileexists, it mountsPOST /agentsandPOST /a2a.a2u./. They run as their own servers (serve recipe,praisonai mcp serve), so mounting them here would duplicate those servers.serveAPI-key gate is now in one shared helper (_resolve_api_key), so both commands use it.POST /api/v1/agents/{id}/register: now returns501instead of a200that registered nothing. Agents are registered in-process withregister_agent(...).main:add_discovery_routesdidn't annotaterequest. As a result, FastAPI returned 422 for/__praisonai__/discoveryand/healthon every FastAPI serve app. The handlers now annotaterequest: Request.Tests
New
tests/unit/test_serve_surfaces_honest.py(7 tests) checks that:The new tests pass. These failures also happen on unmodified
main:test_n8n_agent_invoke(they don't setCALL_SERVER_TOKEN).jobs/test_router.test_code_reachability.test_serve_recipe_gateway_split.test_fast_contextin the core SDK.🤖 Generated with Claude Code