Skip to content

fix(automation): bound toolchain install downloads - #965

Merged
skevetter merged 2 commits into
mainfrom
ui-polish/toolchain-install-timeout
Aug 9, 2026
Merged

skevetter merged 2 commits into
mainfrom
ui-polish/toolchain-install-timeout

Conversation

@devsy-app

@devsy-app devsy-app Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Problem

The "Daily Desktop UI Polish" automation run cd94e2d7 failed with Timed out: No bash output found (run started 13:00:44, hit the 1200s automation timeout at 13:20:44, conversation_id=null — no agent conversation ever started). Two earlier runs of the same automation completed successfully, so the failure was intermittent.

Root cause is in the shared STEP 0 toolchain-install block generated by hack/automations/main.go (goInstallBlock / nodeInstallBlock / ghActBlock), which every daily agent fleet automation runs as its first bash command:

  • Every network download used curl -sSL / curl -fsSL with no --max-time or --connect-timeout (66MB Go tarball, golangci-lint release, nodesource setup_24.x, gh keyring, act installer).
  • go install github.com/go-task/task/v3/cmd/task@latest had no timeout and can stall on proxy.golang.org.
  • The nodesource install was curl ... | sudo bash - >/dev/null 2>&1 ... — output piped to bash and swallowed to /dev/null.
  • Only the final go version && ... && node --version line printed to stdout.

So a transient network stall on any download left the whole set -e block producing zero stdout until the 1200s run timeout fired — exactly the observed "No bash output found" with no conversation started. A stalled TCP socket (default retransmit timeout ~15 min) alone is enough to blow the budget, and the total output suppression made it impossible to diagnose.

Change

In hack/automations/main.go, bound every network operation and emit progress so a stall can never hang silently:

  • Added a shared curlFlags = "--retry 3 --retry-delay 5 --connect-timeout 30 --max-time 300 -sSL" constant and applied it to all five curl downloads (Go, golangci-lint, nodesource, gh keyring, act). A stalled socket now fails fast in ≤30s connect / ≤300s total and retries 3×.
  • Wrapped go install task in timeout 600 so a stuck module fetch cannot hang indefinitely.
  • Added echo "installing <tool>" progress lines before each install step, so the agent server observes bash output throughout (a stalled run now shows which step hung instead of a bare timeout).
  • Replaced the curl | sudo bash nodesource pipe with a bounded curl -o /tmp/ns_setup.sh followed by sudo bash /tmp/ns_setup.sh, so the download is time-bounded independently of the shell.

