Skip to content

fix: recover Forge updater transport failures - #221

Merged
petebacondarwin merged 1 commit into
mainfrom
codex/forge-updater-network-recovery
Oct 7, 2026
Merged

petebacondarwin merged 1 commit into
mainfrom
codex/forge-updater-network-recovery

Conversation

@petebacondarwin

Copy link
Copy Markdown
Collaborator

The Forge updater can push a generated update successfully and then fail to create its PR with only fetch failed in the log, as seen in this updater run.

Run subprocesses asynchronously through tinyexec so HTTP socket events and idle timers can run during long builds. Explicitly preserve omitted environment variables because tinyexec otherwise merges parent credentials back into sanitized Forge environments. Install the updater's dependencies before starting it, and report GitHub request methods, paths, and nested error causes/codes without dumping credential-bearing objects.

Transient transport failures get up to three attempts with 1s/2s backoff and a 30s timeout per request. Reads and PR field updates can be repeated directly. After a failed PR creation request or response body read, look up the open PR for the managed branch before sending another POST; update the existing PR if creation succeeded despite the lost response. Reconcile the final failed attempt as well. Authentication, validation, certificate, and caller cancellation failures stop immediately.

Validation:

  • node --test scripts/update-forge.test.ts — 18 tests pass, covering retries, lost creation responses, response body failures, credential-safe diagnostics, and asynchronous subprocess arguments/cwd/env/failures, including a child-process check that stripped credentials stay absent.
  • Strict standalone tsgo check for the updater and its tests passes.
  • pnpm check passes.
  • node scripts/update-forge.ts --check succeeds against GitHub without changing the update branch or PR.
  • Move automation script tests into the existing Linux/macOS/Windows CI matrix.

@petebacondarwin
petebacondarwin requested a review from a team as a code owner October 6, 2026 21:11
@pkg-pr-new

pkg-pr-new Bot commented Oct 6, 2026

Copy link
Copy Markdown
npm i https://pkg.pr.new/cf@221

commit: eed6aa6

@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

cf --help startup

mean stddev min max
PR 168.7 ms 2.8 ms 162.2 ms 172.7 ms
base 177.1 ms 9.8 ms 166.4 ms 195.2 ms

Δ (PR vs base): ↓ -8.4 ms (-4.7%)

Measured with hyperfine on ubuntu-latest (3 warmup runs, 20 timed runs). CI numbers carry ±a few ms of runner jitter; treat small deltas as noise.

@ask-bonk

ask-bonk Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

LGTM

github run

@edmundhung edmundhung left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good to me. I wonder if the retry logic is needed. But there's no harm including it anyway. 👍🏼

@petebacondarwin
petebacondarwin added this pull request to the merge queue Oct 7, 2026
Merged via the queue into main with commit 12d6be7 Oct 7, 2026
11 checks passed
@petebacondarwin
petebacondarwin deleted the codex/forge-updater-network-recovery branch October 7, 2026 05:25
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