litellm/tests/unit/integrations/lens
Kerry Lu 491ed5e49c
feat(lens): strip agent harness context from what the gateway sends Lens (#53226)
Claude Code puts project instructions, memory and status notes in
<system-reminder> blocks inside the user's own message, and Codex sends
its AGENTS.md and environment as separate user messages. The gateway
recorded both as if the user typed them, so Lens showed them in traces.

The Lens trace spans and spend rows now carry the conversation as the
user wrote it. Every complete harness block is removed from messages and
tool results, and a user turn that held nothing else is dropped. Each
known agent names its markers, and Codex envelopes are only removed for
Codex. The reminder stripper moves out of the complexity router into
litellm_core_utils/harness_context.py so both use one implementation,
and it now lowers only ASCII when matching so a character like "İ" no
longer shifts the cut.

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-11-21 12:16:58 -08:00
..
fixtures feat(lens): send the calling agent's framework, task and session on gateway traces (#53186) 2026-11-20 21:31:02 +00:00
proxy feat(lens): strip agent harness context from what the gateway sends Lens (#53226) 2026-11-21 12:16:58 -08:00
__init__.py feat(proxy): send gateway model calls to Lens as traces when the Lens store is connected (#53042) 2026-11-20 10:12:08 -08:00
test_config.py feat(proxy): send gateway model calls to Lens as traces when the Lens store is connected (#53042) 2026-11-20 10:12:08 -08:00
test_exporter.py fix(lens): send cost records to Lens without the conversation (#53274) 2026-11-20 18:23:36 -08:00
test_lens_trace_adapter.py feat(lens): strip agent harness context from what the gateway sends Lens (#53226) 2026-11-21 12:16:58 -08:00
test_otlp_http.py feat(proxy): send gateway model calls to Lens as traces when the Lens store is connected (#53042) 2026-11-20 10:12:08 -08:00
test_queries.py feat(proxy): send gateway model calls to Lens as traces when the Lens store is connected (#53042) 2026-11-20 10:12:08 -08:00
test_receiver.py feat(proxy): send gateway model calls to Lens as traces when the Lens store is connected (#53042) 2026-11-20 10:12:08 -08:00
test_remote.py feat(proxy): send gateway model calls to Lens as traces when the Lens store is connected (#53042) 2026-11-20 10:12:08 -08:00
test_storage.py feat(proxy): send gateway model calls to Lens as traces when the Lens store is connected (#53042) 2026-11-20 10:12:08 -08:00