Regenerated all 13 .agents/agents/*/agent.md files via go run ./hack/automations (agent prompts must be regenerated, never hand-edited). This benefits the whole agent fleet (ui-polish, agent-analytics, codefactor, lint-fixer, pkg-*, ci-optimizer, etc.), not just the one automation that failed.

Added TestToolchainDownloadsAreBounded regression test asserting every STEP 0 curl sets --max-time, no unbounded curl -sSL/curl -fsSL downloads remain, and progress is echoed.

Why it's safe / reviewable in <15 min

  • No behavioral or logic change to any production code path — only the daily-automation install preamble and its generator.
  • No new dependencies; timeout is coreutils (already present in the sandboxes), curl flags are additive.
  • set -e semantics, version pins (go1.26.3, golangci-lint-2.12.2), install guards (if ! command -v), and the final verify line are all preserved.
  • Diff is small and mechanical: one new constant, flag substitution on 5 curls, timeout on one go install, 5 echo lines, plus regenerated agent markdown and one test.

Verification

  • go run ./hack/automations → regenerated all 13 agent.md files; go run ./hack/automations -check → exit 0 (in-sync).
  • task cli:format → exit 0.
  • task cli:lint:ci (CI-parity, --new-from-patch vs merge-base) → 0 issues.
  • go test ./hack/automations/... → ok, including new TestToolchainDownloadsAreBounded (PASS).
  • Confirmed no open PR addresses this (checked gh api repos/devsy-org/devsy/pulls).

This PR was created by an AI agent as part of an automated daily UI polish job.

@netlify

netlify Bot commented Aug 9, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for devsydev canceled.

Name Link
🔨 Latest commit 4b9ccbf
🔍 Latest deploy log https://app.netlify.com/projects/devsydev/deploys/6a78c6906978100008c8ebdb

@netlify

netlify Bot commented Aug 9, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for images-devsy-sh canceled.

Name Link
🔨 Latest commit 4b9ccbf
🔍 Latest deploy log https://app.netlify.com/projects/images-devsy-sh/deploys/6a78c6900cf3f30008f02cb5

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 8 complexity · 0 duplication

Metric Results
Complexity 8
Duplication 0

View in Codacy

AI Reviewer: run a review on demand. To trigger the first review automatically, go to your organization or repository integration settings. AI can make mistakes. Always validate suggestions.

Run reviewer

TIP This summary will be updated as you push new changes.

@github-actions github-actions Bot added the size/l label Aug 9, 2026
## Problem

The "Daily Desktop UI Polish" automation run `cd94e2d7` failed with `Timed out: No bash output found` (run started 13:00:44, hit the 1200s automation timeout at 13:20:44, `conversation_id=null` — no agent conversation ever started). Two earlier runs of the same automation completed successfully, so the failure was intermittent.

Root cause is in the shared STEP 0 toolchain-install block generated by `hack/automations/main.go` (`goInstallBlock` / `nodeInstallBlock` / `ghActBlock`), which every daily agent fleet automation runs as its first bash command:

- Every network download used `curl -sSL` / `curl -fsSL` with **no `--max-time` or `--connect-timeout`** (66MB Go tarball, golangci-lint release, nodesource `setup_24.x`, gh keyring, act installer).
- `go install github.com/go-task/task/v3/cmd/task@latest` had **no timeout** and can stall on `proxy.golang.org`.
- The nodesource install was `curl ... | sudo bash - >/dev/null 2>&1 ...` — output piped to bash and **swallowed to `/dev/null`**.
- Only the final `go version && ... && node --version` line printed to stdout.

So a transient network stall on any download left the whole `set -e` block producing zero stdout until the 1200s run timeout fired — exactly the observed "No bash output found" with no conversation started. A stalled TCP socket (default retransmit timeout ~15 min) alone is enough to blow the budget, and the total output suppression made it impossible to diagnose.

## Change

In `hack/automations/main.go`, bound every network operation and emit progress so a stall can never hang silently:

- Added a shared `curlFlags = "--retry 3 --retry-delay 5 --connect-timeout 30 --max-time 300 -sSL"` constant and applied it to all five curl downloads (Go, golangci-lint, nodesource, gh keyring, act). A stalled socket now fails fast in ≤30s connect / ≤300s total and retries 3×.
- Wrapped `go install task` in `timeout 600` so a stuck module fetch cannot hang indefinitely.
- Added `echo "installing <tool>"` progress lines before each install step, so the agent server observes bash output throughout (a stalled run now shows which step hung instead of a bare timeout).
- Replaced the `curl | sudo bash` nodesource pipe with a bounded `curl -o /tmp/ns_setup.sh` followed by `sudo bash /tmp/ns_setup.sh`, so the download is time-bounded independently of the shell.

Regenerated all 13 `.agents/agents/*/agent.md` files via `go run ./hack/automations` (agent prompts must be regenerated, never hand-edited). This benefits the whole agent fleet (ui-polish, agent-analytics, codefactor, lint-fixer, pkg-*, ci-optimizer, etc.), not just the one automation that failed.

Added `TestToolchainDownloadsAreBounded` regression test asserting every STEP 0 curl sets `--max-time`, no unbounded `curl -sSL`/`curl -fsSL` downloads remain, and progress is echoed.

## Why it's safe / reviewable in <15 min

- No behavioral or logic change to any production code path — only the daily-automation install preamble and its generator.
- No new dependencies; `timeout` is coreutils (already present in the sandboxes), `curl` flags are additive.
- `set -e` semantics, version pins (`go1.26.3`, `golangci-lint-2.12.2`), install guards (`if ! command -v`), and the final verify line are all preserved.
- Diff is small and mechanical: one new constant, flag substitution on 5 curls, `timeout` on one `go install`, 5 `echo` lines, plus regenerated agent markdown and one test.

## Verification

- `go run ./hack/automations` → regenerated all 13 agent.md files; `go run ./hack/automations -check` → exit 0 (in-sync).
- `task cli:format` → exit 0.
- `task cli:lint:ci` (CI-parity, `--new-from-patch` vs merge-base) → **0 issues**.
- `go test ./hack/automations/...` → `ok`, including new `TestToolchainDownloadsAreBounded` (PASS).
- Confirmed no open PR addresses this (checked `gh api repos/devsy-org/devsy/pulls`).

This PR was created by an AI agent as part of an automated daily UI polish job.
Signed-off-by: GitHub <noreply@github.com>
@skevetter
skevetter force-pushed the ui-polish/toolchain-install-timeout branch from c33e0ff to 4b9ccbf Compare August 9, 2026 18:27
@skevetter
skevetter enabled auto-merge (squash) August 9, 2026 18:43
@skevetter
skevetter merged commit 1086e58 into main Aug 9, 2026
70 checks passed
@skevetter
skevetter deleted the ui-polish/toolchain-install-timeout branch August 9, 2026 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant