Skip to content

Keep a conversation's row Working while its Bot works, subtasks and tasks included - #2204

Merged
davidmckayv merged 2 commits into
mainfrom
fix/roster-working-through-subtasks
Nov 25, 2026
Merged

davidmckayv merged 2 commits into
mainfrom
fix/roster-working-through-subtasks

Conversation

@davidmckayv

Copy link
Copy Markdown
Contributor

What was wrong

A Bot ran three subtasks after the person gave it Slack. The conversation said "Working on 3 subtasks…"; its row in the Conversations list said "1m", as if it were done.

A person's own turn runs in their browser, and the list knows of it only from the socket's busy event, which patches the cached row. The conversation list from the API never says it (it leaves busy out rather than answer false). Giving an app reads every query again (app-access-action.tsx), and the card carries the task on at the same moment: the list's read landed after the busy event, or was read once more because of it (readAgainWhenLanded), and replaced the row without busy. Any read of the list during a long turn (a rename, a pin, a new conversation, a reconnect) did the same.

The fix

  • app/src/lib/channels/held-busy.ts: what the socket said (noteBusyHeard, from applyToRoster) and this tab's own turns (noteBusyHere, from setChannelBusy) are held apart from the cache. Every page read of the list, a Bot's list and a search (channelPageOf) keeps a row busy while a turn is known to run there. A reconnect lets go of what the socket said, since an end may have been missed while it was down; this tab's own turns stay held until they end.
  • A conversation whose Bot handed work to a task (its own turn ended on "On it") reads Working until the task is done, from the task list (delegatingConversationsQueryOptions), in the Conversations panel and under each Bot in the Bots panel.

The existing indicator only: "Working" where the time goes and the orb's typing dots. No API change.

Tests

  • app/tests/roster-working-through-reads.test.ts (regression): the list read again mid-turn, and a read already on its way when the turn starts, keep the row Working, and it stops once the turn ends. Fails on main, passes here.
  • app/tests/roster-working-sources.test.ts: this tab's own turn stays Working across a reconnect while one only heard of is let go; a delegated task keeps its conversation Working until it is done, waiting on the person, or failed.
  • app/tests/roster-working.test.tsx (real browser, added to the WebKit job): the real Conversations and Bots panels with the app's own socket hook, the server's events replayed: busy, a read of every query, the end; and a delegated task working then done. Chromium and WebKit, light and dark. On main it fails with the row reading "1m" while the turn runs.

…asks included

A Bot ran three subtasks after the person gave it Slack. The conversation said
"Working on 3 subtasks…" while its row in the Conversations list said "1m".

A person's own turn is known to the list only from the socket's busy event;
the conversation list from the API never says it. Giving an app reads every
query again, and that read (or the read once more a patch mid-read asks for)
replaced the row and put out the busy the turn had lit. Any read of the list
during a long turn did the same.

Now the socket's busy, and this tab's own turns, are held apart from the cache,
and a page read keeps a row busy while a turn is known to run there. A
reconnect lets go of what the socket said, since an end may have been missed;
this tab's own turns stay held until they end.

A conversation whose Bot handed work to a task also reads Working until the
task is done, from the task list, in the Conversations and Bots panels.

Tests: the list read again mid-turn keeps the row Working (fails on main), the
reconnect rule and the delegated task, and a real-browser check of both panels
in Chromium and WebKit, light and dark.
@davidmckayv
davidmckayv merged commit e974400 into main Nov 25, 2026
23 checks passed
@davidmckayv
davidmckayv deleted the fix/roster-working-through-subtasks branch November 25, 2026 19:36
davidmckayv added a commit that referenced this pull request Nov 25, 2026
davidmckayv added a commit that referenced this pull request Nov 25, 2026
Unreleased gains everything since 1.2.0-rc.5, written from the code, including #2201, #2196 and #2204. release-policy.json: fromVersions adds v1.2.0-rc.5, database.from adds 0181_organization_ai_sign_in_credentials, database.to moves to 0182_withdraw_default_source_imports.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant