feat(desktop): show background desktop chats and keep the chat view display-only for them - #8670
waleedlatif1 wants to merge 4 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
|
0c63239 to
401be2d
Compare
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
Comments Outside DiffThese findings could not be posted inline.
|
48920e2 to
0a5f255
Compare
Behind mothership-desktop-background-executor (resolved server-side and passed through the workspace feature flags): - GET /api/desktop/activity lists the caller's chats in a workspace whose turn runs on one of their desktops, as running, needs input (a call waits for approval) or blocked (that desktop is offline), with the device name. - The sidebar marks those chats with a status dot whose tooltip reads "Running on <device>", "Needs input" or "Blocked: <device> is offline"; unread replies keep the existing Ready dot. - A chat view showing a turn a desktop runs in the background only displays its desktop calls and never executes them.
…ckground chats Builds on the background activity commit, against the final binding contract. - Display only, deterministically. Sim marks a turn its desktop's executor runs on the stream that serves it: a response header on the send and on every reconnect, and a flag on the replay batch a reload attaches with. The chat view only shows that turn's desktop calls and never starts or reports them. This replaces reading the cached activity list, which a new turn's first call could beat. - Needs input comes from the durable record: a call Sim asked the user about and they have not answered, or a running terminal handoff or browser takeover. An auto-allowed command no longer reads as needing input. Presence Sim cannot read is not reported as offline. - Turn-complete notifications for chats in the background: a chat that finishes while the user is elsewhere is announced and opens on click; the chat on screen announces itself as before. "Notify only for chats in the background" (the existing default) now means exactly that, so a background chat is announced even while Sim is focused. - The activity list refreshes when a turn starts or ends.
…kspace chats - Turn-complete notifications for chats in the background follow the background executor flag, so a flag-off user sees exactly what they saw before. - Only a workspace chat's turn binds to a desktop. Its sidebar shows the status and an approval notification links back to it; an organization chat stays with its chat view. - A desktop's status reads as running when Sim cannot track presence at all, not as blocked. - "Running on <device>" shows in the chat row's tooltip. The status dot sits in the row's indicator slot, which takes no pointer and gives way to the row's actions on hover, so a tooltip on the dot itself could never open.
401be2d to
ac8cdc3
Compare
…d of asserting mock calls The background-chat tests now record the calls a view starts and the notifications it asks the desktop app to show, and read whether the desktop activity query went stale from a real query client, instead of asserting that mocks were called.
Summary
Phase 2b of the desktop background executor: the web app's side. All of it applies only to turns a desktop's background executor runs, which only happens behind
mothership-desktop-background-executor. With the flag off, or on an old desktop build, nothing changes.Stacked on #8650; the desktop side is #8668. It will be rebased onto
stagingonce #8650 is squashed. It builds on the unopened background-activity commit (its first commit), reviewed and corrected against the final binding contract.Display only, decided by Sim, not by a cache.
x-mothership-desktop-executor: deviceheader on the send response and on every reconnect;desktopToolsOnDeviceon the replay batch that a reloaded view attaches with.authorizeorconfirmfor them, and it has no tool lifetime to cancel on unmount or stream recovery. Workflow tools are unaffected.Status per chat (sidebar).
The sidebar dot's tooltip reads one of:
The existing unread dot stays as Ready.
Needs input now comes from the durable record:
permission_requested_atset, no decision);handofforbrowser_request_takeover.An auto-allowed command no longer shows as needing input.
Presence that Sim cannot read is shown as running, not offline.
The activity list refreshes as soon as a turn starts or ends, not only on its timer.
Notifications.
Test plan
bun run test:integration):app/api/copilot/chat/stream/desktop-executor.integration.ts: the live tail and the replay batch of a turn bound to a desktop are marked, and an unbound turn's are not.lib/desktop/application/activity.integration.ts:type-check,check:audits, and the affected Vitest suites (251 files).