Skip to content

The agent that grows with you

fix(update): failure tail keeps a progress line's final state; fix proxy env comment

Teknium6c4e73376ae0
diff --git a/apps/desktop/electron/updater/checkout-source.ts b/apps/desktop/electron/updater/checkout-source.ts
index ac256f36bbf..e030e3875fa 100644
--- a/apps/desktop/electron/updater/checkout-source.ts
+++ b/apps/desktop/electron/updater/checkout-source.ts
@@ -56,8 +56,9 @@ function probeFlags(probe: SourceUpdateProbe): string[] {
/**
* Every update child's env: this process's env plus the system proxy when none
- * is set (#123387). The proxy env comes last so its extended NO_PROXY is the
- * one the children read; it is empty whenever the user set a proxy.
+ * is set (#123387). The proxy env overrides process.env, so its extended
+ * NO_PROXY is the one the children read (buildDesktopBackendEnv, spread after
+ * it, sets only PYTHON* and PATH); it is empty whenever the user set a proxy.
*/
export async function sourceUpdateEnvironment(
updateRoot: string,
diff --git a/scripts/desktop-update/posix.sh b/scripts/desktop-update/posix.sh
index 92daa67d1a3..8923c7d9160 100755
--- a/scripts/desktop-update/posix.sh
+++ b/scripts/desktop-update/posix.sh
@@ -135,9 +135,10 @@ update_output_tail() { # $OUT -> the updater's last non-empty output lines, one
# user can reach when the update failed; the exit code alone never names
# the failing layer (#137327). $OUT is the run's slice of the hand-off log,
# which interleaves our own log() lines (a leading ISO timestamp) with the
- # updater's output — keep only the updater's, strip progress escapes (ANSI,
- # CR), and bound it: three lines of at most 120 characters each.
- printf '%s' "$OUT" | tr -d '\r' | sed "s/$(printf '\033')\[[0-9;?]*[A-Za-z]//g" \
+ # updater's output — keep only the updater's, strip progress escapes (ANSI;
+ # of a CR-overwritten progress line only the final state the terminal
+ # showed), and bound it: three lines of at most 120 characters each.
+ printf '%s' "$OUT" | awk '{ sub(/\r+$/, ""); n = split($0, seg, "\r"); print seg[n] }' | sed "s/$(printf '\033')\[[0-9;?]*[A-Za-z]//g" \
| grep -v -e '^[[:space:]]*$' -e '^[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}T' | tail -n 3 \
| while IFS= read -r _tail_line; do printf '%s\n' "${_tail_line:0:120}"; done
}