Skip to content

Responses compaction: investigate non-text helper streaming, preparation-budget fallback, and outcome reconciliation #1608

Open

Description

@AnthonyRonning

Problem

A bounded post-#1485 Responses compaction observation found one GLM helper that continued streaming without producing recorded summary text until its initial preparation budget expired. Fallback then allowed the main Response to proceed, but that logical main ultimately reached its overall deadline. Track helper streaming behavior, fallback latency, durable main outcomes, and the evidence needed to distinguish an isolated provider/model event from a systemic compaction regression.

This is a sanitized aggregate report. No account, conversation, Response, execution or infrastructure identifiers, exact request timestamps, content, raw logs, credentials, or private operational links are included.

Observed timeout sequence

  • Planning selected approximately 199k estimated source tokens for one bounded summary. Context metadata/source loading took less than one second; this was not five minutes of database fetch work.
  • The helper stream opened after 21,078 ms, with its first chunk at the same point.
  • 12,275 chunks were observed; the last arrived at 299,354 ms. first_text_ms=0, which the instrumented source defines as the text stage never being reached.
  • The helper stopped at 299,380 ms with initial_preparation_budget, stage awaiting_provider. No fresh checkpoint was published by this attempt.
  • advisory_failed / fitting_fallback followed. Initial preparation took 300,168 ms; cumulative preparation across the logical main's six preparation calls was 301,306 ms.
  • The main continued through additional work after fallback, then failed its overall deadline at 600,016 ms. Stored failed status was independently verified.

Interpretation: the helper received an active stream but no recorded summary text. Prolonged reasoning or other non-text streaming is a hypothesis, not a proven explanation of those chunks. The logs do not establish the outcome the main would have had without compaction. Same-model non-compaction traffic also exhibited capacity and deadline failures. The observed preparation time nevertheless consumed about half the main's deadline.

Other compaction observations

The same bounded observation exercised only three helper attempts, so account count and elapsed observation time should not be confused with a large sample of compactions.

  • Two helpers completed, in approximately 96.3 s and 12.9 s, and published fresh checkpoints.
  • One publication's main completed and was verified stored completed. Its prepared-context estimate fell from approximately 257k to 26k tokens. No later request in that same thread was observed during the window; that is not evidence of user dissatisfaction.
  • The other publication's main failed with a capacity/rate-limit category, independently verified in storage. A subsequent main reused that checkpoint and completed, also verified stored completed.
  • Reuse counters appeared across multiple preparation/tool steps, but represented two distinct logical mains, not fifteen independent successful Responses. One was the capacity-failed publication main and one was the successful follow-up.
  • Helper completion or checkpoint publication alone therefore does not establish a durable successful main answer or client receipt.

Aggregate outcomes and persistence uncertainty

Across the fixed observation window, deduplicated accepted logical mains had 1,179 logged completed, 18 failed, and 6 cancelled outcomes. Eight preaccept denials were tracked separately. At the final read, 1,135 completed, 16 failed, and 5 cancelled rows were present with matching statuses; there were no unresolved log terminals or stored in-progress rows.

47 accepted terminal rows were absent at the final read: 44 logged completed, two failed, and one cancelled. Of those, 23 completed rows had previously been independently read as stored completed. The other 21 logged completions lack an independent durable-read receipt. The missing-row set had no compaction helper/reuse/fallback involvement and also included traffic with compaction disabled. Cleanup/deletion is plausible but unconfirmed; neither user deletion nor a compaction integrity defect has been established. Track this discrepancy separately rather than counting log completion as proof of current persistence.

Median accepted-main elapsed time was approximately 12.4 s, p95 88.9 s, with a maximum around the ten-minute deadline. These aggregate latencies mix models and workloads and do not isolate compaction overhead. A legacy-only baseline already contained deadline failures. Contemporaneous controls excluded all experimental/internal accounts; exact provider/input/load matching was not established. Client receipt, answer quality and sentiment were not measured.

Investigation and acceptance criteria

  • Determine whether helper chunks contain reasoning, heartbeats, usage-only updates or other non-text events using bounded metadata counters; never log payload/content.
  • Separate stream-open, first chunk, first reasoning, first summary text, last progress and helper completion timing. Preserve timing on cancellation/budget expiry.
  • Verify how summary helpers inherit model/reasoning/generation settings, and assess whether a bounded summary-specific configuration can improve latency without reducing summary correctness.
  • Evaluate a helper progress/budget policy that leaves useful time for the main after fallback, including multi-step/tool-using mains. Increasing the overall timeout alone is not an established fix.
  • Test active non-text streams, silent stalls, cancellation, preparation-budget exhaustion, fitting fallback, subsequent main success/failure and checkpoint reuse as separate outcomes.
  • Keep main-level and helper-level denominators separate; report rates per actual helper-involved logical main, with repeated steps/retries deduplicated.
  • Distinguish isolated incidents from repeated failures across independent users/requests or sustained excess failure rates versus comparable controls. Retain immediate intervention for confirmed corruption, cross-user leakage or runaway work.
  • Reconcile missing stored outcomes with lifecycle/cleanup/replica evidence using metadata-only reads, preserving earlier durable receipts; do not infer deletion or write success from absence.
  • Require representative natural/synthetic validation across relevant models and context sizes, durable main success and subsequent reuse; do not infer satisfaction from continued use.

Related design correction: #1459 and #1485. Timing fields were checked against public source revision 4090b9be0fe3c1ff1e6f889071e72da71d3813fe, particularly services/opensecret/src/web/responses/compaction/executor.rs. This issue records observations and follow-up work; it does not claim that one timeout proves a systemic regression.

Activity

  1. AnthonyRonning commented on Nov 15, 2026

    @AnthonyRonning
    ContributorAuthor

    Follow-up: “preparation” includes the summary LLM call; upstream helper latency dominates

    A subsequent bounded observation provides more evidence for this issue. All figures below are rounded aggregate metadata; no content, request/account/conversation identifiers, exact request timestamps, infrastructure details, or operational configuration are included.

    Terminology correction: preparation_ms is cumulative prompt-preparation time across the logical main Response, including compaction summary generation. It is not a timer for work that happens before invoking the summary LLM. Preparation can run more than once during a tool-using main.

    The code starts the preparation observation around prepare_prompt, adds each observation to the main's preparation total, and awaits SummaryExecutor::summarize within that work. The helper's separate timer covers upstream invocation and stream collection. Consequently, helper duration is nested within preparation; the two must not be added together.

    Additional observed sample

    There were eight distinct helper-involved logical mains, each with one helper attempt:

    Summary model Attempts Helper elapsed Cumulative main preparation First recorded summary text, relative to helper start
    GLM 5 170–299 s 171–301 s 116–168 s in four completed helpers; never reached in the budget-expired attempt
    Kimi 3 109–133 s 111–138 s 84–105 s
    • Across these eight cases, summed helper elapsed time was approximately 1,432 s of 1,467 s preparation, or 98%. This is a small, selected helper-involved sample, not a population latency estimate.
    • The three preparations previously described as 122–226 s contained helper calls of approximately 110 s, 170 s and 224 s. The corresponding preparation-minus-helper residuals were approximately 12 s, 1.3 s and 1.6 s. The delay was overwhelmingly inside the summary call, not minutes of separate pre-summary setup. The residual is not a direct database-time measurement; it can include multiple preparation stages/calls.
    • GLM helper streams opened after approximately 23–27 s; Kimi streams opened after 0.5–0.7 s. First summary text arrived substantially later. Each helper observed thousands of streamed chunks, with last chunks arriving near helper termination.
    • Seven helpers completed and published fresh checkpoints. One GLM helper reached its initial preparation budget at approximately 299 s, with an active stream but no recorded summary text, then fell back. In this newer sample, that fallback's main eventually completed and was independently verified stored completed. This is a different outcome from the earlier deadline-failed main described in the issue body.
    • Across the eight helper-involved mains, seven completed and one was cancelled, with all eight terminal statuses independently verified in storage. Helper latency and main failure must therefore remain separate measures; publication alone still does not establish successful delivery or answer quality.

    What source and metadata establish

    The helper request builder retains the selected model's normal Responses model/thinking policy, enables streaming, and removes the caller's max_tokens field so the main answer's caller-supplied cap does not become a separate summary cap. That is not evidence that provider generation is unlimited, nor does it reveal a particular request's effective reasoning setting.

    first_text_ms advances only when the summary accumulator gains visible text. Zero means that stage was not reached. Stream chunks without visible summary text are observed, but their type is not counted by this instrumentation. Extended reasoning/non-text generation is a plausible explanation, not a confirmed root cause. Provider startup/prefill, non-text streaming, and terminal-processing time are not fully separated by the existing counters. No summary, reasoning, message, or tool payloads were read for this assessment.

    Source references at the inspected revision:

    Focused next steps

    • Add numeric counters/timing for reasoning versus visible-summary versus other stream events, time since last visible progress, and terminal wait; never record payloads.
    • Split preparation timing into source loading, planning, helper upstream work, validation/publication, and subsequent preparation calls. Report per-helper and per-logical-main totals separately.
    • Evaluate a summary-specific reasoning/output allowance and a progress-aware helper budget that reserves useful time for the main/fallback. Do not assume simply extending the timeout fixes this; validate summary fidelity and reuse correctness before changing policy.
    • Keep comparisons matched by model/provider and input size. Existing model-only controls do not establish equivalent workloads or prove that the main would have behaved identically without compaction.
  2. AnthonyRonning commented on Nov 15, 2026

    @AnthonyRonning
    ContributorAuthor

    Interpretation and optimization follow-up

    Slow but successful summary generation on larger reasoning models is an accepted latency tradeoff, not by itself evidence of a compaction defect or a reason to block rollout. Keep helper elapsed time separate from failed logical main outcomes; an active stream with delayed visible text does not prove a stall or runaway work.

    A useful, non-blocking improvement to investigate is turning thinking off or lowering reasoning effort specifically for the compaction summary helper, where the selected model/provider supports it. The current helper retains the selected model's normal thinking policy. Evaluate supported settings rather than assuming a uniform API or disabling reasoning globally for main answers.

    Acceptance checks for that investigation should cover summary fidelity, preservation of constraints and tool state, subsequent checkpoint reuse, helper latency, and durable main outcomes. Use controlled validation before changing production behavior, and keep all instrumentation payload-free. This follow-up does not establish a root cause or implement a configuration change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions