Repository navigation
feat(observability): add agent observation recorder - #385
Conversation
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThis PR introduces a session-turn-scoped observation recording system that captures LLM usage, tool interactions, and turn lifecycle events, sanitizes them to remove sensitive data, persists them locally to JSONL, and allows controlled export to Langfuse and OTLP endpoints. ChangesAgent Observation Recording
Sequence Diagram(s)The sequence diagram above illustrates the complete observation lifecycle: Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes This PR introduces a comprehensive observability layer with multiple interacting components: an event model and storage protocol, a recording system with sanitization logic, export gates, adapter integration, and SessionManager orchestration. The sanitization pipeline includes careful key/value filtering with regex rules and forbidden-substring checks. OTLP export controls add recursive payload validation with Langfuse-specific allowlisting. While individual pieces are straightforward, the cross-file coordination, safety guarantees, and integration points across adapter/session/observability layers demand careful review of the full flow. Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
AgentObservationRecorderwith append-only JSONL events for realtime crash/failure localization.langfuse.observation.input/outputonly for schema-validated sanitized turn projections, documented in ADR-0049.Test Plan
uv run pytest tests/ -quv run pytest tests/coding_agent/test_agent_observability.py tests/coding_agent/test_observability.py tests/ui/test_session_manager_runtime.py tests/coding_agent/test_pipeline_adapter.py tests/coding_agent/test_release_observability_contract.py -quv run pytest tests/coding_agent/action_safety/test_action_observability.py tests/coding_agent/action_safety/test_safe_action_smoke.py tests/coding_agent/test_bootstrap.py -quv run pytest tests/ui/test_http_server_failover.py tests/ui/test_session_manager_public_api.py -quv run ruff check src/coding_agent/agent_observability.py src/coding_agent/adapter.py src/coding_agent/server/session_manager.py src/coding_agent/observability.py tests/coding_agent/test_agent_observability.py tests/ui/test_session_manager_runtime.pyuv run ruff format --check src/coding_agent/agent_observability.py src/coding_agent/adapter.py src/coding_agent/server/session_manager.py tests/coding_agent/test_agent_observability.py tests/ui/test_session_manager_runtime.pygit diff --check -- .Summary by CodeRabbit
Release Notes
New Features