Repository navigation
feat(coder/agent-relay-claude-code): add additional_args - #1198
Merged
Merged
Conversation
Add an additional_args map of flag to value, appended to `claude self-hosted-runner` after the flags the module sets. 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
Contributor
Module Scorecard Check
|
| Theme | Before | After |
|---|---|---|
| Presentation & Onboarding | 6 / 17 | 12 / 17 |
| Integration | 0 / 25 | 0 / 25 |
| Credential Hygiene | 20 / 20 | 20 / 20 |
| Restricted-Environment | 12 / 20 | 12 / 20 |
| Engineering Quality | 10 / 10 | 10 / 10 |
| Overall | 52 / 100 | 59 / 100 |
Full scorecard for this PR
| Presentation & Onboarding | Agent Integration | Credential Hygiene | Restricted-Environment Readiness | Engineering Quality | Overall |
|---|---|---|---|---|---|
| 12 / 17 | 0 / 25 | 20 / 20 | 12 / 20 | 10 / 10 | 59 / 100 |
Drilldown
Presentation & Onboarding — 12 / 17
| Criterion | Max | Score | Notes |
|---|---|---|---|
| Configuration-mode examples | 12 | 12 | README documents the two major modes: install_cli = true (default, downloads CLI) shown in the primary example, and install_cli = false (baked image) documented in the Requirements section. additional_args has a dedicated example block. cli_binary override is documented. All variables carry sensible defaults. |
| Visual preview | 5 | 0 | No image, GIF, or video embedded in the README. The frontmatter icon field points to a Claude SVG, which is an icon, not a visual preview of the module in action. |
Agent Integration — 0 / 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 credential is a work-order JWT stamped by Agent Relay, but there is no documented integration with AI Gateway routing or Agent Firewall policy enforcement. |
| Dashboard entry point | 5 | 0 | No coder_app resource is declared and the README does not document a dashboard entry point. The module is a headless runner dispatched by Agent Relay. |
| Session continuity | 5 | 0 | No documentation of resuming an existing agent session across reconnects or relaunches. No mention of session-ID-based resume, boo, tmux, screen, or any persistent session manager. The agent_relay_session_id parameter is for Agent Relay deduplication, not user-facing session continuity. |
| Managed configuration | 5 | 0 | No documented support for managed MCP servers, settings files, policies, or workdir configuration. base_dir sets the checkout directory and additional_args passes CLI flags, but neither constitutes managed configuration in the rubric sense. |
Credential Hygiene — 20 / 20
| Criterion | Max | Score | Notes |
|---|---|---|---|
| Secrets marked sensitive | 16 | 16 | agent_relay_credential is styled with mask_input = true in its coder_parameter block. The README states "the credential is masked." No inline secrets or placeholder keys appear in any README example. |
| Non-hardcoded auth path | 4 | 4 | The README documents that Agent Relay stamps a single-use work-order JWT on each build; the user never pastes a raw key. The credential flows through coder_env → SELF_HOSTED_RUNNER_ENVIRONMENT_SECRET, entirely managed by the relay. |
Restricted-Environment Readiness — 12 / 20
| Criterion | Max | Score | Notes |
|---|---|---|---|
| Mirrorable artifact source | 5 | 0 | The install URL https://claude.ai/install.sh is hardcoded in install.sh.tftpl. No module input variable overrides this URL. cli_binary overrides the binary path, not the download source; install_cli is a boolean toggle. No variable can point the installer at an internal mirror. |
| Bring-your-own binary | 10 | 10 | install_cli (default true) can be set to false to skip the download entirely. The README explicitly documents: "Bake the CLI into the image and set this to false for faster workspaces." The install script checks command -v and short-circuits when the binary is already present. |
| Egress transparency | 3 | 0 | No dedicated README section enumerates external endpoints contacted at install or runtime. The install script contacts claude.ai / downloads.claude.ai and the runner contacts Anthropic's API, but these are only visible in source code, not in a documented network/air-gapped section. |
| Runs without sudo | 2 | 2 | No script invokes sudo. The install step writes to ~/.local/bin; the start step creates directories under $HOME. All operations work as an unprivileged user. |
Engineering Quality — 10 / 10
| Criterion | Max | Score | Notes |
|---|---|---|---|
| Input quality | 6 | 6 | All nine variables carry clear descriptions and sensible defaults. cli_binary has a regex validation restricting it to a command name/path. exit_if_unused_min validates whole-number ≥ 0. additional_args has two validations: flag-format regex and reserved-flag rejection. |
| Test coverage | 4 | 4 | main.tftest.hcl covers the parameter contract (names, ephemeral flags, styling/masking), runner wiring, install-CLI behavior, additional-args encoding, and path overrides. main.test.ts runs the actual install and start scripts in a container with stub binaries, exercising the full supervisor lifecycle (idle, working, serving, done, failed, orphaned), the permissions wrapper, IS_SANDBOX enforcement, and shell-injection safety of serving_log_pattern. |
Overall — 59 / 100
Raw 54 / 92 → round(54 / 92 × 100) = 59
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.
4 of 9 tasks
…sets additional_args may not set --capacity, --base-dir, --exit-if-unused-min or --exec-path. Comments on both sides keep the list in sync with the runner command. Also replaces the README example flag with a placeholder, since --verbose is not a documented self-hosted-runner flag. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01R2TMgCPW8SL8kUCB28L4dt
dluman
approved these changes
Oct 22, 2026
dluman
left a comment
There was a problem hiding this comment.
Will enable semantic, reasonable approach to accessing additional environment settings to customize module behavior for org. workflows. ✅
Looks reasonable to me providing (map)string
matifali
enabled auto-merge (squash)
October 22, 2026 15:11
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-claude-codefor passing extra flags toclaude self-hosted-runner. coder/registry#1199 makes the same change toagent-relay-cursor.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--exec-path.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.--capacity,--base-dir,--exit-if-unused-min,--exec-path. Use thebase_dirandexit_if_unused_mininputs instead. A comment inmain.tfand instart.sh.tftplsays to keep this list in sync with the runner command.The name
additional_argsis the most common one in the registry;code-serverandttydalready use it.Type of Change
Module Information
Path:
registry/coder/modules/agent-relay-claude-codeNew version:
v0.3.0Breaking change: [ ] Yes [x] No — the new input defaults to
{}, which leaves the runner command unchanged.Testing & Validation
terraform test, 12 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)terraform consoleand ran it against a stubclaude. Its argv received--verbose,--namefollowed bytwo words $HOME \id` 'q' "d"unchanged, and-tfollowed byx y. The default{}` produces the same command as before.Related Issues
None
🤖 Generated with Claude Code
https://claude.ai/code/session_01R2TMgCPW8SL8kUCB28L4dt