Skip to content

fix(dashboard): explicit notice for size-limit-omitted log payloads - #14045

Merged
diegosouzapw merged 4 commits into
release/v3.8.51from
fix/13894-log-detail-fallback
Sep 19, 2026
Merged

diegosouzapw merged 4 commits into
release/v3.8.51from
fix/13894-log-detail-fallback

Conversation

@diegosouzapw

Copy link
Copy Markdown
Collaborator

Closes #13894

Root cause

omitOversizedPipeline() / buildMinimalArtifactForSizeLimit() (src/lib/usage/callLogArtifacts.ts) do not drop a size-limited pipeline payload — they write an explicit marker in its place: { error: { _omniroute_truncated: true, reason: "call_log_artifact_size_limit_exceeded" } }, a non-empty object. /api/logs/[id]'s fallback check (!pipelinePayloads || Object.keys(pipelinePayloads).length === 0) never fires on it, so the request never reaches the bounded in-flight preview path the issue's title describes. Instead, RequestLoggerDetail.tsx fed that marker straight into the generic JSON/<pre> renderer under a plain "Pipeline Error" title — indistinguishable from a real upstream error. Same problem for requestBody/responseBody, which get replaced by the [omitted: call log artifact size limit exceeded] string marker and were rendered as raw text.

This PR makes the fallback observable instead of widening any bound: the marker is now detected by shape and rendered as an explicit, labeled notice.

Also fixed a confirmed doc-drift: .env.example documented CHAT_LOG_ARRAY_TAIL_ITEMS=128 / CHAT_LOG_MAX_DEPTH=6, which no longer match src/lib/logEnv.ts's actual defaults (1000 / 20).

Changes

  • src/shared/constants/callLogSizeLimitMarkers.ts (new): single source of truth for the size-limit marker shapes (isPipelineSizeLimitMarker, isSizeLimitOmissionMarker), shared between the artifact writer (server-only, fs-dependent) and the client-side detail view.
  • src/lib/usage/callLogArtifacts.ts: re-exports isSizeLimitOmissionMarker from the new shared module instead of defining it locally (no behavior change).
  • src/shared/components/RequestLoggerDetail.sections.tsx: adds notice support to PayloadSection (renders an explicit "payload omitted — exceeded the call log size limit" box instead of a JSON/<pre> dump) and exports buildPipelinePayloadSections() / isBodySizeLimitOmission() to detect the marker shapes.
  • src/shared/components/RequestLoggerDetail.tsx: wires the pipeline/request/response sections through the new helpers (net -1 line — the refactor into buildPipelinePayloadSections() more than pays for the added notice wiring, keeping the file under its 1200-line new-file cap).
  • src/i18n/messages/en.json + all 65 other locales: new requestLogger.detail.payload.sizeLimitOmitted key (__MISSING__:-prefixed everywhere but en.json, per the i18n-key convention).
  • .env.example: fixed the stale CHAT_LOG_ARRAY_TAIL_ITEMS/CHAT_LOG_MAX_DEPTH doc-drift.

Regression test — RED → GREEN

tests/unit/dashboard/payload-section-size-limit-notice.test.tsx (new, vitest/jsdom, following the existing payload-section-collapsible-json.test.tsx pattern).

  • RED: ran the exact same test against origin/release/v3.8.51's copy of RequestLoggerDetail.sections.tsx (via git show) — 6/7 assertions failed: the marker rendered verbatim (_omniroute_truncated visible in the DOM, no payloadSizeLimitOmitted text) and buildPipelinePayloadSections/isBodySizeLimitOmission did not exist.
  • GREEN: npx vitest run tests/unit/dashboard/payload-section-size-limit-notice.test.tsx → 7/7 pass against this branch.

