Repository navigation
feat(coder/agent-relay-claude-code): configure the health port and report session attachment - #1210
Merged
Merged
Conversation
…port session attachment
Contributor
Module Scorecard Check
|
| Theme | Before | After |
|---|---|---|
| Presentation & Onboarding | 6 / 17 | 12 / 17 |
| Integration | 0 / 25 | 5 / 25 |
| Credential Hygiene | 20 / 20 | 20 / 20 |
| Restricted-Environment | 12 / 20 | 12 / 20 |
| Engineering Quality | 10 / 10 | 10 / 10 |
| Overall | 52 / 100 | 64 / 100 |
Full scorecard for this PR
| Presentation & Onboarding | Agent Integration | Credential Hygiene | Restricted-Environment Readiness | Engineering Quality | Overall |
|---|---|---|---|---|---|
| 12 / 17 | 5 / 25 | 20 / 20 | 12 / 20 | 10 / 10 | 64 / 100 |
Drilldown
Presentation & Onboarding — 12 / 17
| Criterion | Max | Score | Notes |
|---|---|---|---|
| Configuration-mode examples | 12 | 12 | README shows the default (install_cli=true) example, a full additional_args example, and a full health_port override example; install_cli=false/BYO-image mode is clearly explained in the Requirements section and inline comments. Major modes are each covered with sensible defaults shown. |
| Visual preview | 5 | 0 | No image, GIF, or video anywhere in the README; only an icon reference in frontmatter. |
Credential Hygiene — 20 / 20
| Criterion | Max | Score | Notes |
|---|---|---|---|
| Secrets marked sensitive | 16 | 16 | agent_relay_credential is ephemeral = true with mask_input: true styling and rendered disabled; no README example inlines a raw key — credentials are entirely relay-stamped, never typed by a user. |
| Non-hardcoded auth path | 4 | 4 | README documents that auth flows entirely through Agent Relay's work-order JWT (agent_relay_credential), stamped automatically — no manual key-pasting path exists or is shown. |
Restricted-Environment Readiness — 12 / 20
| Criterion | Max | Score | Notes |
|---|---|---|---|
| Mirrorable artifact source | 5 | 0 | install.sh.tftpl hardcodes curl https://claude.ai/install.sh -fsSL | bash; no module variable overrides this download URL (cli_binary only overrides the binary path/name, not the install source). |
| Bring-your-own binary | 10 | 10 | install_cli = false fully disables the install step (documented in the first example's inline comment and the Requirements section) and the start script finds a pre-baked CLI via PATH/~/.local/bin. |
| Egress transparency | 3 | 0 | No dedicated README section enumerates endpoints; the claude.ai/install.sh URL and Anthropic API usage appear only in script comments, not in the README at all. |
| Runs without sudo | 2 | 2 | install.sh.tftpl and start.sh.tftpl never invoke sudo; both run as the agent user (tests run as root but nothing requires elevation). |
Engineering Quality — 10 / 10
| Criterion | Max | Score | Notes |
|---|---|---|---|
| Input quality | 6 | 6 | All variables have clear descriptions and defaults; cli_binary, exit_if_unused_min, health_port, and additional_args all carry meaningful validation blocks. |
| Test coverage | 4 | 4 | main.tftest.hcl thoroughly covers parameter contract and rendering logic; main.test.ts exercises real container lifecycle (install/start, state transitions, wrapper, health probe) end-to-end. |
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; auth/routing is handled solely by Agent Relay's own dispatch/JWT mechanism, which is a different product. |
| Dashboard entry point | 5 | 0 | No coder_app is declared or documented; README explicitly warns against exposing health_port via coder_app or any network surface. |
| Session continuity | 5 | 2.5 | README documents that the runner process "holds a session, including between turns" and tracks it via agent_relay_session_id/active_sessions, but this is framed as internal reaping bookkeeping rather than a documented user-facing resume/reconnect flow — under-documented for this criterion. |
| Managed configuration | 5 | 2.5 | additional_args lets operators pass arbitrary extra CLI flags to the runner (documented with a full example), but workdir (base_dir) and other settings are documented only in Terraform variable descriptions, not the README itself. |
Overall — 64 / 100
Raw 59 / 92 → round(59 / 92 × 100) = 64
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.
Emyrk
marked this pull request as ready for review
October 27, 2026 13:27
matifali
approved these changes
Oct 27, 2026
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.
Refs RELAY-56.
Makes the runner's health port configurable and adds a metadata script that reports whether the runner is running and holds a session.
health_portvariable, default3286(not the CLI's common8080), passed as--health-port;0disables the listener.session_attached_metadata_scriptoutput readsactive_sessionsfrom/healthzand prints one state from the table below.health_urloutput exposes the loopback URL for template scripts.--health-portjoins the reservedadditional_argsflags.agent_relay_session_attachedattachedactive_sessions > 0, including between turnsunattachedactive_sessions = 0: waiting for its first session, or released and still alivestoppeddone,failed,idle, or missing, or the recorded pid is dead or no longer the CLIdisabledhealth_port = 0/healthzunreachable or has no numericactive_sessionsRunning means the supervisor recorded
working <pid>,kill -0 <pid>succeeds, and/proc/<pid>/cmdlinestill names the CLI. The supervisor replaces that line withdone <code>when the runner exits.Agent context
agent_relay_statusstays separate: it reports runner lifecycle for reaping, while this key reports live attachment for keep-alive.--health-port, with no bind-host option, so the address cannot be fully configured. The README warns not to publish the port.attachedsample. Its README still names 3284/3285 andtrue.terraform test17/17,bun test17/17, shellcheck clean on the rendered script. The attachment tests use a stubbedcurlthat serves a real 2.1.310/healthzbody. They were not run against a registered runner.Coder Agents on behalf of @Emyrk.