Skip to content

fix(desktop): poll desktop activity only for users with a desktop, keep XDG zsh configs integrated - #8785

Merged
waleedlatif1 merged 3 commits into
stagingfrom
fix/desktop-executor-ga-followups
Oct 8, 2026
Merged

waleedlatif1 merged 3 commits into
stagingfrom
fix/desktop-executor-ga-followups

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

Follow-ups from the review of #8782.

  • Desktop activity polling. With the flag gone, every workspace sidebar polled /api/desktop/activity, and every member's chat start/finish refetched it. Now:
    • The layout checks whether the user has a signed-in desktop registered as an executor (hasDesktopBackgroundExecutor, an indexed lookup). The sidebar polls only for those users, or inside the desktop app itself, which may register after the page loaded.
    • Workspace chat events carry ownChat, so a member's stream knows whether a chat is theirs without learning whose it is. A teammate's turn no longer refetches anyone's activity. Events without an owner keep the old behaviour.
  • XDG zsh configs. A user .zshenv that moves ZDOTDIR sent zsh to their own .zshrc, so integration never loaded and runs were refused after 30 s. Our .zshenv now takes ZDOTDIR back and sources the user's files from the directory they chose.
  • The startup refusal message now also covers a startup file that replaced the shell (exec tmux, exec fish).
  • Tests:
    • The declined-call E2E counts claim attempts, not fixture-accepted claims.
    • The live exactly-once test requires every retry the app heard back from to be answered duplicate, with condition waits instead of fixed sleeps.
    • New unit test: a shell exiting during startup reports SESSION_CLOSED.
  • Removed a stale JSDoc block and an outdated flag comment.

Type of Change

  • Bug fix

Testing

  • New tests fail on the previous code: event ownership, sidebar gating, the teammate-event refetch and the XDG zsh case (real zsh). 9 fail in all.
  • Desktop vitest 1070/1070; related Sim suites 400/400; activity integration tests 17/17 (including the new device-gating test).
  • tsc for both apps, biome, and the comment-hygiene, unused-exports, client-boundary and application-graph checks pass.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Oct 8, 2026 5:53am UTC

Request Review

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 25 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

Comment thread apps/desktop/src/main/terminal/shell-integration.ts Outdated
Comment thread apps/sim/lib/desktop/executor/repository.ts Outdated
@greptile-apps

greptile-apps Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium risk] Refines desktop activity polling and shell integration logic.

The PR appears safe to merge; no actionable new issues remain.

What we checked:

  • Chat tests receive events immediately: The unit-test setup makes Redis unavailable. The local channel sends each event directly to its subscribers before returning.

Summary

This PR limits desktop activity polling to users with a registered desktop or an open desktop app. It also keeps user zsh settings working when they move ZDOTDIR.

  • Workspace events tell each viewer whether a chat is theirs without exposing the owner's ID.
  • The latest changes check received events, outgoing requests, and query state instead of internal request or publish calls.
  • All five supplied, unnumbered previous findings were rechecked. The current code addresses them; no duplicate comments are needed.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart TD
  Layout[Workspace layout] --> Registered[Check signed-in desktop]
  Registered --> Gate{Executor available and registered desktop or desktop app?}
  Gate -->|Yes| Poll[Poll desktop activity]
  Gate -->|No| Skip[Do not poll]
  Event[Workspace chat event] --> Own{Viewer owns the chat?}
  Own -->|Yes or unknown| Refresh[Refresh watched activity]
  Own -->|No| Ignore[Leave activity unchanged]
Loading

Reviews (3) · Last reviewed commit: "test(desktop): check delivered events an..." · Reviewed by Greptile

Comment thread apps/desktop/src/main/terminal/shell-integration.ts Outdated
Comment thread apps/sim/app/workspace/[workspaceId]/layout.test.tsx Outdated
Comment thread apps/sim/hooks/queries/desktop-activity.test.tsx Outdated
Comment thread apps/sim/app/workspace/[workspaceId]/layout.test.tsx Outdated
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

@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 cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 25 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

Comment thread apps/sim/lib/mothership/chat-status.test.ts Outdated
@cubic-dev-ai

cubic-dev-ai Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

@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 cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 25 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit b6861b3 into staging Oct 8, 2026
40 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/desktop-executor-ga-followups branch October 8, 2026 05:54

This branch was previously deployed

1 inactive deployment
Preview — 0b347e4b Deployed Oct 8, 2026 by vercel[bot]
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