Repository navigation
feat: network-resilient install — source chain, retry/timeout, visible failures - #30
Closed
zheng-weihao wants to merge 1 commit into
Closed
zheng-weihao wants to merge 1 commit into
zheng-weihao wants to merge 1 commit into
Conversation
…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
force-pushed
the
install-net-retry
branch
from
August 8, 2026 15:01
ba47fc1 to
f7bd413
Compare
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.
Motivation
On a poor-quality network, plugin install failed silently: the marketplace error was swallowed, and the user saw only
plugin install failedwith no way to tell why.Changes
install.sh
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.net_run:ORBIT_RETRYattempts (default 3),ORBIT_RETRY_DELAY_SECONDSapart (default 5), each attempt killed atORBIT_TIMEOUT_SECONDS(default 60) via a portable TERM→grace→KILL timer (macOS has no GNUtimeout). The final attempt prints the command's real error — nothing is silently swallowed.marketplace listoutput.GIT_TERMINAL_PROMPT=0so a 404/private repo can't freeze the run on an interactive credential prompt (inherited by the agent CLIs' own clones).--opencodewith a URL source always failed — the--sparseclone never materialized.opencode-plugin/orskills/.pathentry insideORBIT_SOURCESnow fetches viacp(previously the case fell through andnet_runreported success with an empty orbit.sh).try.sh
main/try.sh; future examples can still live inexamples/).ORBIT_SOURCE/ORBIT_SOURCESpass through untouched. install.sh is fetched once (with retries), and retry knobs are validated up front.opencode --prompt start(stays in the TUI;runis 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$0when 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 lintclean; bats 29/29 (chain rotation order and wrap-around, pinned source,ORBIT_SOURCESpriority, mixed-chain path entries, TERM/KILL timeout, knob validation, marketplace warn-then-install, try.sh passthrough and failure visibility).set -utraps (empty-array expansion, out-of-range index) fixed.