litellm/tests/unit/integrations/lens/proxy
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
..
__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_adapter.py feat(lens): send the signed in user's name in the Lens login token (#53213) 2026-11-20 23:23:44 +00:00
test_buffering.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_tracing_endpoints.py feat(lens): strip agent harness context from what the gateway sends Lens (#53226) 2026-11-21 12:16:58 -08:00