Gates run

  • node scripts/check/check-file-size.mjs → no new violation (only the pre-existing, unrelated tests/unit/chatcore-translation-paths.test.ts base-red).
  • node scripts/check/check-complexity.mjs → OK (2858 ≤ baseline 3218).
  • node scripts/check/check-cognitive-complexity.mjs → OK (1291 ≤ baseline 1437).
  • npm run typecheck:core → exit 0.
  • npm run check:dashboard-typecheck → OK, 206 pre-existing errors, all within frozen baseline (0 new).
  • npx eslint --suppressions-location config/quality/eslint-suppressions.json <changed files> → clean.
  • node scripts/check/check-changelog-integrity.mjs → OK.
  • npm run check:env-doc-sync → confirms the two vars I fixed are no longer flagged; the remaining OMNIROUTE_STRIP_SYSTEM_PREAMBLE/COMBO_LOOP_SAFETY_TIMEOUT_MS mismatches are the pre-existing, unrelated base-red (🔴 Release branch not green: release/v3.8.51 #14004).
  • Regression test (above) + existing area tests, all green: tests/unit/dashboard/payload-section-collapsible-json.test.tsx, tests/unit/request-logger-detail-copy-all.test.ts, tests/unit/dashboard/timestamp-titles.test.tsx, tests/unit/ui/request-logger-cache-tokens.test.tsx, tests/unit/ui/issue-7845-log-detail-structured-error.test.tsx, tests/unit/ui/log-detail-conversation-link-12646.test.tsx, tests/unit/request-log-detail-layout.test.ts, tests/unit/request-log-detail-stream.test.ts, tests/unit/request-logger-stream-concatenated-json.test.ts, tests/unit/i18n-hardcoded-ui-regressions.test.ts, tests/unit/log-export-runner.test.ts, tests/unit/call-log-file-rotation.test.ts, tests/unit/call-log-artifact-bodies-first.test.ts, tests/unit/call-log-size-limit-error.test.ts, tests/unit/completed-detail-pipeline-precedence.test.ts (40/40 native + all vitest files).

Scope note

The plan file's lower-priority/optional items were left out of this PR to keep the diff surgical: (1) the route.ts fallback-condition widening (explicitly marked optional/lower-priority — kept additive if ever done, out of scope here), and (2) surfacing CALL_LOG_PIPELINE_MAX_SIZE_KB as a read-only dashboard field next to the pipeline-logging toggle (a separate settings-UI change). Both are UX polish on top of the core fix (the silent fallback is now observable) rather than required for it.

⚠️ base-red inherited: #14004 — docs env/docs contract (fixed separately in #14022), chatHelpers file-size drift

Resolves the 9 locale conflicts (am, el, ga, ha, hy, km, lv, si, yo) by
merging the JSON objects — the base's keys plus this branch's
payloadSizeLimitOmitted entry — so no key from either side is dropped.
…ed in all 65 locales (#13894)

The new-key gate rejects __MISSING__ markers since 2026-09-17; the LAN
translation backends were unavailable (codex quota, claude expired), so the
single string was translated by hand — CALL_LOG_PIPELINE_MAX_SIZE_KB kept
verbatim in every locale.
@diegosouzapw
diegosouzapw merged commit 3fd1265 into release/v3.8.51 Sep 19, 2026
12 of 21 checks passed
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
…heaper-inference#14045)

Merged via /merge-batch (2026-09-19) on top of the current `release/v3.8.51` tip.

**Reconciled before landing:** `requestLogger.detail.payloadSizeLimitOmitted` was stamped `__MISSING__:` in 65 locales and the new-key gate rejects markers since 2026-09-17. The LAN translation backends were unavailable (codex accounts at quota for ~136h, claude connection expired, .113 instance in resource_pressure), so the single string was translated by hand in `3502a984` — `CALL_LOG_PIPELINE_MAX_SIZE_KB` kept verbatim in every locale, one line changed per catalog.

**Evidence on the merged tree:** `check-new-key-coverage` PASS (every new key reached all 65 locales); `payload-section-size-limit-notice.test.tsx` 7/7; `typecheck:core` clean; file-size, changelog-integrity, complexity and cognitive-complexity gates OK; prettier clean on all 65 catalogs.

**Inherited, not from this PR** (identical on the pure tip): `check-env-doc-sync` misses `BRIDGE_PORT`/`CERT_DIR`/`OPENWA_SERVICE_PORT`/`ROUTER_URL` in `.env.example`, and `check-key-completeness` reports 7 keys (`providers.claude*`, `sidebar.pin*`) present in `en.json` but absent from every locale.

Closes cheaper-inference#13894
@diegosouzapw
diegosouzapw deleted the fix/13894-log-detail-fallback branch October 18, 2026 23:49
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.

fix(logs): request detail silently falls back to the bounded in-flight preview when the persisted pipeline exceeds 512 KB

1 participant