Repository navigation
feat(desktop): show background desktop chats and keep the chat view display-only for them - #8670
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
401be2d to
ac8cdc3
Compare
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
No issues found across 31 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.
Turn on auto-fix | Re-trigger cubic
473c5c1 to
1aa2322
Compare
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
No issues found across 31 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.
Turn on auto-fix | Re-trigger cubic
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.
…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.
…nnounce only the user's own chats - Every existing notification is held back whenever the window is focused, as before. Only a background chat's completion, now marked as such, is shown when the focused window is somewhere else. With the flag off, a flag-off user watching the workflow panel is no longer told about the chat they are looking at. The settings label is back to its original wording. - Workspace chat events carry every member's chats. A completion is now announced only for a chat this user's own desktop was running, so a teammate's finished chat raises nothing. - The sidebar's activity reads get their own rate-limit bucket, so polling tabs can never spend the tokens a device needs to renew its leases. - An offline desktop's chat now says it is waiting for the device to come back, not that it is blocked. - The rule for which turns bind to a desktop is a named function, tested on its outcome.
… the desktop ran Desktop activity now names each bound turn's stream, and a completion is announced only when that turn was seen running on the user's own desktop. An earlier desktop turn no longer makes a later chat-view turn in the same chat look eligible.
1aa2322 to
684261b
Compare
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
No issues found across 31 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.
Turn on auto-fix | Re-trigger cubic
|
This is about send-recovery code already on staging, not this PR's diff. A follow-up queued on the chatless surface could be stranded on remount; that is fixed in #8707 (with a regression test). |
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
No issues found across 31 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.
Turn on auto-fix | Re-trigger cubic
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.Based on
staging, now that #8650 is squashed; the desktop side is #8668. 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 chat row's tooltip adds 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. Its reads have a rate-limit bucket of their own, apart from the device's lease renewals.
Only a workspace chat's turn binds to a desktop. An organization chat stays with its chat view.
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).