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

@@ -120,16 +120,15 @@ class AccountingAgent(BaseAgent):
return await self._at.post_chatter_note(**args)
raise ValueError(f'Unknown tool: {name}')
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 == 'trial_balance':
if request_type == 'trial_balance':
return {'trial_balance': await self._at.get_trial_balance()}
if req_type == 'account_balance':
return await self._at.get_account_balance(account_id=request['account_id'])
if req_type == 'tax_summary':
if request_type == 'account_balance':
return await self._at.get_account_balance(account_id=params['account_id'])
if request_type == 'tax_summary':
return await self._at.get_tax_summary()
return {'error': f'Unknown type: {req_type}'}
return {'error': f'Unknown type: {request_type}'}
except Exception as exc:
return {'error': str(exc)}