fix(agent): import SimpleNamespace for hook payload sanitization
_hook_jsonable() referenced SimpleNamespace without importing it, so sanitizing any hook payload that contained one raised NameError: name 'SimpleNamespace' is not defined. Bedrock, Codex-responses, and the auxiliary client build their response / message / tool_call objects as SimpleNamespace and hand the raw objects to the post_api_request hook. The hook call sites swallow exceptions (except Exception: pass), so the crash silently dropped the observability hook for those providers. Add the missing `from types import SimpleNamespace` and a regression test covering the SimpleNamespace sanitization path.
This commit is contained in:
@@ -60,6 +60,7 @@ from typing import List, Dict, Any, Optional
|
||||
# ModuleNotFoundError on broken/partial installs where `fire` isn't present.
|
||||
from datetime import datetime
|
||||
from pathlib import Path
|
||||
from types import SimpleNamespace
|
||||
|
||||
from hermes_constants import get_hermes_home
|
||||
|
||||
|
||||
Reference in New Issue
Block a user