Repository navigation
fix: show only the current runner status in freeform WELCOME.txt - #265
Merged
Merged
Conversation
## Short Summary (TL;DR) The freeform self-hosted runner status no longer piles up in `~/WELCOME.txt`. Each workspace start now replaces the previous status line, so a stale "NOT started" line from the first boot goes away too. ## The Issue Freeform copies `~/WELCOME.txt` once and keeps it across restarts. The runner startup snippet appended its status line on every start. After many restarts, the file showed one "✓ N Claude Code self-hosted runner(s) started" line per start. It also kept the "✗ … NOT started: save your environment secret" line from the first boot, when no secret existed yet. ## How This PR Solves The Issue Before it writes the status, the startup snippet deletes every line in `~/WELCOME.txt` that contains "Claude Code self-hosted runner". The deletion runs even when the runner is disabled, so turning the runner off also removes its old line. Existing workspaces lose their accumulated lines on the next start. ## Manual Testing Instructions Push the template as an inactive version: ```bash make push-template-freeform ACTIVATE=false coder templates versions list freeform ``` Create a workspace from that version with the runner on: ```bash coder create --template freeform --template-version <version> runnertest --yes --use-parameter-defaults --parameter enable_claude_runner=true --parameter claude_runner_capacity=1 coder ssh runnertest -- "grep 'self-hosted runner' ~/WELCOME.txt" # Expect one "✗ ... NOT started" line ``` Add a secret and restart twice: ```bash coder ssh runnertest -- "echo dummy > ~/.claude-runner/environment-secret && chmod 600 ~/.claude-runner/environment-secret" coder restart runnertest --yes coder restart runnertest --yes coder ssh runnertest -- "grep 'self-hosted runner' ~/WELCOME.txt" # Expect exactly one "✓ 1 Claude Code self-hosted runner(s) started" line, and no "NOT started" line ``` Clean up: ```bash coder delete runnertest --yes ``` ## Automated Testing Overview Claude Code ran `terraform fmt -check -recursive`, `make validate`, and `make test-templates` on Linux, and all passed. Claude Code ran the manual steps above on staging-coder.ddev.com. `WELCOME.txt` stayed at one runner line and 19 lines total after two restarts. No new Terraform tests: the mock tests don't run the startup script. ## Release/Deployment Notes The Claude Code remote control banner in `modules/claude-remote-control` also appends to `~/WELCOME.txt` on every start, so it piles up in freeform the same way. This PR does not change it. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01UrTUMvZiSTQq4KvnwqNQTo Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UrTUMvZiSTQq4KvnwqNQTo
PreviewsThe start.coder.ddev.com landing-page preview has been removed. Read the Docs keeps or removes its own docs preview. |
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.
Short Summary (TL;DR)
The freeform self-hosted runner status no longer piles up in
~/WELCOME.txt. Each workspace start now replaces the previous status line, so a stale "NOT started" line from the first boot goes away too.The Issue
Freeform copies
~/WELCOME.txtonce and keeps it across restarts. The runner startup snippet appended its status line on every start. After many restarts, the file showed one "✓ N Claude Code self-hosted runner(s) started" line per start. It also kept the "✗ … NOT started: save your environment secret" line from the first boot, when no secret existed yet.How This PR Solves The Issue
Before it writes the status, the startup snippet deletes every line in
~/WELCOME.txtthat contains "Claude Code self-hosted runner". The deletion runs even when the runner is disabled, so turning the runner off also removes its old line. Existing workspaces lose their accumulated lines on the next start.Manual Testing Instructions
Push the template as an inactive version:
Create a workspace from that version with the runner on:
Add a secret and restart twice:
Clean up:
Automated Testing Overview
Claude Code ran
terraform fmt -check -recursive,make validate, andmake test-templateson Linux, and all passed. Claude Code ran the manual steps above on staging-coder.ddev.com.WELCOME.txtstayed at one runner line and 19 lines total after two restarts. No new Terraform tests: the mock tests don't run the startup script.Release/Deployment Notes
The Claude Code remote control banner in
modules/claude-remote-controlalso appends to~/WELCOME.txton every start, so it piles up in freeform the same way. This PR does not change it.🤖 Generated with Claude Code
https://claude.ai/code/session_01UrTUMvZiSTQq4KvnwqNQTo