Skip to content

context_flow: product-summary compaction fails with 'unknown session' under load #2265

Done

Description

@eric8810

Symptom

context_flow::product_summary::compaction_chunks_images_as_markers_and_legacy_screenshots_as_text fails with

panicked at crates/dim-agent-capabilities/tests/context_flow/product_summary.rs:67:66:
called `Result::unwrap()` on an `Err` value: Storage("unknown session e03eebd0-…")

compact_now asks the branch to compact and polls chain_events for the command's fact for ten seconds; the session it polls is reported unknown before the fact appears.

Evidence

Where to look

The test polls outside any subscription it holds; a Session that is closed, unloaded or re-registered while the command is pending turns the lookup into unknown session instead of the fact. The ten-second wait and the 10 ms poll also mean a loaded runner shifts when the lookup happens relative to whatever ends the session.

Related: #2216 and #2219 audit poll-based waits in this suite.

Acceptance

  • The flow passes on a loaded runner on both platforms.
  • If the session can legitimately end before the command settles, the test asserts that outcome instead of polling into unknown session.

Activity

  1. added
    bug
    on Nov 27, 2026
  2. eric8810 commented on Nov 27, 2026

    @eric8810
    CollaboratorAuthor

    Same run, second symptom, possibly the same root: compaction::configured_compaction_uses_the_window_declared_in_the_model_file (crates/dim-app-server/tests/transport_flow.rs:556) failed on the same verify (macos) job with

    {"jsonrpc":"2.0","id":18,"error":{"code":-32000,"message":"Service reloaded; the operation may already have committed. Read the current state before retrying","data":{"appError":"operation_interrupted"}}}
    

    Both are a compaction request racing the instance/service lifecycle — one loses its session, the other its row — on a loaded macOS runner. run 45955339899.

  3. eric8810 commented on Nov 27, 2026

    @eric8810
    CollaboratorAuthor

    Diagnostics merged in #2267 (verified green: verify (linux) passed, no fault reproduced on that run).

    The next failure of compaction_chunks_images_as_markers_and_legacy_screenshots_as_text will now carry close: Ok/Err(...) from Session::closed instead of only unknown session, which names the fault that closed the session. The transport half no longer treats the documented operation_interrupted answer as a failure: history re-reads it up to five times.

  4. added
    P1
    on Nov 27, 2026
  5. eric8810 commented on Nov 28, 2026

    @eric8810
    CollaboratorAuthor

    The Session-close diagnostic added in #2267 captured the same History fault in both Linux attempts on #2289 at 832293268.

    component: History
    message: Compaction cut is outside the fixed context history.
    

    The test requests compaction and polls for its completion event. When that poll reports unknown session, the Session close result contains the History error above. The remaining question is how the selected retention point fell outside the history available to the projection. First Linux run · Linux rerun

    I also ran context_flow::product_summary::compaction_chunks_images_as_markers_and_legacy_screenshots_as_text 128 times per checkout, with eight isolated test processes in parallel. Both checkouts produced the same History error.

    Checkout Failures
    Before #2289, 74b610501 12 / 128
    #2289, 832293268 13 / 128
  6. self-assigned this
    on Nov 28, 2026
  7. eric8810 commented on Nov 28, 2026

    @eric8810
    CollaboratorAuthor

    Closed by #2292 (merged 05:31Z). Materialized replay now resolves a compaction cut omitted by context filters before replaying it, so the context_flow Session no longer closes with the History fault.

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

Metadata

Metadata

Assignees

Labels

P1bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions