Repository navigation
fix(sse): keep one proxy journal row per request actually sent - #14637
diegosouzapw merged 1 commit into
Conversation
b04b0b2 to
c1e75d2
Compare
c1e75d2 to
fa79657
Compare
|
Great root-cause fix for the journal-collapses-to-one-row problem — per-send capture on the |
a0b75c9 to
940d0b6
Compare
|
Thanks for catching the gap — the release tip has since landed |
10e3d98
into
cheaper-inference:release/v3.8.51
Summary
A request saved on its 4th try reads as a first-try success from a healthy outlet: the proxy journal writes one row per request on the final outcome only, so refused outlets leave no trace, and abandoned rows borrow the final outlet's egress address with a zero latency that drags the latency average down. Each send now appends to a per-request journal on the applied-proxy sink (snapshot at entry, status or sanitized error plus send duration at settle), and the log call writes one proxy_logs row per send sharing one correlation id: refused sends first (each with its own outlet's cached egress address and its own duration), the send the request settled on last. The latency strategy ignores abandoned sends. Columns are nullable, added by migration 187 following the 179 pattern.
Related Issues
Related to #14620 (merged: the shared applied-proxy capture this PR appends to is now on the base)
Related to #13580 (prior: kept the provider HTTP status this PR records per send)
Related to #14223 (prior: request correlation this PR groups sends by)
Validation
tests/unit/proxy-logs-attempt-rows.test.ts11/11 GREEN on the rebuilt head940d0b61+check-migration-numbering15/15 + migration runner 3/3npm run lint— ESLint on the touched files is clean (exit 0 with frozen suppressions); the full run is red on the base (🔴 Release branch not green: release/v3.8.51 #14547)rev-list HEAD..upstream/release/v3.8.51= 0 @940d0b61, single commit, post-fix(sse): share applied proxy capture across duplicated fetch modules #14620 merge)Tests Added Or Updated
tests/unit/proxy-logs-attempt-rows.test.ts(11 tests: per-outlet egress address, abandoned-excluded latency average, non-negative send duration, served-row-last order; 11/11 GREEN on the rebuilt head)check-migration-numbering15/15,db-migration-runner-account-identity3/3, numbering gate OK (184 migrations, no duplicates)Coverage Notes
N/A — no coverage gate moved;
src/sse/handlers/proxyJournal.tsis covered by the new test (abandoned rows plus final row),proxyLatency.tsexclusion by the latency-average test.Reviewer Notes
186_conversation_turn_nodes_last_seen_index.sql(184/185/186 onupstream/release/v3.8.51, no 187), so187_proxy_logs_attempts.sqlplus thecase "187"guard is exactly the next free slot. The earlier renumber request predates the tip landing 186.940d0b61) on the release tip (7d23bcf8); the parent symbols (runWithAppliedProxyCapture/ shared-context store inopen-sse/utils/proxyFetch.ts, merged via fix(sse): share applied proxy capture across duplicated fetch modules #14620) are on the base, consumed fromchatHelpers.ts/upstreamStatusCapture.ts. The stacked-on banner is dropped.check-api-typecheckcites onlyauggie.ts/projectCombo.ts, both outside this PR (diffon them is empty); thechatcore-compression-integrationtest-size flag cites a file outside this PR; the complexity note on the newproxyJournal.tsis a single function at threshold in a new file with new-code complexity 0. Full lint and mutation coverage stay red on the base (🔴 Release branch not green: release/v3.8.51 #14547).