Skip to content

fix(conversations): Keep conversations that wait on an authorization out of auto-archive - #3063

Merged
BYK merged 3 commits into
mainfrom
fix/auth-wait-needs-attention
Nov 10, 2026
Merged

BYK merged 3 commits into
mainfrom
fix/auth-wait-needs-attention

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

A web conversation asked for a Linear connection and parked its Turn. Auto-archive archived it before the person connected (requested 2026-11-09 18:35 UTC, connected 2026-11-10 10:01 UTC). The feed did not put it in Needs attention either.

A Turn that parks for authorization ends its run, so execution goes back to idle and the tree is quiet. The wait exists only in the Redis Turn record and the web connect prompt. Auto-archive and the feed do not read either one. #2951 also counts a sign-in wait as idle.

The wait is now read from the durable authorization_requested event (src/chat/conversations/sql/authorization-wait.ts). A conversation waits when its newest request:

  • has no later authorization_completed, turn_started, turn_completed, or turn_failed. A stop or new input ends the parked Turn with turn_completed.
  • is less than 24 hours old. After that the MCP auth session and the connect prompt expire, so the Turn cannot resume.

The root and every child conversation count. The check is one correlated lookup of the newest of these events, and it runs inside reads that already happen:

  • Auto-archive: an extra arm in treeIsQuiet's tree subquery, so a tree that waits is not quiet. This covers the scheduled sweep and the manual archive-done run.
  • Feed: a column of the feed row select, so rows get awaitingAuthorization: true and the dashboard's needsAttention puts them in Needs attention.
Before: parked sign-in sits under August After: in Needs attention
before after

(Mock dashboard data, with awaitingAuthorization set by hand on "Direct Message" for the after shot. The fixture change is not committed.)

Remaining risk

  • The flag is per conversation, not per viewer. In a shared Slack thread, every participant sees the wait in Needs attention, not only the person who must connect. This matches unfinishedWork.
  • The feed version token does not move when a wait expires after 24 hours. The row leaves Needs attention on the next feed refetch.
  • A conversation that waits on a sign-in and sits outside the newest 50 feed rows is not added back the way Review items are. A wait lasts at most 24 hours from the request, which is the conversation's latest activity, so this case is rare.

via @BYK.

--

View Session in Sentry

…out of auto-archive

A Turn that parks for authorization leaves the conversation idle and quiet,
so auto-archive archived it and the feed did not show it in Needs attention.
Read the durable authorization_requested event to find the wait, block
auto-archive on it, and flag the feed row so the dashboard puts it in Needs
attention.

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

vercel Bot commented Nov 10, 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 10, 2026 12:13pm UTC

Request Review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit f84f1ec. Configure here.

@blacksmith-sh

blacksmith-sh Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

Found 2 test failures on Blacksmith runners:

Failures

Test View Logs
[chromium] › packages/junior-dashboard/e2e/
conversations-mobile.spec.ts:768:1 › keeps the message in view while earlier history an
d late content load
View Logs
packages/junior-dashboard/e2e/conversations-mobile.spec.ts/
keeps the message in view while earlier history and late content load
View Logs

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

A child agent invocation that needs a connection abandons its Turn and ends
it as blocked, so only a Thread Turn can wait on a connection.
@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

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

Review screenshots in Frameshift

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
Conversation Captured Memories Popover · Desktop
Conversation Captured Memories Popover · Desktop
Changed
Conversation Long Transcript Touch · Mobile
Conversation Long Transcript Touch · Mobile
Changed
Show 9 more changed screenshots
Conversation Stop Active · Mobile
Conversation Stop Active · Mobile
Changed
Conversation Unsent Answers · Desktop
Conversation Unsent Answers · Desktop
Changed
Conversation Unsent Answers · Mobile
Conversation Unsent Answers · Mobile
Changed
Conversations Sections Collapsed · Desktop
Conversations Sections Collapsed · Desktop
Changed
Memories · Mobile
Memories · Mobile
Changed
Push Notifications Tip · Desktop
Push Notifications Tip · Desktop
Changed
Push Notifications Tip On · Desktop
Push Notifications Tip On · Desktop
Changed
Settings Mcp · Desktop
Settings Mcp · Desktop
Changed
System Cache Share · Desktop
System Cache Share · Desktop
Changed

The feed row read and the auto-archive quiet check already read each
conversation. Add the wait as one correlated event lookup there instead of
a separate feed query and a second tree scan.
@BYK
BYK merged commit abe2b21 into main Nov 10, 2026
44 checks passed
@BYK
BYK deleted the fix/auth-wait-needs-attention branch November 10, 2026 12:25

This branch was successfully deployed

1 active deployment
Preview – junior-docs — 375dbd1b Deployed Nov 10, 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