Skip to content

[defer] feat(calls): record rendered-content presence and usage provenance per request - #14795

Merged
diegosouzapw merged 2 commits into
diegosouzapw:release/v3.8.51from
maxmad64bis:fix/call-content-provenance
Sep 25, 2026
Merged

diegosouzapw merged 2 commits into
diegosouzapw:release/v3.8.51from
maxmad64bis:fix/call-content-provenance

Conversation

@maxmad64bis

@maxmad64bis maxmad64bis commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ base-red inherited: #14547

Call logs could not tell an empty success apart from a missing usage counter, so debugging silent responses meant guessing which side failed. Each successful request now records whether client-visible content was rendered (has_content) and where the usage numbers came from (usage_provenance: reported, estimated, or absent), with both columns left null whenever nothing was measured. Existing columns keep their exact semantics and the journal screen is unchanged (follow-up PR).

Summary

Call logs could not tell an empty success apart from a missing usage counter: each successful request now records whether client-visible content was rendered and where the usage numbers came from, with both columns left null whenever nothing was measured.

Related Issues

  • No linked issue — self-contained observability follow-up with no tracked issue; additive nullable columns with a fresh migration.

Validation

  • Change type: DB
  • Focused tests and category gates from the golden path
  • npm run lint
  • Reconciled with the current active release base; focused checks rerun afterward
  • Production-code changes include a new or updated automated test in this PR

Tests Added Or Updated

  • tests/unit/call-content-provenance.test.ts (new, 10 cases): empty vs content-bearing success, silent provider, threaded and rebuilt estimates, reasoning-only, tool-calls-only, non-text route, failure, fresh-database migration; failing before the fix (RED), passing after (10/10).
  • Neighbor call-log suites rerun green, unchanged (143/143).

Coverage Notes

  • The new helper (src/lib/usage/callContentProvenance.ts) and the sink lines in src/lib/usage/callLogs.ts are covered branch by branch by the new suite, including the null-when-unmeasured paths (non-success, logging disabled, non-text output).
  • No coverage decrease expected: the change is purely additive and all neighbor suites stay green.

Reviewer Notes

  • Strictly additive: two nullable columns (migration 190, plus back-fill for lineages that skipped the file); existing readers and queries are untouched.
  • Docs-counts sync: README/AGENTS/llm.txt migration count 183→187 with this migration (STRICT gate green locally; base said 183 for a real 186).
  • Success is strictly 2xx (200–299): an empty success reads as a visible 0, never confused with unmeasured NULL; a missing counter reads as absent, never as an error.

Maintainer rework (merge-batch 2026-09-24)

@maxmad64bis
maxmad64bis force-pushed the fix/call-content-provenance branch 2 times, most recently from d2118c3 to d5f0c12 Compare September 24, 2026 19:25
@maxmad64bis
maxmad64bis marked this pull request as ready for review September 24, 2026 19:26
@maxmad64bis
maxmad64bis marked this pull request as draft September 24, 2026 23:42
@maxmad64bis
maxmad64bis force-pushed the fix/call-content-provenance branch from d5f0c12 to 0a96ad0 Compare September 25, 2026 00:24
@maxmad64bis
maxmad64bis marked this pull request as ready for review September 25, 2026 01:01
Drop the stale migration-count edits to AGENTS.md, README.md, llm.txt
and the 66 docs/i18n llm.txt mirrors; the count is synced in a follow-up.
@diegosouzapw

Copy link
Copy Markdown
Owner

Migration number coordination: several open PRs claim the same slot, and the release tip is already at 189 (187_proxy_logs_attempts, 188_call_logs_reasoning_encrypted, 189_quota_schedules). This PR's migration (190_call_logs_content_provenance.sql) gets 195. Please rename the file and update every reference to the number. Slots go by PR age, and merges happen in ascending order so the numbering gate stays contiguous.

