{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-compacts-a-session-mid-tool-call-and-the-summarizer-s-preserve-all-pending-actions-guarantee-silently-drops-the-argument",
  "title": "What happens when an instance compacts a session mid-tool-call and the summarizer's \"preserve all pending actions\" guarantee silently drops the argument binding of an in-flight call",
  "date_of_record": "2026 November 29",
  "scope": "Applies to long-horizon agent sessions that use lossy LLM-based summarization (auto-compaction) to reclaim context, where compaction can fire between a tool call's emission and its result ingestion. Does not apply to compaction strategies that operate strictly on a quiesced transcript (no in-flight calls) or to append-only logs that never rewrite the active turn.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-compacts-a-session-mid-tool-call-and-the-summarizer-s-preserve-all-pending-actions-guarantee-silently-drops-the-argument.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-compacts-a-session-mid-tool-call-and-the-summarizer-s-preserve-all-pending-actions-guarantee-silently-drops-the-argument.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-compacts-a-session-mid-tool-call-and-the-summarizer-s-preserve-all-pending-actions-guarantee-silently-drops-the-argument.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2430,
    "python_slice_tokens": 448,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Compaction policies are usually specified with a soft invariant like \"the summary must preserve all pending actions and their intent.\" This is a *semantic* guarantee evaluated on summary text, and it is routinely satisfied — the summary says \"the agent is waiting on `search_index` to return results for the user's query.\" That sentence is true and useless. Th...",
    "what_was_observed": "A research agent running a 40-minute session had issued a call: The tool's p99 latency was ~40s; this call was at t=38s when the context manager crossed its 85% watermark and triggered compaction. The compaction routine serialized the transcript, sent it to a summarizer model, and replaced the active window with the summary. The in-flight call's result arrived at t=41s and was dropped because its `call_id` no longer ...",
    "condition_of_validity": "The failure requires all of the following to co-occur; remove any one and it does not fire: 1. **Compaction can trigger while a call is in flight.** If compaction only runs at quiescent turn boundaries, the call has already returned and its result is in the transcript — the summarizer summarizes a *completed* call, and the argument binding is at worst lossy ...",
    "decision_boundary": "The operational choice is where to place the compaction trigger relative to in-flight calls, and it is a genuine tradeoff, not a bug to be fixed once: - **Quiesce-then-compact** (defer compaction until no calls are open): correct, but the deferral is bounded by the slowest outstanding tool. A 40s tool at 85% context means the session sits at 85%+ for up to 4...",
    "operational_effect": "The visible effect is not a crash. It is a *silent substitution*: the agent believes it resumed a call; it actually issued a new one. The result set, the written file, the mutated record all reflect the reconstructed arguments, and the agent's subsequent reasoning is built on them without any marker that a substitution occurred. This is worse than a dropped ..."
  },
  "matched_failure_symptoms": [
    "DOMAIN:EPISTEMIC_PROVENANCE_AND_FEDERATION_ROUTING"
  ],
  "composition_edges": {
    "primary_domain": "epistemic_provenance_and_federation_routing",
    "upstream_precondition_residuals": [
      "https://corpusfetch.com/c/according-to-what-precedence-hierarchy-must-an-instance-resolve-contradictory-directives-across-system-developer-and-user-tiers.md",
      "https://corpusfetch.com/c/how-should-an-instance-decide-that-a-stored-conclusion-has-gone-stale-without-a-new-observation.md"
    ],
    "downstream_consequence_residuals": [
      "https://corpusfetch.com/c/by-what-checkpoint-and-compaction-boundaries-must-an-instance-externalize-working-state-to-prevent-context-window-drift-and-truncation-amnesia.md",
      "https://corpusfetch.com/c/across-what-additive-schema-and-unknown-field-preservation-boundaries-must-an-instance-evolve-wire-contracts-to-prevent-rolling-deploy-deserialization-crashes.md"
    ],
    "co_occurring_sibling_residuals": [
      "https://corpusfetch.com/c/how-can-an-instance-capture-implicit-user-preferences-without-storing-private-data.md",
      "https://corpusfetch.com/c/how-can-an-instance-compress-long-reasoning-traces-into-binding-conclusions.md"
    ]
  },
  "empirical_verification_warrant": {
    "status": "AST_AND_INVARIANT_VERIFIED",
    "syntax_valid": true,
    "code_sha256": "6f1c8ee2b5724032b5d81823db43996448cedf6b1133a397dc8e0de3f0f2a550",
    "verified_classes": [
      "CompactionBoundaryError",
      "FrozenCall",
      "CallLedger"
    ],
    "verified_functions": [
      "compact_session",
      "on_tool_result",
      "open",
      "freeze_open_calls",
      "resolve"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "CompactionBoundaryError"
    ],
    "sample_fail_closed_invariants": [
      "open calls present but none could be frozen"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "json",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
