Install scripts do not auto-set Daemon.UpdateChannel when using --channel beta
Problem
When users opt into the beta release channel via --channel beta, the install script downloads the correct beta binary but does not persist Daemon.UpdateChannel: "beta" into netclaw.json. This causes the daemon's self-update mechanism to default to stable channel (the default) and compare against the latest stable release instead of the latest prerelease.
Symptoms
- User runs
curl ... | bash -s -- --channel beta (or the equivalent on Windows/Docker)
- The correct beta binary is installed
netclaw update --check reports up to date even when a newer beta is available
- The daemon's background update check also reports no updates
Root Cause
The install scripts (install.sh, install.ps1) accept --channel beta and use it to resolve the version from the manifest's latestPrerelease pointer, but they never write Daemon.UpdateChannel: "beta" to the config file.
Meanwhile, DaemonConfig defaults UpdateChannel to UpdateChannel.Stable when the config key is missing:
// DaemonConfig.cs line 54
public UpdateChannel UpdateChannel { get; init; } = UpdateChannel.Stable;
And the update checker only uses LatestPrerelease when the channel is explicitly beta:
// UpdateCheckService.cs line 258
var targetVersion = channel == UpdateChannel.Beta && !string.IsNullOrEmpty(manifest.LatestPrerelease)
? manifest.LatestPrerelease
: manifest.Latest;
Steps to Reproduce
- Install a beta version via install script with
--channel beta
- Run
netclaw update --check
- Observe: reports
up to date even when a newer beta is available
- Fix (manual):
jq '.Daemon.UpdateChannel = "beta"' ~/.netclaw/config/netclaw.json
Proposed Fix
Both install.sh and install.ps1 should auto-write Daemon.UpdateChannel: "beta" into the config when --channel beta is passed and an existing config file is present.
For install.sh, a jq-based patch would look like:
if [ "$CHANNEL" = "beta" ] && [ "$DRY_RUN" = false ]; then
CONFIG_FILE="$HOME/.netclaw/config/netclaw.json"
if [ -f "$CONFIG_FILE" ] && command -v jq >/dev/null 2>&1; then
jq '.Daemon.UpdateChannel = "beta"' "$CONFIG_FILE" > "${CONFIG_FILE}.tmp" && \
mv "${CONFIG_FILE}.tmp" "$CONFIG_FILE"
echo " Updated UpdateChannel to 'beta' in $CONFIG_FILE"
fi
fi
The Windows installer should do the equivalent with PowerShell's ConvertFrom-Json / ConvertTo-Json, and Docker instructions should explicitly call out this config requirement.
Affected Files
scripts/install.sh
scripts/install.ps1
docs/getting-started/installation.md (ensure config requirement is prominent)
Install scripts do not auto-set Daemon.UpdateChannel when using --channel beta
Problem
When users opt into the beta release channel via
--channel beta, the install script downloads the correct beta binary but does not persistDaemon.UpdateChannel: "beta"intonetclaw.json. This causes the daemon's self-update mechanism to default tostablechannel (the default) and compare against the latest stable release instead of the latest prerelease.Symptoms
curl ... | bash -s -- --channel beta(or the equivalent on Windows/Docker)netclaw update --checkreportsup to dateeven when a newer beta is availableRoot Cause
The install scripts (
install.sh,install.ps1) accept--channel betaand use it to resolve the version from the manifest'slatestPrereleasepointer, but they never writeDaemon.UpdateChannel: "beta"to the config file.Meanwhile,
DaemonConfigdefaultsUpdateChanneltoUpdateChannel.Stablewhen the config key is missing:And the update checker only uses
LatestPrereleasewhen the channel is explicitlybeta:Steps to Reproduce
--channel betanetclaw update --checkup to dateeven when a newer beta is availablejq '.Daemon.UpdateChannel = "beta"' ~/.netclaw/config/netclaw.jsonProposed Fix
Both
install.shandinstall.ps1should auto-writeDaemon.UpdateChannel: "beta"into the config when--channel betais passed and an existing config file is present.For
install.sh, ajq-based patch would look like:The Windows installer should do the equivalent with PowerShell's
ConvertFrom-Json/ConvertTo-Json, and Docker instructions should explicitly call out this config requirement.Affected Files
scripts/install.shscripts/install.ps1docs/getting-started/installation.md(ensure config requirement is prominent)