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

@@ -115,15 +115,14 @@ class ProjectAgent(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 == 'project_list':
if request_type == 'project_list':
return {'projects': await self._pt.get_projects()}
if req_type == 'task_count':
tasks = await self._pt.get_tasks(project_id=request.get('project_id'))
if request_type == 'task_count':
tasks = await self._pt.get_tasks(project_id=params.get('project_id'))
return {'count': len(tasks)}
return {'error': f'Unknown type: {req_type}'}
return {'error': f'Unknown type: {request_type}'}
except Exception as exc:
return {'error': str(exc)}