Skip to content

feat: Honour X-Cortex-Record: off on the ext_proc listener #1960

Open

Description

@michaljacovi

Follow-up to #1959 (part of #1923).

Problem

#1959 withholds a session from the archive when a request carries
X-Cortex-Record: off and names its own session with a session-id header
(Context.WithholdsSession). The ext_proc listener (envoy-sidecar mode)
never pins a naming header: it has no session.id_headers setting, never
calls SetAttribution, and files outbound rows under ActiveSession(). So
there the opt-out never applies. The header is still stripped, including for
skip_hosts destinations, so it never reaches the upstream.

Proposal

  • Give ext_proc the session-id header list the forward proxy has, and call
    SetAttribution before the pipeline runs (the first call wins), so
    WithholdsSession sees the request's own session.
  • File outbound rows under that session when it is named, as the forward
    proxy does.
  • Test: through ext_proc, a request that names its session and sends off
    produces rows with NoRecord; a request that names none still records.

Open questions

  • Inbound traffic: should the A2A contextId count as the request naming its
    own session, so an inbound A2A call can opt out too?
  • Does a sidecar deployment want per-session opt-out at all, or is it a
    laptop feature?

Out of scope

Assisted-By: Claude (Anthropic AI) noreply@anthropic.com

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions