Skip to content

fix(logging): omit API and stream payloads - #435

Open
harvhan wants to merge 5 commits into
harvhan/runtime-observability-adapterfrom
codex/log-payload-cleanup
Open

harvhan wants to merge 5 commits into
harvhan/runtime-observability-adapterfrom
codex/log-payload-cleanup

Conversation

@harvhan

@harvhan harvhan commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Pull Request Summary

Replace selected API, HTTP client, ACP, and Redis log calls with fixed templates and safe metadata instead of bodies, URLs, or exception values.

This PR follows #434. Its base is that PR's branch; merge #434 first, then retarget this PR to main. It includes the adapter foundation, predicate rename, and native-handler fix; application log-call cleanup stays in this follow-up.

Changes

  • Remove payloads, headers, query values, and raw URLs from selected log calls.
  • Keep methods, status, request IDs, bounded topics, sizes, and error types where available. Preserve safe context in local text logs.
  • Keep telemetry configuration and metrics adoption in feat(api): add optional observability adapter #434.

Test Plan

  • Unit: 13 focused payload and adapter checks passed against the updated foundation, including repeated logger creation and module reloads.
  • Integration: two Uvicorn workers passed payload absence, request/response counts, request-ID, and lifecycle checks.
  • Ruff, formatting, and whitespace checks passed.

This covers selected log calls, not a repository-wide payload audit. No logging-lint tooling or CI baseline is included.

RetriggerConfidence Score: 5/5

The PR appears safe to merge. No new blocking issue was found.

What we checked:

  • Private payloads stay out of logs: No. These calls log the route template, sizes, status, method, and request ID. They do not attach bodies, headers, query values, or raw URLs.

Summary

Selected logs now omit request, stream, and exception contents while keeping safe metadata for tracing and operations.

  • API logs keep route templates, methods, request IDs, status codes, and request sizes instead of bodies, headers, or query values.
  • HTTP, Redis, and ACP logs use fixed messages with bounded topics, sizes, methods, statuses, and error types.
  • Tests check that a private payload marker stays out of captured logs while data still reaches its destination.
Diagram
sequenceDiagram
    participant Client
    participant Route as LoggedAPIRoute
    participant Handler
    participant Downstream as ACP/HTTP/Redis

    Client->>Route: Request with headers, query, and body
    Route->>Route: Log method, route template, size, request ID
    Route->>Handler: Forward full request
    Handler->>Downstream: Send required payload
    Downstream->>Downstream: Log safe metadata only
    Downstream-->>Handler: Result or stream chunks
    Handler-->>Route: Response
    Route->>Route: Log status, method, route template, request ID
    Route-->>Client: Full response
Loading

Reviews (5) · Last reviewed commit: "Merge branch 'harvhan/runtime-observabil..."

Use fixed messages and metadata for request, HTTP, ACP, and Redis logs. Keep request handling and streaming behavior unchanged. This cleanup follows the optional observability adapter.
@harvhan
harvhan requested a review from a team as a code owner September 17, 2026 20:06
Comment thread agentex/src/api/logged_api_route.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant