Skip to content

refactor(desktop): unify sidecar controller interface#37589

Open
Hona wants to merge 2 commits into
anomalyco:devfrom
Hona:unified-sidecar-controller
Open

refactor(desktop): unify sidecar controller interface#37589
Hona wants to merge 2 commits into
anomalyco:devfrom
Hona:unified-sidecar-controller

Conversation

@Hona

@Hona Hona commented Jul 18, 2026

Copy link
Copy Markdown
Member

Summary

Establishes a unified \SidecarInstance\ interface and \BaseSidecarController\ implementation for desktop sidecars (local vs WSL).

Details

  • Encapsulates sidecar lifecycle states (\idle, \starting,
    eady, \ ailed, \stopped).
  • Unifies sidecar URL resolution and teardown semantics under a common interface contract.

Copilot AI review requested due to automatic review settings July 18, 2026 02:02
@Hona
Hona requested a review from Brendonovich as a code owner July 18, 2026 02:02

Copilot AI 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.

Pull request overview

Introduces a shared sidecar abstraction in the desktop main process by defining a single SidecarInstance contract and providing a reusable BaseSidecarController implementation to standardize lifecycle/status handling across sidecar kinds (local vs WSL).

Changes:

  • Added SidecarInstance / SidecarStatus / SidecarKind types plus a BaseSidecarController implementation.
  • Added unit tests validating lifecycle state transitions and startup-failure handling.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
packages/desktop/src/main/sidecar/types.ts Adds unified sidecar interface/types and a base controller implementation with status transitions.
packages/desktop/src/main/sidecar/controller.test.ts Adds tests for controller state transitions and failure behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +28 to +29
expect(controller.getUrl()).rejects.toThrow("Failed to start server")
expect(controller.status).toBe("failed")
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.

2 participants