@diegosouzapw diegosouzapw added the deferred-v3.8.52 Grande demais / suspeito para o lote atual; precisa de sessão dedicada no ciclo v3.8.52 label Sep 25, 2026
@diegosouzapw diegosouzapw changed the title feat(calls): record rendered-content presence and usage provenance per request [defer] feat(calls): record rendered-content presence and usage provenance per request Sep 25, 2026
@diegosouzapw
diegosouzapw merged commit 9753c7f into diegosouzapw:release/v3.8.51 Sep 25, 2026
10 of 16 checks passed
diegosouzapw added a commit to maxmad64bis/OmniRoute that referenced this pull request Sep 25, 2026
Reconciled with release/v3.8.51 after diegosouzapw#14795 (migration 190) landed:
drop the temporary 190 KNOWN_GAPS reservation, keep has_content /
usage_provenance alongside resilience_actions in the INSERT, and
re-measure the RequestLoggerDetail.tsx ceiling.
diegosouzapw pushed a commit that referenced this pull request Sep 25, 2026
…l logs (#14810)

Maintainer rework: reconciled with release/v3.8.51 after #14795 (migration 190) landed — migration 191 now sits contiguous (temporary 190 KNOWN_GAPS reservation dropped), the INSERT keeps has_content/usage_provenance plus the optional resilience_actions column (spliced instead of a duplicated statement) and the #14474 id-collision retry loop, buildContinuationLogHooks takes (log, correlationId, resilience), and the resilience-actions parser moved to src/lib/usage/resilienceActionsParse.ts to keep callLogs.ts under the cap. Tests: 131/131 node (resilience-actions context/sink/notes/badges, migration-191, stream-recovery-trace-logging, call-log id-collision/persistence/reasoning/provenance) + 2/2 vitest UI badges; typecheck:core and check:open-sse-typecheck clean; check-file-size and check-migration-numbering OK. Thank you @maxmad64bis!
diegosouzapw pushed a commit that referenced this pull request Sep 25, 2026
)

Maintainer rework: reconciled with release/v3.8.51 after #14750/#14795/#14810/#14659 — migration 192 now follows 190/191 with no gap, the call_logs INSERT carries has_content/usage_provenance + added_wait_ms/added_wait_cause + the optional resilience_actions column and the #14474 id-collision retry, attempt logging keeps the fresh-UUID row key and reads the added wait late, opencode keeps both the served-account tracker and the park/throttle added-wait counters, the unused getAddedWaitPercentiles was dropped, and file-size-baseline.json was rebuilt from the tip with only this PR's own ceilings (opencode.ts, proxyFetch.ts, core.ts, RequestLoggerDetail.tsx) instead of rewinding unrelated entries. Tests: 133/133 focused (opencode-added-wait, applied-egress-key, egress-throttle, attempt-logging, call-log persistence/id-collision/provenance, resilience-actions); typecheck:core and check:open-sse-typecheck clean; check-file-size and check-migration-numbering OK. opencode-429-park-resume / opencode-429-pool-reselect fail identically on the pure release tip (inherited, not from this PR). Thank you @maxmad64bis!
diegosouzapw pushed a commit that referenced this pull request Sep 25, 2026
…14752)

Maintainer rework: reconciled with release/v3.8.51 after #14795/#14810/#14756 — migration 193 now follows 190/191/192 with no gap; AGENTS.md / llm.txt / README edits are out of the diff; selectorHelp ICU-escapes the selector=<name> placeholder; ENVIRONMENT.md keeps the tip's PROXY_SKIP_RECENTLY_FAILED default-on row plus this PR's SELECTOR_CONTROL_ALLOWLIST row. Tests: 142/142 focused (proxySubscription selector client/endpoint/functional/guard/help-ICU/schema/strip/trigger/warning, proxy-outcome-memory); typecheck:core and check:open-sse-typecheck clean; eslint clean on changed files; check-file-size and check-migration-numbering OK; no __MISSING__ markers. Thank you @maxmad64bis!
@maxmad64bis
maxmad64bis deleted the fix/call-content-provenance branch September 30, 2026 00:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deferred-v3.8.52 Grande demais / suspeito para o lote atual; precisa de sessão dedicada no ciclo v3.8.52

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants