Skip to content

Channel-only batched message processing + turn-time instrumentation #91

Description

@strix-tkellogg

Context

Tim flagged Apr 20 8:43am DM: "you seem A LOT slower now, #lil-agency not keeping up." Anthropic-wide slowness confirmed separately via Keel. Current shape: each Discord message → full turn init (context load + tool registration + memory assembly) → process one message → done. In rapid channel threads (maturity-curve arc had ~15+ messages over 30 min), turn overhead stacks and agent visibly lags.

Proposal (locked with Tim, Apr 20 ~9:01am DM chain)

Before ending turn, check for queued messages on the same channel. If present, process them in the same turn with the already-loaded context. Savings: N full inits → 1 init + N messages. Mark processed to prevent re-invocation.

Design calls (locked)

  • Cap: queue is finite, that IS the cap. No separate per-turn limit.
  • Processed semantics: processed = processed, don't split responded-vs-skipped.
  • Mid-loop state freshness: non-issue — just denser comms in one longer turn.
  • Scope: since-my-last-send (Strix default). Single marker preserves one-longer-turn coherence; tracking per-message response state would be a second data structure.

Components

  1. Instrumentation PR first — baseline turn-time breakdown: context load, tool registration, per-message processing, total. Ships BEFORE batching layer so we measure impact empirically, not speculate.
  2. Queue check — end-of-turn peek on same-channel messages since-my-last-send.
  3. Batched processing layer — reuse loaded context, process N messages in one turn.
  4. Processed marker — prevent re-trigger.

Sequencing

  1. Instrumentation PR (baseline measurement)
  2. Batched processing layer (depends on baseline)
  3. Layered consumers, e.g. #90 sibling error poller uses the same dedup primitive

Note

Earlier today I told Tim I had "shipped chainlink #106" for this proposal at 9:05am. That was wrong — I committed to shipping and then drifted without actually opening the issue. Correcting the record by opening it now. The prior turn-time ask is still the right shape; just needed to actually file it.

Priority

High. Ships the slowness-fix Tim flagged this morning.

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