Skip to content

feat(coder/agent-relay-cursor): export the cloud session id - #1146

Merged
matifali merged 3 commits into
mainfrom
cursor/cursor-session-app-2eba
Sep 25, 2026
Merged

matifali merged 3 commits into
mainfrom
cursor/cursor-session-app-2eba

Conversation

@matifali

@matifali matifali commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Export session_id from the Cursor Agent Relay module. It is the agent_relay_session_id Agent Relay already stamps, and it is empty when a person creates the workspace by hand.
  • When that id is set, the module adds two external apps, using Cursor's names for the clients:
    • Open in Cursor Web at https://cursor.com/agents/<id>
    • Open in Cursor Desktop at cursor://anysphere.cursor-deeplink/background-agent?bcId=<id>

Test plan

  • A manual plan has an empty session_id and creates neither app (main.tftest.hcl)
  • Dogfood agent-relay-template-docker pins this commit and a Cursor dispatch shows both buttons

Templates can open the Cursor cloud session from a coder_app when Agent Relay stamps agent_relay_session_id.
@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Module Scorecard Check

coder/agent-relay-cursor: 71 → 49

⚠️ Score regression: 71 → 49 (-22). Check the drilldown for which criteria dropped.

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

Presentation & Onboarding — 6 / 17

Criterion Max Score Notes
Configuration-mode examples 12 6 Only one code example is shown (install_cli). Other modes — computer_use, cli_binary override, repo-scoped pools, credential-kind switching — are described only in prose/tables (e.g. the insecure_shared_token credential-kind table), with no worked example for each mode.
Visual preview 5 0 No image, GIF, or video anywhere in the README.

Agent Integration — 5 / 25

Criterion Max Score Notes
AI governance 10 0 No mention of Coder AI Gateway or Agent Firewall anywhere; the module integrates with "Agent Relay," a distinct dispatch mechanism, not AI Gateway/Agent Firewall.
Dashboard entry point 5 5 coder_app.cursor_web and coder_app.cursor_desktop are implemented and documented ("Open in Cursor Web"/"Open in Cursor Desktop" section), conditioned on agent_relay_session_id.
Session continuity 5 0 No documented resume/reconnect support or persistent session manager (tmux/screen). The module documents idle-release timers and worker restart/liveness bookkeeping, but this governs workspace reaping, not resuming an interrupted agent session.
Managed configuration 5 0 No documented MCP, settings, policy, or workdir management by this module (repo cloning/SCM credentials are explicitly pushed to the template, not handled here).

Credential Hygiene — 12 / 20

Criterion Max Score Notes
Secrets marked sensitive 16 8 agent_relay_credential uses styling.mask_input = true and ephemeral = true, not a literal sensitive = true. README examples show no inline/plaintext secrets, and the "Worker credential" section explains masking and non-persistence in detail, but the literal sensitive-marking mechanism required by the rubric is absent.
Non-hardcoded auth path 4 4 README's "Worker credential" section documents the service-account key never leaving Agent Relay; a per-user, short-lived sub-token is exchanged automatically and injected via env var — no raw key pasted into the template.

Restricted-Environment Readiness — 12 / 20

Criterion Max Score Notes
Mirrorable artifact source 5 0 install.sh.tftpl hardcodes curl https://cursor.com/install -fsSL | bash. No module variable (only cli_binary, install_cli, state_file, log_file, serving_log_pattern, computer_use exist) overrides this download URL.
Bring-your-own binary 10 10 install_cli = false fully skips download; README documents this explicitly ("Bake it into the image and set this to false for faster workspaces," plus the Requirements section), and tests confirm a pre-baked ~/.local/bin/agent is found.
Egress transparency 3 0 No dedicated README section enumerating install/runtime endpoints (e.g. cursor.com) or notes for restricted/air-gapped environments; the domain only appears in script comments, not the README.
Runs without sudo 2 2 install.sh.tftpl, start.sh.tftpl, and status.sh.tftpl contain no sudo invocations anywhere; scripts run entirely as the workspace user.

Engineering Quality — 10 / 10

Criterion Max Score Notes
Input quality 6 6 Clear, thorough descriptions for every variable; sensible defaults (install_cli = true, computer_use = false); validation blocks on cli_binary (command-safe regex) and serving_log_pattern (non-empty).
Test coverage 4 4 main.tftest.hcl covers the parameter contract, script wiring, credential-kind branching, and injection-safety; main.test.ts runs true end-to-end container tests covering install/start lifecycle, restart semantics, liveness detection, and shell-injection safety.

Overall — 49 / 100

Raw 45 / 92 → round(45 / 92 × 100) = 49

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.

…d Desktop

The module adds the buttons when Agent Relay stamps a session id, using Cursor's names for the two clients.
@matifali matifali added the version:minor Add to PRs requiring a minor version upgrade label Sep 24, 2026
@github-actions

This comment was marked as resolved.

@matifali
matifali requested a review from Emyrk September 25, 2026 06:08

@Emyrk Emyrk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Oh this is cool

@matifali
matifali merged commit a789bf9 into main Sep 25, 2026
5 checks passed
@matifali
matifali deleted the cursor/cursor-session-app-2eba branch September 25, 2026 15:26
@matifali

Copy link
Copy Markdown
Member Author

Tested this in the Dogfood environment.

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