Repository navigation
feat(coder/agent-relay-cursor): add additional_args - #1199
Merged
Merged
Conversation
Add an additional_args map of flag to value, appended to `cursor-agent worker` after the flags the module sets and before the `start` subcommand. Each flag is passed exactly as written (--long or -s, the admin's choice), followed by its value as the next argument; an empty value passes the flag alone. Values reach the CLI verbatim. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01R2TMgCPW8SL8kUCB28L4dt
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01R2TMgCPW8SL8kUCB28L4dt
additional_args may not set --pool, --idle-release-timeout, --auth-token-file, --auth-token, --computer-use or --share-desktop. Comments on both sides keep the list in sync with the worker command. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01R2TMgCPW8SL8kUCB28L4dt
This was referenced Oct 22, 2026
Contributor
Module Scorecard Check
|
| 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 main example shows the default (install_cli = true) and the additional_args section shows a second full module block. However, computer_use = true and share_desktop = true are only described in the "Requirements" section without a dedicated module example block. No structured "modes" section exists; the major desktop/computer-use configurations lack standalone examples with sensible defaults. |
| Visual preview | 5 | 0 | No image, GIF, or video is embedded in the README. The frontmatter icon field points to a registry icon SVG, which does not count as a visual preview of the module in action. |
Agent Integration — 5 / 25
| Criterion | Max | Score | Notes |
|---|---|---|---|
| AI governance | 10 | 0 | No mention of Coder AI Gateway or Agent Firewall anywhere in the README or source. The auth path (Agent Relay session tokens) is documented, but there is no documentation of Coder governing routing, policy enforcement, or firewall rules for the agent. |
| Dashboard entry point | 5 | 5 | Two coder_app resources (cursor_web, cursor_desktop) are created conditionally when agent_relay_session_id is set. The README explicitly documents both: "Open in Cursor Web opens the cloud agent at https://cursor.com/agents/<id>" and "Open in Cursor Desktop opens it with cursor://anysphere.cursor-deeplink/background-agent?bcId=<id>." |
| Session continuity | 5 | 0 | The README does not document resuming an existing agent session across reconnects or relaunches. The --idle-release-timeout keeps the worker alive between turns, but no session-resume mechanism (native resume, session ID reuse, tmux/screen/boo) is documented. |
| Managed configuration | 5 | 0 | No documentation of managed MCP servers, settings files, policies, or workdir configuration. additional_args allows passing arbitrary CLI flags but does not constitute managed configuration in the rubric's sense. |
Credential Hygiene — 20 / 20
| Criterion | Max | Score | Notes |
|---|---|---|---|
| Secrets marked sensitive | 16 | 16 | agent_relay_credential is declared ephemeral = true with mask_input = true in styling. The token is written to a file with umask 077 (mode 0600), passed via --auth-token-file (never on the command line), unset from the supervisor's environment, and deleted on worker exit. README examples contain no inline secrets or placeholder keys. |
| Non-hardcoded auth path | 4 | 4 | The README's "Worker credential" section documents that "The pool's service-account API key never leaves Agent Relay." The credential is minted per-claim by Cursor, stamped as an ephemeral parameter by Agent Relay, and the user never pastes a raw key into the template. |
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 download URL. cli_binary overrides the binary path, and install_cli toggles the download, but neither replaces the download URL. No variable can point the installer to 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") and in the variable description. The install script short-circuits when the binary is on PATH; the start script unconditionally adds ~/.local/bin to PATH to find a baked-in CLI. Fully documented and tested. |
| Egress transparency | 3 | 0 | No dedicated README section enumerates external endpoints. The install URL (cursor.com/install), the worker's API connections, and the app URLs (cursor.com/agents/, cursor://) are mentioned in passing within their respective feature sections, but there is no "Network Requirements," "Egress," or "Air-gapped" section. |
| Runs without sudo | 2 | 2 | All scripts (install.sh.tftpl, start.sh.tftpl, status.sh.tftpl) operate exclusively under $HOME and use `curl |
Engineering Quality — 10 / 10
| Criterion | Max | Score | Notes |
|---|---|---|---|
| Input quality | 6 | 6 | All 9 variables have clear descriptions, sensible defaults, and type constraints. cli_binary has a regex validation rejecting shell metacharacters. share_desktop validates that computer_use is true. serving_log_pattern rejects empty strings. additional_args has two validations: flag-name format and reserved-flag exclusion. |
| Test coverage | 4 | 4 | main.tftest.hcl (14 test runs) covers the parameter contract, script rendering, flag wiring, and validation failures. main.test.ts (15+ test cases) runs the actual install/start scripts in a container with a stub agent binary, exercising the full supervisor lifecycle (idle, working, serving, orphaned, done, failed), credential file handling, shell-injection resistance, and restart semantics. |
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.
5 of 10 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds an
additional_argsinput toagent-relay-cursorfor passing extra flags to the Cursor CLI'sagent worker. This matches coder/registry#1198 foragent-relay-claude-code.additional_argsis a map of flag to value. Each key goes to the CLI exactly as written, so the admin decides between a long flag (--flag) and a short one (-f). The value comes next as a separate argument, and an empty value passes the flag alone. The flags go after the ones the module sets and before thestartsubcommand.printf %qbefore writing it into the detached supervisor, so values reach the CLI unchanged: spaces, quotes,$VARand backticks are not split or expanded.--nameor-n, and values can't contain newlines.--pool,--idle-release-timeout,--auth-token-file,--auth-token(the token is kept off the command line on purpose),--computer-use,--share-desktop. A comment inmain.tfand instart.sh.tftplsays to keep this list in sync with the worker command.Type of Change
Module Information
Path:
registry/coder/modules/agent-relay-cursorNew version:
v0.6.0Breaking change: [ ] Yes [x] No — the new input defaults to
{}, which leaves the worker command unchanged.Testing & Validation
terraform test, 16 passed (new: empty default, rendering and base64 encoding, rejecting a malformed key, rejecting a flag the module sets). I added a container test inmain.test.ts, but it could not run here because the runner has no Docker daemon.bun fmt);./scripts/terraform_validate.shpassesterraform consoleand ran it against a stubagent. Its argv wasworker --pool p --idle-release-timeout 600 --auth-token-file … --name <two words $HOME \id` 'q' "d"> --verbose -t start`, with each value arriving unchanged.Related Issues
None
Generated by Claude Code