Skip to content

feat(agent-relay-cursor): add share_desktop - #1158

Merged
matifali merged 1 commit into
mainfrom
matifali/agent-relay-cursor-share-desktop
Sep 30, 2026
Merged

matifali merged 1 commit into
mainfrom
matifali/agent-relay-cursor-share-desktop

Conversation

@matifali

@matifali matifali commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

Description

Adds share_desktop to agent-relay-cursor. When set, the worker starts with --share-desktop=view_and_control, so people can watch or take control of the agent's desktop from the Desktop tab in Cursor. It requires computer_use = true (validated) and TigerVNC/Xfce in the image, e.g. ghcr.io/coder/agent-relay-workspace:desktop (coder/agent-relay#86).

The mode is passed explicitly because --share-desktop takes an optional argument and, bare, swallows the following start.

Type of Change

  • Feature/enhancement

Module Information

Path: registry/coder/modules/agent-relay-cursor
New version: v0.4.0
Breaking change: [ ] Yes [x] No

Testing & Validation

  • Tests pass (bun test: 19 pass; terraform test: 12 pass)
  • Code formatted (bun fmt)
  • Changes tested locally: end to end on a local Coder with Agent Relay, a Cursor pool agent was dispatched into a workspace on the desktop image with computer_use + share_desktop. The worker ran with --computer-use --share-desktop=view_and_control, started Xtigervnc and Xfce, and agent worker debug reported computer use ready and desktop share supported. The agent's desktop showed up live in Cursor's Desktop tab.

Related Issues

coder/agent-relay#86

https://claude.ai/code/session_01L2wLoUuHsK2Nzm93TjjoMi

@github-actions

Copy link
Copy Markdown
Contributor

Module Scorecard Check

coder/agent-relay-cursor: 58 → 58

✅ Score unchanged at 58 / 100. This PR does not affect the module's scorecard; the results are still good.

Theme Before After
Presentation & Onboarding 6 / 17 6 / 17
Integration 5 / 25 5 / 25
Credential Hygiene 20 / 20 20 / 20
Restricted-Environment 12 / 20 12 / 20
Engineering Quality 10 / 10 10 / 10
Overall 58 / 100 58 / 100
Full scorecard for this PR
Presentation & Onboarding Agent Integration Credential Hygiene Restricted-Environment Readiness Engineering Quality Overall
6 / 17 5 / 25 20 / 20 12 / 20 10 / 10 58 / 100
Drilldown

Presentation & Onboarding — 6 / 17

Criterion Max Score Notes
Configuration-mode examples 12 6 The README shows one full example (default install_cli = true). Other major modes—install_cli = false (baked image), computer_use = true, share_desktop = true—are mentioned in the Requirements section but lack dedicated examples with sensible defaults. Partial credit for documenting the primary mode and referencing the others.
Visual preview 5 0 No image, GIF, or video is embedded in the README. The frontmatter references an SVG icon (icon: ../../../../.icons/cursor.svg), but icons do not count.

Credential Hygiene — 20 / 20

Criterion Max Score Notes
Secrets marked sensitive 16 16 agent_relay_credential is declared with mask_input = true and ephemeral = true in its styling block. The README example contains no inline secrets—only agent_id and install_cli. The "Worker credential" section explicitly states the token "is never written to disk."
Non-hardcoded auth path 4 4 The "Worker credential" section documents that Agent Relay mints a per-user sub-token at dispatch time; the service-account key never leaves Agent Relay. The README shows the full flow (relay exchanges key → stamps ephemeral parameter → module reads from environment). No raw keys are pasted into templates.

Restricted-Environment Readiness — 12 / 20

Criterion Max Score Notes
Mirrorable artifact source 5 0 The install URL https://cursor.com/install is hardcoded in install.sh.tftpl. No module input variable overrides this URL. cli_binary changes the binary path, not the download source. No variable exists to point the installer at an internal mirror.
Bring-your-own binary 10 10 install_cli = false is documented in the README ("Bake the CLI into the image and set this to false for faster workspaces"). The install script becomes a no-op, and the start script still checks ~/.local/bin and PATH for the binary. Fully documented and tested.
Egress transparency 3 0 No dedicated README section enumerates external endpoints. cursor.com/install appears in the variable description and install script; cursor.com/agents/<id> and cursor:// appear in the app descriptions. These are scattered across unrelated sections with no air-gapped or restricted-network guidance.
Runs without sudo 2 2 All three scripts (install.sh.tftpl, start.sh.tftpl, status.sh.tftpl) never invoke sudo. The installer writes to ~/.local/bin; the start script writes to $HOME/.coder-modules/.... No root required for core functionality.

Engineering Quality — 10 / 10

Criterion Max Score Notes
Input quality 6 6 All 8 module variables have clear descriptions and sensible defaults. cli_binary has a regex validation rejecting shell metacharacters; share_desktop validates the computer_use dependency; serving_log_pattern rejects empty strings. The agent_relay_cursor_credential_kind parameter includes named options.
Test coverage 4 4 main.tftest.hcl (12 test runs) covers the parameter contract, script rendering, credential wiring, and validation failures. main.test.ts (14 test cases) exercises the actual install/start scripts in a container with stub binaries, verifying lifecycle states, restart idempotency, credential routing, shell-injection safety, and file layout. Clear separation: HCL tests cover Terraform-level logic; TS tests cover end-to-end script behavior.

Agent Integration — 5 / 25

Criterion Max Score Notes
AI governance 10 0 No mention of Coder AI Gateway or Agent Firewall in the README or code. The credential system is Agent Relay's own token-minting flow, not AI Gateway routing or Agent Firewall policy enforcement.
Dashboard entry point 5 5 Two coder_app resources are declared: cursor_web ("Open in Cursor Web") and cursor_desktop ("Open in Cursor Desktop"), both conditional on agent_relay_session_id being set. Documented in the README with the exact URLs and behavior.
Session continuity 5 0 The README documents worker-process restart safety (re-running the start step leaves a live worker alone), but does not document resuming a Cursor chat session across reconnects or relaunches. No mention of session-ID resumption, tmux, screen, or boo. Session continuity is delegated to Cursor/Agent Relay, not the module.
Managed configuration 5 0 No documentation of managed MCP servers, agent settings, policies, or workdir configuration. The module runs the Cursor CLI worker but does not expose or document any managed-configuration surface.

Overall — 58 / 100

Raw 53 / 92 → round(53 / 92 × 100) = 58

Tip

You can run this locally by telling your agent: "review this module against .github/scorecard/SCORECARD.md".


Scored against SCORECARD.md with solstice-1. Language-model scores are advisory.

@matifali
matifali requested a review from Emyrk September 29, 2026 19:17
@matifali matifali added the version:minor Add to PRs requiring a minor version upgrade label Sep 29, 2026
@matifali
matifali merged commit 2101df7 into main Sep 30, 2026
6 checks passed
@matifali
matifali deleted the matifali/agent-relay-cursor-share-desktop branch September 30, 2026 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

version:minor Add to PRs requiring a minor version upgrade

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants