Skip to content

hardening(gateway): define global resource budgets and graceful drain deadlines #1617

Description

@BYK

Motivation

Lore already has several stream-specific limits, but resource control should be auditable across the whole process. Agent Gateway bounds bodies, pools, caches, windows, handshakes, queues, and shutdown. Lore needs a single inventory and coherent process-wide budget model.

Scope

  • Inventory all request/response byte limits, retained stream state, caches, sessions, concurrent distillations/curations, workers, queues, and timers.
  • Add missing global caps and explicit admission behavior.
  • Define graceful drain plus a hard termination deadline.
  • Ensure limits compose across chained recall continuations.

Acceptance criteria

  • Every potentially unbounded collection or retained byte stream has a documented owner and limit.
  • Limit errors are protocol-correct and do not leak hidden recall data.
  • Concurrent sessions cannot each independently exceed the intended process budget.
  • Shutdown stops admission, drains active work to a deadline, flushes required state, then terminates.
  • Stress tests cover slow clients, large bodies, recall chains, worker saturation, and cache pressure.
  • Resource-limit metrics identify the exhausted budget.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions