Skip to content

[defer] feat(call-logs): record per-request resilience actions in call logs - #14810

Merged
diegosouzapw merged 7 commits into
diegosouzapw:release/v3.8.51from
maxmad64bis:fix/call-resilience-actions
Sep 25, 2026
Merged

diegosouzapw merged 7 commits into
diegosouzapw:release/v3.8.51from
maxmad64bis:fix/call-resilience-actions

Conversation

@maxmad64bis

@maxmad64bis maxmad64bis commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ base-red inherited: #14547

Summary

The request log stayed silent about recovery work: a request parked 40s before dispatch read as merely slow, and a served stored rate-limit response was indistinguishable from a real upstream 429. Each call-log row now carries an additive nullable resilience_actions summary (rotations, park wait, empty-turn retries, mid-stream continuation, stored-error replay, buffered-turn verdict), rendered as read-only badges in the request log; a served stored 429 keeps the flag whatever the served status.

Related Issues

No linked issue — per-request recovery visibility is a new observability column with no prior ticket.

Upstream census (2026-09-24)
# State Title Maintainer position
#14756 open per-request added wait with cause in call logs No maintainer note 2026-09-24; disjoint need, no action
#14588 closed serve the stored 429 instead of re-sending refused requests Endorsed 2026-09-24 (@diegosouzapw); cross-check #14659
#13481 closed winning failover attempt's call log dropped (UNIQUE clash) Closed; per-attempt line kept
#10670 closed persist per-call error classification in call_logs No maintainer note; neighbor only

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/resilience-actions-context.test.ts (11 tests: round-trip, out-of-context null, read/reset, combo isolation, accumulation, guards, cap)
  • tests/unit/resilience-actions-sink.test.ts (5 tests: valid JSON, corrupt null, unknown dropped, type guards, flag regardless of status)
  • tests/unit/resilience-actions-notes.test.ts (9 tests: rotations, replayed/stored matrix, streaming flag on 200, isolation, suffix-only continuation, invariants, resume threading, combo+resume limit)
  • tests/unit/resilience-actions-badges.test.ts (5 tests: null input, stored-error on flag alone, parked duration, OR rule, unknown keys)
  • tests/unit/db/migration-191-resilience-actions.test.ts (2 tests: legacy lineage gains the column, fresh lineage idempotent)

Coverage Notes

New sink fields, park hook, per-attempt accumulator, migration plus self-heal, and badges are covered by the 32 new unit tests above; neighboring suites (park-resume, chat-core, call-log) stay green.

Reviewer Notes

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

  • Merged release/v3.8.51 into the branch (real merge, author commit preserved) and resolved the config/quality/file-size-baseline.json conflict against the tip: src/sse/handlers/chat.ts 2567→2582 (+15 on the reconciled tip), src/sse/services/auth.ts keeps the tip's 3602; the other own ceilings (chatCore.ts 6441, opencode.ts 1354, RequestLoggerDetail.tsx 1211) were re-measured after the commit.
  • Reverted the unrelated i18n sync noise: every locale is back to the tip (copiedAll restored, no __MISSING__ markers in bs.json, no reordering of the stickyLimit* / connectionAwareExpansion keys). Only this PR's six requestLogger.detail.resilience* keys are added, translated in all 65 non-English locales (49 of them were still English in the branch).
  • Migration stays 191_call_logs_resilience_actions.sql, and the "190" entry in KNOWN_GAPS stays so this branch is green on its own. Once [defer] feat(calls): record rendered-content presence and usage provenance per request #14795 (migration 190) lands, that entry becomes stale and has to be dropped when this PR is merged.

@maxmad64bis
maxmad64bis force-pushed the fix/call-resilience-actions branch 3 times, most recently from abdc84a to e33c9ee Compare September 25, 2026 08:26
@maxmad64bis
maxmad64bis marked this pull request as ready for review September 25, 2026 08:28
Each call-log row carries an additive nullable resilience summary
(rotations, park wait, empty-turn retries, mid-stream continuation,
stored-error replay, buffered-turn verdict), written by existing
action points and rendered as read-only badges in the request log.
@maxmad64bis
maxmad64bis force-pushed the fix/call-resilience-actions branch from e33c9ee to 7912697 Compare September 25, 2026 11:31
Resolve the file-size-baseline conflict against the tip (chat.ts 2567->2582,
auth.ts keeps the tip's 3602) and drop the unrelated i18n sync noise: every
locale is restored to the tip (copiedAll, no __MISSING__ in bs.json, no
reordering of stickyLimit*/connectionAwareExpansion) plus only this PR's six
requestLogger.detail.resilience* keys, translated in all 65 locales.
@diegosouzapw

diegosouzapw commented Sep 25, 2026 •

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 keeps 191, so no rename is needed. Slots go by PR age, and merges happen in ascending order (190 → 196) 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(call-logs): record per-request resilience actions in call logs [defer] feat(call-logs): record per-request resilience actions in call logs Sep 25, 2026
# Conflicts:
#	open-sse/executors/opencode.ts
#	open-sse/handlers/chatCore/recoveryTraceLogging.ts
#	src/lib/usage/callLogs.ts
…d of duplicating INSERT

Reconcile with release/v3.8.51 (call-log id-collision retry loop): keeps
callLogs.ts under the 1200-line cap and re-measures the opencode.ts
ceiling on the reconciled tree.
# Conflicts:
#	config/quality/file-size-baseline.json
#	src/lib/db/schemaColumns.ts
#	src/lib/usage/callLogs.ts
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.
# Conflicts:
#	config/quality/file-size-baseline.json
@diegosouzapw
diegosouzapw merged commit 4df9bf6 into diegosouzapw:release/v3.8.51 Sep 25, 2026
7 checks passed
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!
fouadSalkini added a commit to fouadSalkini/OmniRoute that referenced this pull request Sep 26, 2026
Slice 2/3 rewrote open-sse/handlers/chatCore.ts from an older snapshot,
silently undoing four merged fixes. Rebuild the file as the base version
plus only this PR's own hunks: stripNonStreamingForwardedHeaders on the
non-streaming path and apiKeyInfo on the streaming headers meta.

Restored:
- handleChatCore -> withResilienceActionsContext -> handleChatCoreInner
  wrapper, previousResponseResumed handling, notePreviousResponseResumed
  and the three noteBufferedVerdictOutcome calls (diegosouzapw#14810)
- pendingRequestId in every trackPendingRequest call, the pipeline
  options and finalizeToolLoopError (diegosouzapw#14797)
- the full-UUID traceId and its collision comment (diegosouzapw#14474)
- correlationId on buildContinuationLogHooks (diegosouzapw#14793)
@maxmad64bis
maxmad64bis deleted the fix/call-resilience-actions 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