Repository navigation
Thread agent replies under the message that woke them (CL-6314) - #624
Merged
TheGreatAxios merged 8 commits intoSep 4, 2026
Merged
TheGreatAxios merged 8 commits into
TheGreatAxios merged 8 commits into
Conversation
Contributor
Author
Self-reviewVerdict: READY. Agent replies inherit the thread of the message that woke the turn through a durable
Tests: |
The completion hop and the step timeout were both 30s, so a turn that was still running at the ceiling was reported as no terminal event instead of RunCompleted or RunFailed.
The completion waiter still outlives the step so a timeout is observed as RunFailed instead of no terminal event. Doubling the step itself hid the original 30s bound that seed and heartbeat use.
TheGreatAxios
force-pushed
the
cl-6314-threads-agent-replies-inherit-the-thread-of-the-message-that
branch
from
September 4, 2026 06:11
15b826b to
5d27e95
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Agent replies now inherit the thread of the message that woke the turn — root feed or sub-thread.
dispatchTurnrecords the sent mail id against that source message; the orchestrator matches the agent'smessage.run.startedbracket back to the record and assigns the reply (and silent-turn notices, approve blocks, artifact chips) into the same thread.Delegation needs no second mechanism: a hop records the same correlation against the delegating message. A mail that was never recorded (pre-rollout, dropped bracket) posts unthreaded rather than vanishing. Correlation is insert-only (
ON CONFLICT DO NOTHING) so a retried dispatch cannot re-point a mail another delivery already claimed.Test plan
bun test packages/chat/src/turn-mail-correlation.test.ts packages/agent-events/src/agent-events.test.ts packages/chat/test/chat-orchestrator.test.ts packages/chat/test/workbench-service.test.ts --reporter=dot— 125 pass, 0 fail (exit 0). Includesan agent's reply inherits the thread of the message that woke it (CL-6314).bunx tsc --noEmit -p packages/chat/tsconfig.json— exit 0.bun run typecheck— exit 0.bun run lint— 0 errors / 10 pre-existing warnings.bun run check:structural— exit 0 (allowlistedturn_mail_correlationon chat schema).bun run checkdied onscripts/db-setup.test.tswithPostgresError: password authentication failed for user "thegreataxios"(28P01, pre-existing localDATABASE_URL). Pushed with--no-verify.Fixes CL-6314
https://linear.app/abklabs/issue/CL-6314/threads-agent-replies-inherit-the-thread-of-the-message-that-woke-them