You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Follow up the multi-speaker attribution work in #738 by optimizing thread history hydration so Slack and Discord adapters stop fetching full thread history on every authorized inbound message and filtering client-side.
Current Behavior
The adopted-context / authorized-watermark model is correct, but the current implementation does this on each authorized inbound thread message:
fetch full thread history from the platform API
filter the results locally against the current watermark / cursor
build the adopted-context gap from the filtered slice
That preserves correctness, but it can become unnecessarily expensive for long or high-traffic threads.
Desired Outcome
Make thread-history hydration bounded by the existing watermark / cursor semantics instead of always retrieving the full thread.
Scope
extend the thread history fetcher abstraction to support bounded fetches
update Slack thread history fetch to request only the relevant window when the platform API supports it cleanly
update Discord thread history fetch to request only the relevant snowflake range when possible
performance improvement is measurable in at least one long-thread scenario
Notes
This should stay separate from #738 itself. The feature behavior and security model are already correct; this issue is about reducing platform/API cost without weakening correctness.
Summary
Follow up the multi-speaker attribution work in #738 by optimizing thread history hydration so Slack and Discord adapters stop fetching full thread history on every authorized inbound message and filtering client-side.
Current Behavior
The adopted-context / authorized-watermark model is correct, but the current implementation does this on each authorized inbound thread message:
That preserves correctness, but it can become unnecessarily expensive for long or high-traffic threads.
Desired Outcome
Make thread-history hydration bounded by the existing watermark / cursor semantics instead of always retrieving the full thread.
Scope
Acceptance Criteria
Notes
This should stay separate from #738 itself. The feature behavior and security model are already correct; this issue is about reducing platform/API cost without weakening correctness.