Repository navigation
fix(chat): Finish turn after Slack accepts the reply - #1397
Merged
Merged
Conversation
Once Slack accepts a tool-free assistant, finish the turn on timeout instead of parking a shorter history. Recovery also completes stranded turns that already have an accepted destination reply. Co-Authored-By: David Cramer <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Drive JUNIOR-7Y from Slack webhook ingress through real runtime wiring. Hold only Slack accept past the host deadline, then assert one completed turn, one destination post, durable assistant history, and a later turn. Co-Authored-By: David Cramer <[email protected]>
Rewrite durable-queue around the six product outcomes from #1398. Drive live mid-work timeout → park → fresh wake → finish. Keep only dead-worker residue seeding where a live process cannot leave state in-process. Drop auth from this suite. Co-Authored-By: David Cramer <[email protected]>
The accept-is-terminal rule must cover cooperative yield after delivery, not only hard timeout. Assert the live mid-work park uses timeout, and label the dead-worker accepted-reply case as seeded residue. Co-Authored-By: David Cramer <[email protected]>
dcramer
reviewed
Aug 10, 2026
| }); | ||
|
|
||
| // ── Tool wiring ────────────────────────────────────────────────── | ||
| const wiring = await wireAgentTools({ |
Member
There was a problem hiding this comment.
we should create a github issue to f/u here - this is SO bulky at this point and needs to be cleaned up
Contributor
Author
There was a problem hiding this comment.
Opened #1401 for the agent module split.
dcramer
marked this pull request as ready for review
August 10, 2026 20:53
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 15fe1a4. Configure here.
Completing on any accepted tool-free reply broke delivery+steer+yield. Hard timeout after accept still completes. Soft yield after a pure assistant tail already cannot park; steered continuable boundaries may. Co-Authored-By: David Cramer <[email protected]>
When destination already accepted a reply, return after the complete attempt. Do not fall through to stranded-failure fallback if the turn record does not close on this pass. Co-Authored-By: David Cramer <[email protected]>
Co-Authored-By: David Cramer <[email protected]>
This branch was successfully deployed
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.

When Junior posts a final answer and Slack accepts it, that turn is done.
Before this change, a host timeout could still try to pause the turn with shorter history. That failed and left the turn in a failed state (JUNIOR-7Y).
Change
If Slack accepted the final reply and the turn then times out, complete the turn. Do not pause it.
Test proof
The integration test starts with a real Slack mention. It uses the real worker, agent runtime, delivery path, SQL history, timeout, and next turn. Only the model response and Slack HTTP are fake.
The test checks that:
I also ran the test with the production fix disabled. It failed with the original
AgentHistoryBranchError, and the turn wasfailedinstead ofcompleted. Restoring the fix made the same test pass.The suite also keeps coverage for existing queue behavior: long work resumes after timeout, retries do not duplicate replies, steering works, and dead workers do not block later work.
Follow-up
agent/index.tsSentry: https://sentry.sentry.io/issues/7664050472/