Skip to content

feat: network-resilient install — source chain, retry/timeout, visible failures - #30

Closed
zheng-weihao wants to merge 1 commit into
mainfrom
install-net-retry
Closed

zheng-weihao wants to merge 1 commit into
mainfrom
install-net-retry

Conversation

@zheng-weihao

@zheng-weihao zheng-weihao commented Aug 8, 2026 •

Copy link
Copy Markdown
Member

Motivation

On a poor-quality network, plugin install failed silently: the marketplace error was swallowed, and the user saw only plugin install failed with no way to tell why.

Changes

install.sh

  • Source resolution now lands on a chain: ORBIT_SOURCES > ORBIT_SOURCE > local checkout > default shorthand. Each retry rotates to the next entry; a one-entry chain never rotates, so a plain install stays single-source and stable.
  • Every network operation goes through net_run: ORBIT_RETRY attempts (default 3), ORBIT_RETRY_DELAY_SECONDS apart (default 5), each attempt killed at ORBIT_TIMEOUT_SECONDS (default 60) via a portable TERM→grace→KILL timer (macOS has no GNU timeout). The final attempt prints the command's real error — nothing is silently swallowed.
  • A marketplace add/update that fails through every retry now prints the CLI's real error plus a warning naming it as the root cause, then lets the plugin install decide (verified: all three agent CLIs exit 1 with a clear message when the marketplace is missing) — no parsing of unstable marketplace list output.
  • GIT_TERMINAL_PROMPT=0 so a 404/private repo can't freeze the run on an interactive credential prompt (inherited by the agent CLIs' own clones).
  • Latent bug fixed: --opencode with a URL source always failed — the --sparse clone never materialized .opencode-plugin/ or skills/.
  • Mixed-chain fix: a path entry inside ORBIT_SOURCES now fetches via cp (previously the case fell through and net_run reported success with an empty orbit.sh).

try.sh

  • Moved to the repo root (shorter canonical URL main/try.sh; future examples can still live in examples/).
  • Piped, zero-config runs supply a shorthand → HTTPS → SSH chain so demo installs ride out intermittent blocks; user-set ORBIT_SOURCE/ORBIT_SOURCES pass through untouched. install.sh is fetched once (with retries), and retry knobs are validated up front.
  • Plugin install output flows live; failure falls back to manual launch instructions.
  • The OpenCode launch hint is now opencode --prompt start (stays in the TUI; run is headless).

Install command format — all user-facing commands switch to the Homebrew-style idiom /bin/bash -c "$(curl -fsSL …)": the script downloads fully before executing (no half-script execution on a cut connection), and _ holds $0 when flags follow.

Docs — README slims to bullets + links (demo blocks split per agent for one-click copy); USAGE.md gains a "Network-resilient installs" section (scope, knob table, chain priority, marketplace failure semantics, escape hatch).

Verification

  • make lint clean; bats 29/29 (chain rotation order and wrap-around, pinned source, ORBIT_SOURCES priority, mixed-chain path entries, TERM/KILL timeout, knob validation, marketplace warn-then-install, try.sh passthrough and failure visibility).
  • Live-tested on a network where github.com:443 was intermittently blocked: with the 3-entry chain, claude/codex/qoder/opencode installed 4/4 (raw timed out → HTTPS timed out → SSH succeeded). With SSH disabled, 4/4 failed — but with the full error chain visible (no silence, no hang).
  • bash 3.2 (stock macOS) compatible: two set -u traps (empty-array expansion, out-of-range index) fixed.

…visible failures

Motivated by a real failure: a demo install on a poor-quality network died
with one silent "plugin install failed" line. Root causes: try.sh swallowed
all output (>/dev/null 2>&1), install.sh swallowed marketplace errors, and a
blocked TCP connect hangs ~75s before erroring.

install.sh:
- Source resolution now lands on a chain: ORBIT_SOURCES > ORBIT_SOURCE >
  local checkout > default shorthand. Each retry rotates to the next entry;
  a one-entry chain never rotates, so plain install stays single-source.
- Every network op goes through net_run: ORBIT_RETRY attempts (default 3),
  ORBIT_RETRY_DELAY_SECONDS apart (default 5), each attempt killed at
  ORBIT_TIMEOUT_SECONDS (default 60) by a portable per-attempt timeout
  (macOS has no GNU timeout). The final attempt prints the real error.
- Marketplace add/update failure now warns with the causal message and lets
  plugin install decide (verified: all three CLIs exit 1 with a clear error
  when the marketplace is missing) — no parsing of unstable list output.
- GIT_TERMINAL_PROMPT=0 so a 404/private repo can't freeze the run on an
  interactive credential prompt (inherited by the agent CLIs' own clones).
- Fix latent bug: --opencode with a URL source always failed — the sparse
  clone never materialized .opencode-plugin/ or skills/.
- Fix mixed-chain rotation: path entries now fetch via cp (previously the
  case fell through and net_run reported success with an empty orbit.sh).

try.sh:
- Moved to repo root (shorter canonical URL; future examples still get
  examples/). Piped runs supply the shorthand → HTTPS → SSH chain so demo
  installs ride out intermittent blocks; user-set ORBIT_SOURCE/ORBIT_SOURCES
  pass through untouched. install.sh is fetched once (with retries).
- Plugin install output is live, never swallowed; failure falls back to
  manual launch instructions. Retry knobs validated up front.
- Launch hint for opencode is `opencode --prompt start` (TUI, not headless
  `run`).

User-facing install commands switch to the Homebrew-style idiom:
/bin/bash -c "$(curl -fsSL …)" — downloads fully before executing (no
half-script execution on a cut connection); `_` holds $0 when flags follow.

README slims to one-liners + links into a new USAGE.md "Network-resilient
installs" section; Try-it blocks split per agent for one-click copy.

Tests: 29 cases across install/try (chain rotation order, wrap-around,
pinned source, priority, mixed-chain path entries, TERM/KILL timeout,
knob validation, marketplace warn/install decider, try.sh passthrough).
make lint clean.
@zheng-weihao
zheng-weihao deleted the install-net-retry branch August 8, 2026 15:05
@zheng-weihao
zheng-weihao restored the install-net-retry branch August 8, 2026 15:06
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.

1 participant