-
Notifications
You must be signed in to change notification settings - Fork 1
🐛 PAF Core fails to route A2A requests to downstream agents in production (PAR mode) #9
Copy link
Copy link
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Summary
PAF Core Agent deployed via PAR/APKG fails to route user requests to configured downstream A2A agents (e.g., Vivid Commenter). Instead, PAF Core answers requests directly that should be delegated.
Root Cause
Architectural mismatch between development (main.py) and production (par_adapter.py):
- Development: Multi-agent components initialized once at app startup, reused across requests
- Production: UPEE Engine created per-request without registry/selector, discovery service never completes before shutdown
Evidence
- Logs show
a2a_agent_match: falsedespite Vivid Commenter being configured inA2A_AGENT_APPS - Discovery service lifecycle is per-request (starts at 00:39:45, shuts down at 00:39:54)
- Plan phase checks
if self.selector and self.registry:→ both areNone
Impact
- 100% routing failure in production
- Multi-agent coordination completely broken
- PAF Core cannot delegate specialized tasks
Proposed Solution
Add PAR application lifecycle hooks to par_adapter.py to initialize multi-agent components once at startup, store in app.state, and reuse across all requests.
Implementation Steps
- Add
startup()andshutdown()lifecycle hooks topar_adapter.py - Initialize discovery service, registry, selector, client pool in startup
- Update
UPEEEngineto accept optional multi-agent components - Wire components in
handle_chat_request(gRPC handler) - Update
ExecutePhaseto use client pool - Add comprehensive tests (unit, integration, E2E)
Files to Modify
src/par_adapter.py- Add lifecycle hooks, update handlersrc/core/upee_engine.py- Accept multi-agent componentssrc/core/plan.py- Add debug loggingsrc/core/execute.py- Use client pool
Timeline
Estimated 5-6 hours including implementation, testing, and validation
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working