feat: trace post processing and Valkey sessions - #345
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
|
Additional local verification for the current head
|
|
Addressed the Devin finding at current head 66dfa0c:
Evidence: LineageWeave focused HTTP, observability, and Valkey worker suite 51 passed; changed observability files Ruff checks passed. |
|
Current-head audit and root-cause repair (2026-08-21):
Merge remains gated: |
|
Restacked on the repaired parent #329 without force-push.
Required hosted Checks are queued and formal independent approval is still absent; do not merge yet. |
…nto HEAD # Conflicts: # tests/test_post_content_worker.py
|
Restacked normally onto repaired parent #329 exact head Verification on exact stack: full backend suite |
|
Current-head OTEL evidence for
|
* fix: keep internal image instructions out of buyer evidence * fix: protect persisted image region captions * fix: preserve legitimate Korean image captions * docs: allocate unique buyer image ADR number * fix: reject invalid vision region response types * fix: block internal vision destinations * fix: keep provider failures out of buyer errors * feat: trace post processing and Valkey sessions (#345) * feat: trace post processing and valkey sessions * docs: align orchestrator runtime pin * docs: codify telemetry boundary * fix: normalize OTLP trace endpoint * chore: pin orchestrator telemetry fix * fix: keep provider details out of ingestion ledger * fix: propagate W3C trace context to gateway
* fix: reject unbounded visual locator regions * docs: refresh exact-head product gap audit * test: cover visual region fallback branches * fix: fall back from malformed visual locator output * docs: refresh visual locator exact-head evidence * test: keep invalid locator fallback coordinate-free * docs: keep PR 320 status under its checkpoint * docs: refresh PR 324 exact-head evidence * fix: safely handle malformed region locator output * fix: keep internal image instructions out of buyer evidence (#329) * fix: keep internal image instructions out of buyer evidence * fix: protect persisted image region captions * fix: preserve legitimate Korean image captions * docs: allocate unique buyer image ADR number * fix: reject invalid vision region response types * fix: block internal vision destinations * fix: keep provider failures out of buyer errors * feat: trace post processing and Valkey sessions (#345) * feat: trace post processing and valkey sessions * docs: align orchestrator runtime pin * docs: codify telemetry boundary * fix: normalize OTLP trace endpoint * chore: pin orchestrator telemetry fix * fix: keep provider details out of ingestion ledger * fix: propagate W3C trace context to gateway
* fix: retain partial image regions * docs: record partial image region gap * test: cover partial parent vision failure * fix: safely handle malformed region locator output * style: use deferred region result annotation * docs: reconcile partial-region evidence counts * fix: validate retained visual locator regions (#324) * fix: reject unbounded visual locator regions * docs: refresh exact-head product gap audit * test: cover visual region fallback branches * fix: fall back from malformed visual locator output * docs: refresh visual locator exact-head evidence * test: keep invalid locator fallback coordinate-free * docs: keep PR 320 status under its checkpoint * docs: refresh PR 324 exact-head evidence * fix: safely handle malformed region locator output * fix: keep internal image instructions out of buyer evidence (#329) * fix: keep internal image instructions out of buyer evidence * fix: protect persisted image region captions * fix: preserve legitimate Korean image captions * docs: allocate unique buyer image ADR number * fix: reject invalid vision region response types * fix: block internal vision destinations * fix: keep provider failures out of buyer errors * feat: trace post processing and Valkey sessions (#345) * feat: trace post processing and valkey sessions * docs: align orchestrator runtime pin * docs: codify telemetry boundary * fix: normalize OTLP trace endpoint * chore: pin orchestrator telemetry fix * fix: keep provider details out of ingestion ledger * fix: propagate W3C trace context to gateway
* fix: separate source whitespace from explicit structure * docs: record source indentation buyer gap * fix: expose unexpected content channel defects * fix: expose recoverable content batch failures * docs: normalize gap baseline headings * fix: retain partial visual regions (#320) * fix: retain partial image regions * docs: record partial image region gap * test: cover partial parent vision failure * fix: safely handle malformed region locator output * style: use deferred region result annotation * docs: reconcile partial-region evidence counts * fix: validate retained visual locator regions (#324) * fix: reject unbounded visual locator regions * docs: refresh exact-head product gap audit * test: cover visual region fallback branches * fix: fall back from malformed visual locator output * docs: refresh visual locator exact-head evidence * test: keep invalid locator fallback coordinate-free * docs: keep PR 320 status under its checkpoint * docs: refresh PR 324 exact-head evidence * fix: safely handle malformed region locator output * fix: keep internal image instructions out of buyer evidence (#329) * fix: keep internal image instructions out of buyer evidence * fix: protect persisted image region captions * fix: preserve legitimate Korean image captions * docs: allocate unique buyer image ADR number * fix: reject invalid vision region response types * fix: block internal vision destinations * fix: keep provider failures out of buyer errors * feat: trace post processing and Valkey sessions (#345) * feat: trace post processing and valkey sessions * docs: align orchestrator runtime pin * docs: codify telemetry boundary * fix: normalize OTLP trace endpoint * chore: pin orchestrator telemetry fix * fix: keep provider details out of ingestion ledger * fix: propagate W3C trace context to gateway
) * feat: trace post processing and valkey sessions * docs: align orchestrator runtime pin * docs: codify telemetry boundary * fix: normalize OTLP trace endpoint * chore: pin orchestrator telemetry fix * fix: keep provider details out of ingestion ledger * fix: propagate W3C trace context to gateway
* feat: trace post processing and Valkey sessions (#345) * feat: trace post processing and valkey sessions * docs: align orchestrator runtime pin * docs: codify telemetry boundary * fix: normalize OTLP trace endpoint * chore: pin orchestrator telemetry fix * fix: keep provider details out of ingestion ledger * fix: propagate W3C trace context to gateway * fix: classify server failures in OTel telemetry * fix: redact worker failure details * fix: flush telemetry and label TEPP transport * fix: harden OpenTelemetry failure boundaries * fix: ignore unsupported telemetry attribute keys * test: enforce printable telemetry session ids * fix(otel): retain endpoint operation diagnostics * fix(frontend): keep admin controls behind authentication * fix(oidc): retain validated login return URLs * fix(otel): suppress automatic exception values in spans * fix: classify worker provider failures * fix(otel): classify type errors as internal * fix(otel): suppress idle spans and mark HTTP errors * fix(otel): pass exporter endpoint to orchestrator * fix(otel): trace Valkey read failures * fix: retry transient broker outages * fix(docs,tests): rename buyer-safe to reader-safe per ADR 0119 ADR 0119 retired "buyer" project-wide the day before this PR's ADR 0122 and tests/test_server_diagnostics.py introduced it again in a non-exempt new ADR and new source identifiers. Rename to "reader-safe" to keep `grep -ri buyer` clean outside the ADR 0119-exempted historical ADRs, CHANGELOG*, and fixture/test domain content. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B5M79L945DMyMs3sg5yJ14 * fix(otel): correlate Error spans with TraceId and SpanId Record classified Ask and post-chat failures inside the API span so structured logs share the same W3C TraceId and SpanId. Inject traceparent on GET as well as POST, export OTLP logs when an endpoint is set, and keep a blank Compose interpolation from wiping orchestrator env_file telemetry. * fix(otel): sort imports and wrap ruff line-length in Ask HTTP paths Keep backend.app.main and the HTTP client import-sorted and wrap the over-length lines in the classified Ask/chat and GET tracing paths so the diagnostics change is ruff-clean on the files it touches. * test(otel): require Valkey xadd to run under a child span Assert the activity XADD span id differs from the parent so removing the traced() wrapper cannot pass by inheriting the parent span. * fix(otel): label GET peers and keep session headers on orchestrator OIDC, Searxng, and CalDAV GETs now set a bounded service.peer.name instead of inheriting contextual-orchestrator. The post session header stays on orchestrator and TEPP only; W3C traceparent still propagates. * docs: bind OTel control evidence to exact upstream head * docs(changelog): promote CHANGELOG.d/2.13.2-otel-server-diagnostics.md, bump version A peer session independently merged origin/main into this branch while I was mid-merge on the same PR (functionally identical resolution to mine, already pushed) -- rebased onto their tip rather than force-push a redundant duplicate. One genuine gap remained in both resolutions: CHANGELOG.d/2.13.2-otel- server-diagnostics.md existed in this PR from the start but was never promoted into CHANGELOG.md, and pyproject.toml/__init__.py/uv.lock never bumped past main's 2.12.18 -- same version-bump gap already fixed on #480/#482/#434/this-branch's-first-pass this session. Verified: full suite 940 passed, 16 skipped, zero failures. * fix(otel): instrument queued Ask failures * merge: rebase onto main; union OTel spans with per-run refusal handling The branch's diagnostic spans around the Valkey xread path now wrap main's fail-closed per-run AnalysisRunCreateError refusal handling, so a refused run is logged and skipped without ending the worker while the batch keeps its traced span. Also drops conflict markers that an earlier branch-side merge committed and unifies on _worker_logger. * fix(api): keep Ask configuration details reader-safe * docs(changelog): restore descending release order * fix(telemetry): bound session metadata to service peers --------- Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com> Co-authored-by: seonghobae <seonghobae@users.noreply.github.com>
Summary
X-LineageWeave-Session-IdStack
This PR is stacked on #329 (
fix/buyer-safe-image-captions). The image pins contextual-orchestrator PR #802 head7b8f7e3a44a16b5eb305d7c3cac671100ed0932f.Validation
uv run --with pytest --with httpx pytest tests/test_observability.py tests/test_http_client.py -q-> 13 passeduv run --with pytest --with httpx --with asyncpg --with redis --with fastapi pytest tests/test_observability.py tests/test_http_client.py tests/test_activity_stream.py tests/test_post_content_normalization.py -q-> 39 passeduv run --with pytest --with httpx --with asyncpg --with redis --with fastapi pytest tests/test_post_content_worker.py tests/test_analysis_run_worker.py -q-> 11 passeddocker compose build orchestrator-> passed; OTel packages installed in imagegit diff --check-> passed