Skip to content

Decide headroom once per session and change it only at a cache boundary #398

Description

@Mearman

The door decides a session's headroom use at its first request and keeps it. It re-decides only at a cache boundary, derived from the session's own responses rather than a fixed constant: there is no earlier response, the last response is older than the cache lifetime, or the cache carried no more of the last response's context than was written or sent afresh. The last case covers a cold cache, a small context and the turn after a compaction, where rewriting the context costs no more than an ordinary turn.

Switching on is cheap while headroom keeps the prefix frozen; switching off is a full-context cache miss except at a boundary. Per-request flapping is ruled out for the same reason.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions