Repository navigation
feat(logging): call-log correlation ID (safe core subset of #5275) - #5279
Conversation
Narrow tsconfig include to src/**, add "use client" directives for proper code-splitting, and hide the heavy batchProcessor/tsx imports from webpack's static analysis via /* webpackIgnore */ (replaces a new Function() eval shim — Hard Rule #3). Co-authored-by: diegosouzapw <diegosouza.pw@gmail.com>
- Add correlation_id column to call_logs table (migration + schema) - Thread correlationId through chat handler, combo handler, and breaker - Return X-Correlation-Id response header - Filter call-logs by correlationId in API and dashboard - Fix call-logs sort: active requests first, then newest - Add timestamps to request logger detail and list views - Make getExecutor() async for lazy loading support
- Add correlationId to trackPendingRequest metadata in chatCore.ts - Add correlationId to PersistAttemptLogsContext and saveCallLog in attemptLogging.ts - Add correlationId parameter to handleChatCore signature
The CREATE INDEX in SCHEMA_SQL runs before ensureCallLogsColumns adds the correlation_id column to existing databases, causing 'no such column' error that silently breaks getDbInstance() — all saveCallLog calls fail. The index is already created by ensureCallLogsColumns in schemaColumns.ts after the column is added.
…e test - Add correlationId to ctx destructuring in attemptLogging.ts so it actually reaches saveCallLog (was undefined before — destructured variable shadowed the ctx.correlationId reference) - Add save-call-log-persistence.test.ts: 4 tests verifying saveCallLog persists to DB with correlationId, null fallback, getCallLogs roundtrip, and column/index existence
Declares the new correlation_id column on the CallLogSummaryRow type (typecheck) and rebaselines the 6 frozen files the CorrelationId + lazy-loading extraction grows. Co-authored-by: diegosouzapw <diegosouza.pw@gmail.com>
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Drops the build/lazy-loading changes (tsconfig include narrowing, instrumentation import shim, "use client" churn) and the call-logs list/detail display rework (active-first sort, Event Stream split) — those break the CLI build path / existing request-logger tests in isolation and belong with #5275's focused review. Keeps the self-contained, green CorrelationId core: migration 109, storage, and the X-Correlation-Id response header wiring. Co-authored-by: diegosouzapw <diegosouza.pw@gmail.com>
|
Scope reduced: dropped the build/lazy-loading changes (tsconfig |
…nference#5275) (cheaper-inference#5279) Call-log correlation ID core (migration 109 + storage + X-Correlation-Id header) — safe subset of cheaper-inference#5275. Original work by @hartmark. Integrated into release/v3.8.40.
Summary
Lands the safe, cohesive subset of #5275 (@hartmark) so the genuinely valuable, low-risk work is not blocked by the parts of that PR that need a focused review:
X-Correlation-Idresponse header, stored incall_logs(migration 109), filterable via/api/usage/call-logs, and surfaced in the dashboard request logger (with per-chunk stream timestamps + active-requests-first sort).tsconfigincludetosrc/**(the documented**/*→ ~70× glob OOM cause), adds"use client"directives for proper code-splitting, and hides the heavybatchProcessor/tsximports from webpack's static analysis via/* webpackIgnore */.ChunkLoadErrorfix — no-cache headers on dev HTML + SW unregister.What was deliberately NOT included (stays in #5275 for a focused review)
targetExhaustion.ts5xx narrowing,streamPreBuffer, per-model cooldown,validateQuality) — these alter the documented 3-mechanism resilience model and several are currently unwired scaffolding; they deserve their own RFC-level PR.console.error("[DEBUG-EXPAND]")on the auto-combo hot path.@toon-format/toondependency churn.Changes vs the original commits
new Function('return import("tsx")')()(Hard Rule deps: bump eslint from 9.39.2 to 10.0.0 in the development group #3 violation) with the sanctionedawait import(/* webpackIgnore: true */ "tsx").103→ 109 (103 collided with103_strip_legacy_combo_config_keys.sql).correlation_idon theCallLogSummaryRowtype (typecheck) and rebaselined the 6 frozen files this subset grows (justification infile-size-baseline.json).Validation
npm run typecheck:core— cleannpm run check:file-size— OK (baseline updated with justification)npm run check:migration-numbering— OK (no collision)node --import tsx/esm --test tests/unit/save-call-log-persistence.test.ts— 4/4 passOriginal work by @hartmark (commits preserved with author attribution); maintainer co-authored the Rule #3 fix, migration renumber, type fix, and rebaseline.