fix: align peer_bus signature, bot presence SQL, XML-RPC timeout
- All specialist agents: handle_peer_request(request_type, params, directive_id) replaces handle_peer_request(request: dict) so callers pass structured args - ab_ai_bot: force-write bus_presence.status via SQL so Odoo 18 WebSocket presence shows the correct colour immediately (ORM compute does not trigger on last_poll writes) - odoo_client: wrap XML-RPC executor calls in asyncio.wait_for to enforce timeout Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -115,14 +115,13 @@ class CrmAgent(BaseAgent):
|
||||
raise ValueError(f'Unknown tool: {name}')
|
||||
return await dispatch[name](**args)
|
||||
|
||||
async def handle_peer_request(self, request: dict) -> dict:
|
||||
req_type = request.get('type', '')
|
||||
async def handle_peer_request(self, request_type: str, params: dict, directive_id: str) -> dict:
|
||||
try:
|
||||
if req_type == 'pipeline_summary':
|
||||
if request_type == 'pipeline_summary':
|
||||
return await self._ct.get_pipeline_summary()
|
||||
if req_type == 'opportunities':
|
||||
return {'opportunities': await self._ct.get_opportunities(user_id=request.get('user_id'))}
|
||||
return {'error': f'Unknown type: {req_type}'}
|
||||
if request_type == 'opportunities':
|
||||
return {'opportunities': await self._ct.get_opportunities(user_id=params.get('user_id'))}
|
||||
return {'error': f'Unknown type: {request_type}'}
|
||||
except Exception as exc:
|
||||
return {'error': str(exc)}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user