feat(discord): read the whole thread when a channel opts in #827
No reviewers
Labels
No labels
move-to-repo
coilyco-bridge-deploy
move-to-repo
coilyco-flight-deck-agent-compose
move-to-repo
coilyco-gaming-eco-app
move-to-repo
coilysiren-inbox
move-to-repo
unknown
🔒⚠️📦⚠️🔒 SANDBOXED 🔒⚠️📦⚠️🔒
autonomy
async-consult
autonomy
epic
autonomy
headless
autonomy
live-collab
c#
priority
P0
priority
P1
priority
P2
priority
P3
priority
P4
role/ai
role/creator
role/design
role/director
role/engineer
role/exec
role/human
role/ops
role/qa
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
coilyco-gaming/sirens-echo!827
Loading…
Reference in a new issue
No description provided.
Delete branch "aos/claude/aw85-thread-prefill"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #769.
What changed
Every turn inside a thread prefills the whole thread. The walk pages Discord newest first until it runs out or the read bound stops it.
No toggle. The resolved spec called for a per-channel one and Kai removed it on the issue: a thread is a bounded conversation someone deliberately opened, so reading it whole is what the feature means everywhere rather than a per-channel preference. Being in a thread is the entire condition. What holds the cost down is the context budget and the bounded walk, not a switch.
Overflow drops oldest first and the reply says so, which is the rule decided on the issue over silent truncation, falling back to the partial window, and summarising the older half.
Where the annotation lives
It is a service-authored suffix, the same mechanism as the tool receipt, so it is appended after the reply checks and contends for the send budget with the others rather than being stapled on afterwards. It sits ahead of the receipt in the preference order: the last suffix is the first one cut, and a note about missing context outranks a record of what ran.
That needed the assembly step to carry more than the tool list, so
serviceFactsreplaces the bare[]ExecutedToolinside it.AssembleReplykeeps its signature, so every existing caller is unchanged. While there I folded the duplicated "append a short service line, answer yields" body out ofAppendToolDisclosureWithinintoappendServiceLine, which both suffixes now share.A hole in my own first version, found and fixed
The walk is bounded so a pathological thread costs a known number of Discord calls. My first version annotated only when the byte budget dropped something - so a thread of 1000 short messages, all of which fit the budget, would have been cut by the walk bound and reported as complete. That is the silent truncation the issue rejected, arriving through a different door.
truncated()now covers the bound too, with its own sentence, andTestACappedWalkIsAnnotatedEvenWhenNothingWentOverBudgetpins it. The annotation saysat leastbefore a length it only knows a floor for, so an absent hedge is a claim: a plain count means the read reached the start of the thread.Mutation
Five, each caught: always reading the whole thread, dropping newest first instead of oldest, never annotating, treating a capped walk as complete, and reading the window inside a thread.
TestOutsideAThreadTheWindowIsUnchangeddrives the realreadTurnHistoryagainst a paging fake rather than restating it, so the unchanged-outside-a-thread claim is exercised rather than asserted.On the context risk
The issue asks to record the observed prefill size on a long thread before enabling this anywhere. With the toggle gone there is no "before": it applies from the first threaded turn after rollout.
history.thread.readandhistory.thread.droppedland on thecommunity.historyspan, so the real numbers are readable from day one rather than estimated, and the annotation makes any truncation visible to the member at the same time.sirens-echo#750 raises the number of turns taken inside threads and therefore the cost of this. Measure after both land rather than after either.
ward exec gatepasses on the rebased tree.coilyco-ops referenced this pull request2026-08-15 17:18:33 +00:00