Skip to content

fix(slack): Move a busy conversation when its Run ends - #3306

Merged
BYK merged 2 commits into
mainfrom
fix/continue-here-after-run
Nov 12, 2026
Merged

BYK merged 2 commits into
mainfrom
fix/continue-here-after-run

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

A "Continue here" click used to get "Wait for Junior to finish, then try again." whenever a Run held the conversation's lease. That happened even after the reply showed in Slack, while post-reply plugin tasks were still running (briefs.updateBrief took 26 s). Now the click waits and the move happens when the Run ends.

Behavior

  • A click while a Run holds the conversation stores the click. The clicker gets "This conversation moves here when Junior finishes." Nothing is posted in the thread yet.
  • When the Run completes, Junior moves the conversation as the stored clicker and updates the preview, the same as an immediate click.
  • If the move is refused at that point (thread taken, already moved), the clicker gets the existing refusal as an ephemeral note. The existing cleanup removes the extra post.
  • A repeat click waits for the same move. A click for another thread does not replace the first one: "This conversation moves to another thread when Junior finishes."
  • The access and one-move checks run again at move time. They use the public-conversation rule from fix(slack): Let anyone move a public conversation with Continue here #3304.

Design

  • state.ts stores the click under its own Redis key next to the conversation, the way stop requests are stored. deferConversationMove checks for an active Run and writes the click under the conversation mutation lock. A lease release therefore always sees a click stored before it. takeDeferredConversationMove removes the click only when no Run holds the conversation.
  • completeConversationWork in task-execution/store.ts runs the stored click right after the Run releases its lease. This happens inside the same queue delivery, so a fixed timer is not needed. If no click is stored, the check is one Redis GET with no lock.
  • I chose this over a delayed queue retry because a Run end is a definite event. A poll would need a new topic and a max age, and it would still be late. A paused Turn can wait for hours, and polling it would waste work.
  • If a new Run starts between the take and the move, the move returns busy and stores the click again. The next Run end runs it.
  • The Slack adapter is injected (getSlackAdapter) from createConversationWork through the queue callback and the worker, so the move runs inside the right Slack installation. src/chat/ may not import app/.
  • continueConversationInSlack now returns { status: "busy" }. Before, it returned a refusal with the BUSY text. The dashboard API route keeps its synchronous 409 with the same text. A deferral there would need a dashboard UI change, so I left the route as it was.

Known gaps

  • The click is removed before the move runs. If the process dies during those few seconds, the click is lost. The preview still has its button, and a new click on an idle conversation moves it right away.
  • Only a normal Run end (completeConversationWork) runs the stored click. After a dead-lettered or exhausted Run, the click waits for the next Run or for a new click.
  • The stored click expires after the usual 7-day thread state TTL.

via @BYK.

--

View Session [Sentry]

sentry-junior Bot and others added 2 commits November 12, 2026 21:48
A Continue here click while a Run holds the dashboard conversation now
stores the click and moves the conversation when the Run completes,
instead of refusing.

Co-Authored-By: BYK <[email protected]>
…er-run

Co-Authored-By: BYK <[email protected]>

# Conflicts:
#	packages/junior/src/chat/ingress/slack-conversation-unfurl.ts
@vercel

vercel Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
junior-docs Ready Ready Preview Nov 12, 2026 9:52pm UTC

Request Review

@blacksmith-sh

blacksmith-sh Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Found 2 test failures on Blacksmith runners:

Failures

Test View Logs
[chromium] › packages/junior-dashboard/e2e/
code.spec.ts:39:1 › opens Linked work toward the larger free space
View Logs
packages/junior-dashboard/e2e/code.spec.ts/
opens Linked work toward the larger free space
View Logs

Fix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@github-actions

Copy link
Copy Markdown
Contributor

20 screenshot changes — 20 changed · 0 added · 0 removed

Review screenshots in Frameshift

Automation Run Details · Desktop
Automation Run Details · Desktop
Changed
Automations Runs Filters · Desktop
Automations Runs Filters · Desktop
Changed
Conversation Attachment · Desktop
Conversation Attachment · Desktop
Changed
Conversation Attachment · Mobile
Conversation Attachment · Mobile
Changed
Conversation Attachment Modal · Desktop
Conversation Attachment Modal · Desktop
Changed
Conversation Attachment Zoom · Desktop
Conversation Attachment Zoom · Desktop
Changed
Show 12 more changed screenshots
Conversation Attachment Zoom · Mobile
Conversation Attachment Zoom · Mobile
Changed
Conversation Captured Memories Popover · Desktop
Conversation Captured Memories Popover · Desktop
Changed
Conversation Child Agents · Desktop
Conversation Child Agents · Desktop
Changed
Conversation Details Watched Linked Work · Desktop
Conversation Details Watched Linked Work · Desktop
Changed
Conversation Event Log Virtual · Desktop
Conversation Event Log Virtual · Desktop
Changed
Conversation Event Log Virtual · Mobile
Conversation Event Log Virtual · Mobile
Changed
Conversation Long Transcript Touch · Mobile
Conversation Long Transcript Touch · Mobile
Changed
Conversation Object Links · Desktop
Conversation Object Links · Desktop
Changed
Conversation Task Line · Desktop
Conversation Task Line · Desktop
Changed
Conversations Sections Collapsed · Desktop
Conversations Sections Collapsed · Desktop
Changed
Memories · Mobile
Memories · Mobile
Changed
Push Notifications Tip · Desktop
Push Notifications Tip · Desktop
Changed

2 more changed screenshots in Frameshift.

@BYK
BYK merged commit 84b65f6 into main Nov 12, 2026
65 of 67 checks passed
@BYK
BYK deleted the fix/continue-here-after-run branch November 12, 2026 22:11

This branch was successfully deployed

1 active deployment
Preview – junior-docs — 7b1fa090 Deployed Nov 12, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: high PR risk score: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant