Fix agent config handler registration, remove debug prints, disable RabbitMQ heartbeats (#764)

- Fix agent react and orchestrator services appending bare methods
  to config_handlers instead of using register_config_handler() —
  caused 'method object is not subscriptable' on config notify
- Add exc_info to config fetch retry logging for proper tracebacks
- Remove debug print statements from collection management
  dispatcher and translator
- Disable RabbitMQ heartbeats (heartbeat=0) to prevent broker
  closing idle producer connections that can't process heartbeat
  frames from BlockingConnection
This commit is contained in:
cybermaggedon 2026-04-07 12:11:12 +01:00 committed by GitHub
parent f0c9039b76
commit 2f8d6a3ffb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 9 additions and 8 deletions

View file

@ -172,7 +172,8 @@ class AsyncProcessor:
except Exception as e: except Exception as e:
logger.warning( logger.warning(
f"Config fetch failed: {e}, retrying in 2s..." f"Config fetch failed: {e}, retrying in 2s...",
exc_info=True
) )
await asyncio.sleep(2) await asyncio.sleep(2)

View file

@ -288,6 +288,7 @@ class RabbitMQBackend:
port=port, port=port,
virtual_host=vhost, virtual_host=vhost,
credentials=pika.PlainCredentials(username, password), credentials=pika.PlainCredentials(username, password),
heartbeat=0,
) )
logger.info(f"RabbitMQ backend: {host}:{port} vhost={vhost}") logger.info(f"RabbitMQ backend: {host}:{port} vhost={vhost}")

View file

@ -79,7 +79,6 @@ class CollectionManagementResponseTranslator(MessageTranslator):
def encode(self, obj: CollectionManagementResponse) -> Dict[str, Any]: def encode(self, obj: CollectionManagementResponse) -> Dict[str, Any]:
result = {} result = {}
print("COLLECTIONMGMT", obj, flush=True)
if obj.error is not None: if obj.error is not None:
result["error"] = { result["error"] = {
@ -99,6 +98,4 @@ class CollectionManagementResponseTranslator(MessageTranslator):
"tags": list(coll.tags) if coll.tags else [] "tags": list(coll.tags) if coll.tags else []
}) })
print("RESULT IS", result, flush=True)
return result return result

View file

@ -93,7 +93,9 @@ class Processor(AgentService):
# Meta-router (initialised on first config load) # Meta-router (initialised on first config load)
self.meta_router = None self.meta_router = None
self.config_handlers.append(self.on_tools_config) self.register_config_handler(
self.on_tools_config, types=["tool", "tool-service"]
)
self.register_specification( self.register_specification(
TextCompletionClientSpec( TextCompletionClientSpec(

View file

@ -81,7 +81,9 @@ class Processor(AgentService):
# Track active tool service clients for cleanup # Track active tool service clients for cleanup
self.tool_service_clients = {} self.tool_service_clients = {}
self.config_handlers.append(self.on_tools_config) self.register_config_handler(
self.on_tools_config, types=["tool", "tool-service"]
)
self.register_specification( self.register_specification(
TextCompletionClientSpec( TextCompletionClientSpec(

View file

@ -28,9 +28,7 @@ class CollectionManagementRequestor(ServiceRequestor):
self.response_translator = TranslatorRegistry.get_response_translator("collection-management") self.response_translator = TranslatorRegistry.get_response_translator("collection-management")
def to_request(self, body): def to_request(self, body):
print("REQUEST", body, flush=True)
return self.request_translator.decode(body) return self.request_translator.decode(body)
def from_response(self, message): def from_response(self, message):
print("RESPONSE", message, flush=True)
return self.response_translator.encode_with_completion(message) return self.response_translator.encode_with_completion(message)