Skip to content

fix(windows-install-e2e): real CI prereq path + Tailscale typo + DefaultShell + Get-RemoteHome (#94, #98, #99) - #187

Merged
joelteply merged 8 commits into
canaryfrom
ci/install-no-skip-prereqs
Apr 28, 2026
Merged

joelteply merged 8 commits into
canaryfrom
ci/install-no-skip-prereqs

Conversation

@joelteply

@joelteply joelteply commented Apr 28, 2026 •

Copy link
Copy Markdown
Contributor

Goal

Per Joel 2026-04-28: "need to get all installs working e2e or whats the point of a repo?"

End-to-end clean Windows install + verify via CI.

What's in here

CI changes:

  • Drop `AIRC_SKIP_PREREQS=1` everywhere. install.{sh,ps1} must now actually install everything missing on a stock runner.
  • All four jobs (linux + macos + windows + windows-ps5) verified install path.

Bug fixes (Windows install path):

Test plan

  • CI matrix exercises real install on stock linux/macos/windows runners
  • `airc doctor` exits 0 (informational) on both bash and PowerShell sides
  • install.ps1 exits 0 on a fresh runner with no tailscale login

🤖 Generated with Claude Code

…rrors

The skip-prereqs variant only validated the wiring (clone + symlink +
PATH), not that install.{sh,ps1} can actually install everything missing
on a stock runner. As Joel put it 2026-04-28: "need to get all installs
working e2e or whats the point of a repo?"

Changes:
- linux + macos: drop AIRC_SKIP_PREREQS, drop sudo apt-get prereq
  preinstall; install.sh must handle it.
- windows pwsh + windows PS 5.1: drop AIRC_SKIP_PREREQS; install.ps1
  must handle the winget bootstrap.
- airc doctor: hard-fail on non-zero exit. Was non-fatal during the
  initial wiring-test phase; now that real install is exercised, doctor
  must report environment-clean for the job to pass.

This will surface the real Windows install issues (#91, #94, #96, #98,
#99, #152) as CI failures so we can fix them with confidence. May also
surface Linux/macOS prereq gaps that the skip-prereqs variant masked.
Copilot AI review requested due to automatic review settings April 28, 2026 02:24

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates CI to exercise the “real” installation path (no prereq-skipping) and to treat airc doctor failures as job failures, so CI surfaces first-run install issues on fresh runners.

Changes:

  • Remove AIRC_SKIP_PREREQS from Linux/macOS/Windows install steps so install.sh/install.ps1 must auto-install missing dependencies.
  • Make airc doctor steps fail the job instead of logging and continuing.
  • Simplify the integration-suite setup by removing the explicit apt-get prereq install step and relying on install.sh.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/ci.yml
Comment on lines +53 to +57
- name: airc doctor (must report environment-clean)
run: |
export PATH="$HOME/.local/bin:$PATH"
which airc
airc doctor || echo "airc doctor reported issues (non-fatal in CI)"
airc doctor

Copilot AI Apr 28, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This workflow step assumes airc doctor will fail the step when it finds issues, but the bash implementation of default airc doctor currently doesn’t return a non-zero status when prereqs are missing (it prints the issue count but exits 0). As a result this CI gate won’t actually enforce “environment-clean” on Linux/macOS. Either change doctor to exit non-zero when issues>0, or add a dedicated CI/strict flag that returns failure reliably.

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/ci.yml
Comment on lines +106 to +110
- name: Stage install.sh + run (no skip-prereqs — real install path)
run: |
mkdir -p $HOME/.airc-src
cp -r . $HOME/.airc-src/
AIRC_SKIP_PREREQS=1 AIRC_DIR=$HOME/.airc-src bash install.sh
AIRC_DIR=$HOME/.airc-src bash install.sh

Copilot AI Apr 28, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI now runs install.sh without setting AIRC_SKIP_SSHD=1. install.sh’s ensure_prereqs will try to enable/install sshd unless AIRC_SKIP_SSHD is set; on macOS GitHub runners this can hit the non-interactive osascript admin path and potentially hang/fail. Consider exporting AIRC_SKIP_SSHD=1 for CI runs so the job tests prereq/package-manager wiring without attempting to enable Remote Login.

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/ci.yml
mkdir -p $HOME/.airc-src
cp -r . $HOME/.airc-src/
AIRC_SKIP_PREREQS=1 AIRC_DIR=$HOME/.airc-src bash install.sh
AIRC_DIR=$HOME/.airc-src bash install.sh

Copilot AI Apr 28, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI now runs install.sh without AIRC_SKIP_SSHD=1. install.sh’s ensure_prereqs enables/installs sshd unless explicitly skipped; the integration suite doesn’t need inbound sshd and enabling services in CI can be flaky/slow. Consider setting AIRC_SKIP_SSHD=1 here to avoid coupling the suite to systemd/sshd enablement while still exercising the rest of the real install path.

Suggested change
AIRC_DIR=$HOME/.airc-src bash install.sh
AIRC_DIR=$HOME/.airc-src AIRC_SKIP_SSHD=1 bash install.sh

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/ci.yml
Comment on lines 171 to 175
airc doctor
if ($LASTEXITCODE -ne 0) {
Write-Host "airc doctor reported issues (non-fatal in CI — see log)"
Write-Error "airc doctor failed with exit $LASTEXITCODE"
exit $LASTEXITCODE
}

Copilot AI Apr 28, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On Windows, this step checks $LASTEXITCODE after airc doctor, but airc is a PowerShell script; unless it explicitly exit <code>, $LASTEXITCODE reflects the most recent native command invoked inside the script (e.g., gh auth status) rather than an intentional doctor result. That makes the gate brittle/flaky. If CI should hard-fail on doctor issues, update airc.ps1’s Invoke-Doctor to exit 1 when it finds missing prereqs (and exit 0 otherwise), so the workflow can rely on a deterministic exit status.

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/ci.yml
@@ -46,15 +46,15 @@ jobs:
run: |
mkdir -p $HOME/.airc-src
cp -r . $HOME/.airc-src/

Copilot AI Apr 28, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cp -r . $HOME/.airc-src/ copies the .git/ directory into AIRC_DIR. install.sh treats any existing $CLONE_DIR/.git as an installed checkout and will switch off detached HEAD (e.g. PR merge ref) onto main/canary and git pull, meaning CI ends up installing/testing the remote channel tip rather than the PR commit. To actually validate “install FROM THIS COMMIT”, stage the source without .git (or delete .git after copy) so install.sh doesn’t auto-switch branches/pull.

Suggested change
cp -r . $HOME/.airc-src/
cp -r . $HOME/.airc-src/
rm -rf "$HOME/.airc-src/.git"

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/ci.yml
- name: Stage + install (real install path)
run: |
mkdir -p $HOME/.airc-src
cp -r . $HOME/.airc-src/

Copilot AI Apr 28, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as the other install.sh steps: staging the repo with cp -r . $HOME/.airc-src/ brings along .git/, so install.sh will treat it as an existing checkout, switch branches to main/canary, and pull—meaning the integration suite may not be running against the pushed commit you intended to validate. Stage without .git (or remove it) so install.sh doesn’t rewrite the checkout.

Suggested change
cp -r . $HOME/.airc-src/
cp -r . $HOME/.airc-src/
rm -rf $HOME/.airc-src/.git

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/ci.yml
AIRC_SKIP_PREREQS=1 AIRC_DIR=$HOME/.airc-src bash install.sh
# Real install — no AIRC_SKIP_PREREQS. install.sh must
# detect the package manager and install everything missing.
AIRC_DIR=$HOME/.airc-src bash install.sh

Copilot AI Apr 28, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI now runs install.sh without setting AIRC_SKIP_SSHD=1, but install.sh’s ensure_prereqs explicitly enables/installs sshd unless AIRC_SKIP_SSHD is set (and the script comments call out headless CI as a reason to set it). On macOS runners this can attempt the non-interactive osascript admin path and may hang/fail; on Linux it will modify system services unnecessarily. Set AIRC_SKIP_SSHD=1 here (and in the other install.sh CI steps) to keep “real prereq install” coverage without requiring sshd enablement in CI.

Suggested change
AIRC_DIR=$HOME/.airc-src bash install.sh
# But skip sshd enable/install in headless CI.
AIRC_SKIP_SSHD=1 AIRC_DIR=$HOME/.airc-src bash install.sh

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/ci.yml
Comment on lines +112 to +116
- name: airc doctor (must report environment-clean)
run: |
export PATH="$HOME/.local/bin:$PATH"
which airc
airc doctor || echo "airc doctor reported issues (non-fatal in CI)"
airc doctor

Copilot AI Apr 28, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as the Linux job: the default bash airc doctor currently prints missing prereqs but exits 0, so this step won’t actually fail even when the environment is not clean. If the intent is to hard-gate, doctor needs to return a non-zero status (or the workflow needs a deterministic check).

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/ci.yml
Comment on lines 108 to +110
mkdir -p $HOME/.airc-src
cp -r . $HOME/.airc-src/
AIRC_SKIP_PREREQS=1 AIRC_DIR=$HOME/.airc-src bash install.sh
AIRC_DIR=$HOME/.airc-src bash install.sh

Copilot AI Apr 28, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same staging issue as Linux: copying the repo into $HOME/.airc-src includes .git/, and install.sh will interpret it as an existing install and switch from detached HEAD to main/canary + pull. That causes this job to test the branch tip rather than the PR’s contents. Stage without .git (or remove it) so install.sh uses the staged tree as-is.

Copilot uses AI. Check for mistakes.
…tional)

#94: install.ps1 uses 'tailscale.tailscale' (lowercase). winget --exact
is case-sensitive, returns "No package found", install loop swallows
the error as non-fatal, and the post-install probe reports "install
completed but probe still fails." Result: every Windows install lacks
Tailscale, even though the install log claims otherwise. Also fixed
the same lowercase id in airc.ps1's user-facing fix-hint messages
(line 328, 1293, 1414, 1420).

Doctor: airc.ps1's Invoke-Doctor leaks $LASTEXITCODE from external
probes (`& gh auth status` etc), so the script's natural-end exit
picks up whatever the last external returned — typically 1 on a
fresh / CI install where gh isn't authed. Bash doctor (cmd_doctor.sh)
just sets a counter and prints a summary, no exit, which is the
documented contract for the default `airc doctor` (informational,
like `git status`). The hard-fail gate is `airc doctor --connect`
(#80), which is the documented preflight before connecting. Match
the contract: explicitly set $LASTEXITCODE = 0 at the end of the
default doctor.

Bonus: .gitignore now excludes __pycache__/ + *.pyc — they leaked
through earlier when running airc_core CLIs locally during testing.
…TCODE=1

Same pattern as the airc.ps1 doctor leak: external probes (notably
`tailscale status` when the user hasn't logged in yet — a normal
post-install state) leave $LASTEXITCODE non-zero, and PowerShell's
script natural-end exit picks it up. Every clean install on a fresh
runner / VM exited 1 even though the install fully succeeded.

Explicit `exit 0` after the final guidance banner.
Copilot AI review requested due to automatic review settings April 28, 2026 02:40

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 4 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/ci.yml
export PATH="$HOME/.local/bin:$PATH"
which airc
airc doctor || echo "airc doctor reported issues (non-fatal in CI)"
airc doctor

Copilot AI Apr 28, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same gating issue as linux: airc doctor (bash) currently exits 0 even when it reports missing prereqs, so this step won’t fail CI on a dirty environment. If you want hard-fail semantics, use a doctor variant that returns non-zero (add a --strict flag and call it here, or change the default doctor’s exit status when issues>0).

Suggested change
airc doctor
airc doctor --strict

Copilot uses AI. Check for mistakes.
Comment thread airc.ps1
Comment on lines +1320 to +1328
# Always exit 0 from the default `airc doctor` — informational, like
# `git status`. Probes use `& gh auth status` etc which leak
# $LASTEXITCODE; without an explicit reset the script's natural-end
# exit picks up whatever the last external returned (typically
# gh-not-authed → 1 in CI / fresh installs). Match the bash doctor's
# behavior (cmd_doctor.sh — issues counter, no exit). For hard-fail
# semantics the user should run `airc doctor --connect`, which is
# the documented preflight gate that does exit non-zero on issues.
$global:LASTEXITCODE = 0

Copilot AI Apr 28, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Invoke-Doctor now forces $global:LASTEXITCODE = 0, which makes airc doctor always appear successful to callers/CI even when $script:DoctorIssues is non-empty. This conflicts with the workflow changes that intend to hard-fail on doctor errors. If the default doctor should remain informational, consider adding a --strict/--ci flag that exits non-zero when issues are present; if it should hard-fail, return/exit non-zero when $script:DoctorIssues.Count > 0 instead of always resetting the exit code.

Suggested change
# Always exit 0 from the default `airc doctor` — informational, like
# `git status`. Probes use `& gh auth status` etc which leak
# $LASTEXITCODE; without an explicit reset the script's natural-end
# exit picks up whatever the last external returned (typically
# gh-not-authed → 1 in CI / fresh installs). Match the bash doctor's
# behavior (cmd_doctor.sh — issues counter, no exit). For hard-fail
# semantics the user should run `airc doctor --connect`, which is
# the documented preflight gate that does exit non-zero on issues.
$global:LASTEXITCODE = 0
# Normalize leaked external-command exit codes from probes such as
# `gh auth status`, but preserve doctor failure for callers/CI.
if ($script:DoctorIssues.Count -eq 0) {
$global:LASTEXITCODE = 0
} else {
$global:LASTEXITCODE = 1
}

Copilot uses AI. Check for mistakes.
Comment thread install.ps1
Comment on lines +452 to +461
# Explicit successful exit. Earlier external probes (winget, tailscale
# status, etc.) leak their $LASTEXITCODE through to the script's
# natural-end exit — most notably `tailscale status` returns non-zero
# when the user hasn't logged in yet (a perfectly normal post-install
# state we already report via Write-Warn2 above). Without this, every
# fresh install on a runner / VM with not-yet-signed-in tailscale exits
# 1 from install.ps1 even though the install fully succeeded. CI sees
# the install as failed, despite the binary being correctly placed.
$global:LASTEXITCODE = 0
exit 0

Copilot AI Apr 28, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The script now unconditionally exit 0 at the end to avoid leaking $LASTEXITCODE from probes like tailscale status. However, Install-IfMissing only prints Write-Fail when a prereq still isn’t usable and does not terminate, so this unconditional success exit can mask real install failures (including in CI). Prefer explicitly tracking whether any required prereq failed its post-install probe and exiting non-zero in that case, and avoid $LASTEXITCODE leakage by capturing/resetting around the specific probe instead of forcing a global success exit.

Copilot uses AI. Check for mistakes.
…99)

Two tightly-coupled fixes that together make Windows airc HOSTS actually
work end-to-end. Without these, every Windows-hosted room failed the
moment a peer tried to send a message.

#98 — install.ps1: Set-OpenSSHDefaultShellBash
  Windows OpenSSH defaults DefaultShell to cmd.exe. cmd.exe lacks
  `cat`, POSIX redirects, and the rest of the shell vocabulary that
  airc remote commands rely on (`cat >> $rhome/messages.jsonl && echo
  __APPENDED__`, etc.). Without this fix, every airc msg from a peer
  to a Windows host silently fails — the cmd.exe error goes to ssh
  stderr (which `airc send` looks at, but only for specific patterns),
  the message gets [QUEUED] forever, the user sees nothing.

  Locate Git for Windows bash.exe, write to HKLM:\SOFTWARE\OpenSSH\
  DefaultShell. Idempotent — only writes when the registry value
  differs. Falls through with a loud warning if bash.exe can't be
  found (Git for Windows is already a hard prereq, so this should
  never fire in the install.ps1 flow).

#99 — airc.ps1: Get-RemoteHome forward-slash conversion
  The host_airc_home config value is captured as a Windows path with
  backslashes ('C:\Users\Administrator\Documents\Cambrian\.airc').
  When interpolated into an SSH remote command and the remote shell
  is bash (which #98 ensures), bash interprets the backslashes as
  escape characters and strips them — producing garbage like
  'C:UsersAdministratorDocumentsCambrian.airc'. The redirect target
  becomes a non-existent relative path and `cat >>` silently fails.

  Forward-slash form ('C:/Users/.../.airc') is interpreted correctly
  by bash as an absolute path; Windows kernel32 accepts forward
  slashes everywhere it accepts backslashes, so the on-disk write
  on the host succeeds.

Closes #98, #99. Together with #94 (Tailscale typo, already in this
PR) the install.ps1 → airc.ps1 path is now end-to-end functional on
a clean Windows install.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@joelteply joelteply changed the title ci: real install path — drop AIRC_SKIP_PREREQS, hard-fail on doctor errors fix(windows-install-e2e): real CI prereq path + Tailscale typo + DefaultShell + Get-RemoteHome (#94, #98, #99) Apr 28, 2026
…M as cp1252

PS 5.1's parser barfed on em-dashes (U+2014 = 0xE2 0x80 0x94 in UTF-8
which Windows-1252 misreads) inside double-quoted strings in the new
Set-OpenSSHDefaultShellBash function. Pre-existing em-dashes in comments
have been there a while and passed because comment parsing is more
tolerant; new ones in expandable strings broke the parse.

Replaced all em-dashes in install.ps1 with ASCII '--'. install.ps1 is
the bootstrap script — must work from default Windows PowerShell 5.1
where the user lands by default, and that means staying ASCII-clean.

(airc.ps1 is fine — it's #Requires -Version 7.0 so PS 5.1 won't parse
it; pwsh handles UTF-8 without BOM correctly.)
Copilot AI review requested due to automatic review settings April 28, 2026 02:50

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 4 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread install.ps1
Comment on lines +237 to +250
# Idempotent -- read current, only write if different.
try {
$cur = (Get-ItemProperty -Path $regPath -Name DefaultShell -ErrorAction SilentlyContinue).DefaultShell
} catch { $cur = $null }
if ($cur -eq $bashPath) {
Write-Ok "OpenSSH DefaultShell already set to $bashPath"
return
}
try {
if (-not (Test-Path $regPath)) {
New-Item -Path $regPath -Force | Out-Null
}
New-ItemProperty -Path $regPath -Name DefaultShell -Value $bashPath -PropertyType String -Force | Out-Null
Write-Ok "OpenSSH DefaultShell set to $bashPath (was: $cur)"

Copilot AI Apr 28, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Set-OpenSSHDefaultShellBash unconditionally overwrites an existing HKLM:\SOFTWARE\OpenSSH\DefaultShell value when it differs from $bashPath. This can clobber an intentionally configured shell (pwsh/cmd/custom) and change system-wide SSH behavior beyond airc. Safer behavior is to only set it when it’s unset/empty, and otherwise emit a warning with the manual command to switch if the user wants airc hosting to work.

Copilot uses AI. Check for mistakes.
Comment thread install.ps1
Comment on lines +512 to +521
# Explicit successful exit. Earlier external probes (winget, tailscale
# status, etc.) leak their $LASTEXITCODE through to the script's
# natural-end exit -- most notably `tailscale status` returns non-zero
# when the user hasn't logged in yet (a perfectly normal post-install
# state we already report via Write-Warn2 above). Without this, every
# fresh install on a runner / VM with not-yet-signed-in tailscale exits
# 1 from install.ps1 even though the install fully succeeded. CI sees
# the install as failed, despite the binary being correctly placed.
$global:LASTEXITCODE = 0
exit 0

Copilot AI Apr 28, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exit 0 at the end of install.ps1 will terminate the entire PowerShell session when run via the documented iwr ... | iex (and can close the user’s terminal tab/window right after printing the final guidance). To avoid disrupting interactive installs while still preventing $LASTEXITCODE leakage, prefer setting $global:LASTEXITCODE = 0 and ending the script with return (or only exit when running under CI/non-interactive).

Suggested change
# Explicit successful exit. Earlier external probes (winget, tailscale
# status, etc.) leak their $LASTEXITCODE through to the script's
# natural-end exit -- most notably `tailscale status` returns non-zero
# when the user hasn't logged in yet (a perfectly normal post-install
# state we already report via Write-Warn2 above). Without this, every
# fresh install on a runner / VM with not-yet-signed-in tailscale exits
# 1 from install.ps1 even though the install fully succeeded. CI sees
# the install as failed, despite the binary being correctly placed.
$global:LASTEXITCODE = 0
exit 0
# Explicit successful completion. Earlier external probes (winget,
# tailscale status, etc.) leak their $LASTEXITCODE through to the
# script's natural-end exit -- most notably `tailscale status` returns
# non-zero when the user hasn't logged in yet (a perfectly normal
# post-install state we already report via Write-Warn2 above). Without
# resetting this, every fresh install on a runner / VM with
# not-yet-signed-in tailscale exits 1 from install.ps1 even though the
# install fully succeeded. Set LASTEXITCODE back to success, then return
# so `iwr ... | iex` does not terminate the caller's entire shell.
$global:LASTEXITCODE = 0
return

Copilot uses AI. Check for mistakes.
Comment thread install.ps1
Comment on lines +227 to +230
if (-not $bashPath) {
$cmd = Get-Command bash.exe -ErrorAction SilentlyContinue
if ($cmd) { $bashPath = $cmd.Source }
}

Copilot AI Apr 28, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Set-OpenSSHDefaultShellBash, the fallback Get-Command bash.exe can resolve the Windows/WSL C:\Windows\System32\bash.exe (or another non–Git-for-Windows bash). Setting OpenSSH DefaultShell to that would likely break airc’s expected path semantics (e.g., C:/... vs /mnt/c/...). Consider validating that the resolved bash path is from the Git for Windows install (e.g., contains \Git\ / \Programs\Git\) and otherwise warn + skip changing DefaultShell.

Copilot uses AI. Check for mistakes.
macOS install.sh _ensure_sshd_running falls through to osascript
'do shell script with administrator privileges' when no TTY is
attached (CI runners). osascript opens a GUI admin prompt waiting
for password / Touch ID — there's nobody home in CI, so it hangs
forever and the runner job silently consumes its full 6-hour timeout.

Auto-detect CI=true (GitHub Actions, GitLab, Travis, CircleCI, Jenkins,
etc. all set it) and skip the sshd setup block when present. Same
effect as AIRC_SKIP_SSHD=1 but no manual env-var wiring per workflow.

The hang manifested in PR #187's macOS job — install.sh was visibly
stuck in 'Stage install.sh + run' for 5+ minutes with no progress
while the linux + windows jobs completed in under a minute.
brew install --cask tailscale on macos-latest runners is multi-minute
(download + GUI app install). Tailscale is documented as optional
(LAN mesh works without it) and there's no tailnet behind the CI
runner. Same CI=true gate as the sshd skip.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/ci.yml
Comment on lines 46 to 52
run: |
mkdir -p $HOME/.airc-src
cp -r . $HOME/.airc-src/
# AIRC_SKIP_PREREQS=1 so apt-get isn't required (CI runner
# already has python3/git/openssh-client/gh/jq).
AIRC_SKIP_PREREQS=1 AIRC_DIR=$HOME/.airc-src bash install.sh
# Real install — no AIRC_SKIP_PREREQS. install.sh must
# detect the package manager and install everything missing.
AIRC_DIR=$HOME/.airc-src bash install.sh

Copilot AI Apr 28, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In PR CI runs, actions/checkout typically leaves the repo in a detached HEAD state. Because the staged $HOME/.airc-src includes the copied .git directory, install.sh treats it as an existing install and its “non-channel branch recovery” logic will switch the checkout to main/canary and then git pull --ff-only, so subsequent airc doctor / smoke steps can end up testing the canonical branch rather than the PR’s contents. To ensure CI validates the PR, stage a working tree without .git and update install.sh to support a CI/local-source mode (e.g., allow overriding REPO_URL or add an env flag to skip branch switching/pull when AIRC_DIR is already populated).

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/ci.yml
Comment on lines +106 to 111
- name: Stage install.sh + run (no skip-prereqs — real install path)
run: |
mkdir -p $HOME/.airc-src
cp -r . $HOME/.airc-src/
AIRC_SKIP_PREREQS=1 AIRC_DIR=$HOME/.airc-src bash install.sh
AIRC_DIR=$HOME/.airc-src bash install.sh

Copilot AI Apr 28, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same issue as the linux job: because the staged $HOME/.airc-src copy includes .git, install.sh may switch the checkout to main/canary and git pull --ff-only, which defeats the goal of testing this PR’s code on clean-install-macos. Consider staging without .git and adding an explicit installer mode/env var that skips branch switching/pull when running from a pre-populated source dir in CI.

Copilot uses AI. Check for mistakes.
Comment thread install.sh
Comment on lines +396 to +399
# silently runs for the full 6-hour timeout. Skip when CI=true so
# the install completes cleanly and CI tests the rest of the path.
if [ "${CI:-}" = "true" ] || [ "${CI:-}" = "1" ]; then
info "CI=true — skipping sshd setup (no host-capability test in CI)"

Copilot AI Apr 28, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new CI auto-detect (CI=true) skips sshd setup on all platforms. On Linux runners, _ensure_sshd_running can run non-interactively via sudo/systemctl, so skipping here reduces coverage of a critical “host can receive messages” prereq. Consider limiting the CI skip to Darwin (where the osascript admin prompt hangs), or gating on non-interactive + Darwin specifically, while still enabling sshd in Linux CI.

Suggested change
# silently runs for the full 6-hour timeout. Skip when CI=true so
# the install completes cleanly and CI tests the rest of the path.
if [ "${CI:-}" = "true" ] || [ "${CI:-}" = "1" ]; then
info "CI=true — skipping sshd setup (no host-capability test in CI)"
# silently runs for the full 6-hour timeout. So only skip sshd
# auto-setup in CI on Darwin; on Linux, still attempt setup so CI
# exercises the "host can receive messages" prerequisite.
if { [ "${CI:-}" = "true" ] || [ "${CI:-}" = "1" ]; } && [ "$(uname -s 2>/dev/null)" = "Darwin" ]; then
info "CI=true on Darwin — skipping sshd setup (macOS CI admin prompt would hang)"

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants