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:
2026-05-19 23:02:51 -04:00
parent 93f2a101fa
commit 233f461480
9 changed files with 69 additions and 59 deletions

View File

@@ -119,14 +119,13 @@ class SalesAgent(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 == 'sales_summary':
if request_type == 'sales_summary':
return await self._st.get_sales_summary()
if req_type == 'customer_orders':
return {'orders': await self._st.get_customer_orders(partner_id=request['partner_id'])}
return {'error': f'Unknown type: {req_type}'}
if request_type == 'customer_orders':
return {'orders': await self._st.get_customer_orders(partner_id=params['partner_id'])}
return {'error': f'Unknown type: {request_type}'}
except Exception as exc:
return {'error': str(exc)}