Repository navigation
v2.10.0
Agent logs that identify themselves (v2.10.0)
Added
- guard-agent log lines now carry an origin prefix.
setup_agent_loggingattaches guard-core's standard formatter ([guard_agent.client] 2026-09-01 12:00:00 - WARNING - ...) to theguard_agentlogger tree, so agent records such asEvents flush recovered after N consecutive partial failure(s)are identifiable in hosted log viewers instead of arriving bare. It runs automatically when aGuardAgentHandlerorSyncGuardAgentHandleris constructed, and the function is exported for explicit host use:setup_agent_logging(log_file=..., log_format="json"). - JSON output and an optional file sink.
log_format="json"emits{"timestamp", "level", "logger", "message"};log_file=...adds aFileHandleralongside the console handler. A console handler is only attached when the root logger has no handlers, matching guard-core's yield-to-host contract, so records still reach host-configured logging through propagation.
Changed
- The automatic setup is non-destructive: hosts keep their logging configuration. Constructing the handler attaches at most one console handler, never changes a level the host set, and never removes a host-configured file handler or formatter, no matter how many times the handler is constructed. Hosts reconfigure by calling
setup_agent_logging(...)explicitly, which re-applies intent (agent handlers are cleared first). - The old async
setup_agent_loggingstub inguard_agent.utilsis gone. It was never called and had zero consumers across the ecosystem, and its export now points at the real implementation inguard_agent.logging_utils. The signature changed fromasync (log_level: str)to(log_file: str | None, log_format: str, *, reconfigure: bool).
Internal (v2.10.0)
- pytest now runs with
filterwarnings = ["error"], so any warning, including one raised at import/collection time, fails the suite instead of passing silently. - That escalation surfaced a real resource leak:
tests/test_adapter_fastapi.py'sSecurityConfigdidn't disable Redis, leaving an unclosed async Redis socket to raise aResourceWarningat a later, unrelated test's garbage collection. Addedenable_redis=False, the same fix already applied totest_performance.pyin v2.3.0 to eliminate ResourceWarning pollution.
What's Changed
- chore(conventions): scaffold .roboco/conventions.yml by @roboco-app[bot] in #48
- Bump actions/github-script from 7 to 9 by @dependabot[bot] in #46
- Bump github/codeql-action from 4.37.8 to 4.37.9 by @dependabot[bot] in #47
- feat(logging): identifiable agent logs with non-destructive setup (v2.10.0) by @rennf93 in #49
New Contributors
- @roboco-app[bot] made their first contribution in #48
Full Changelog: 2.9.1...2.10.0