Skip to content

fix(setup): preserve Linux Hopper HTTP failure status - #7183

Merged
gensokyo-dev merged 1 commit into
morluto:mainfrom
WenyuChiou:fix/hopper-http-status-7182
Oct 26, 2026
Merged

gensokyo-dev merged 1 commit into
morluto:mainfrom
WenyuChiou:fix/hopper-http-status-7182

Conversation

@WenyuChiou

@WenyuChiou WenyuChiou commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #7182.

Linux Hopper setup now preserves an observed HTTP failure status instead of giving indistinguishable diagnostics for HTTP 404 and 503.

Problem and expected behavior

The downloader previously returned only ok: false, so the Linux installer and setup adapter could not report the HTTP status. Preserve that fact without inferring its cause or promising that retrying will succeed.

Change and scope

  • Add optional HTTP status to the shared download result for valid failed-response statuses.
  • Carry that fact through the Linux installer's existing operationFailure detail and setup remediation. The top-level code remains download_failed.
  • Add offline producer-to-setup regression coverage and a short installation-guide note.

This is the separate HTTP-status diagnostic follow-up explicitly excluded by #7150, not a replacement for its timeout work. No timeout, retry, redirect, byte-limit, package-verification, or authorization policy changes.

Contract and boundary impact

  • Semantic owner: downloadHopperPackage produces the observed HTTP fact; the Linux installer consumes it through existing setup failure projection.
  • Contribution scope: ordinary correction within existing setup; advance maintainer scope decision not applicable.
  • CLI/MCP: no schema or catalog change; Linux setup remediation becomes more specific.
  • Platform: Linux diagnostic consumption only. Other consumers retain existing behavior.
  • Evidence/reconstruction: no analysis artifact or reconstruction changes.
  • Lifecycle: response cancellation and existing installation safeguards remain; no new resource acquisition.
  • Package/metadata: no dependency, lockfile, version, or generated-catalog changes.

Expected effects:

  • Contact network services. Existing setup download behavior only; tests use synthetic fetch responses.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Recover protected code or work around protections.

Evidence and regression coverage

The new regression failed for 404 and 503 against the original implementation, then passed after the fix. It executes the production downloader, Linux installer, and setup adapter with synthetic fetch responses and a controlled installer host that rejects unexpected installation effects.

For HTTP 503, the observed setup result is:

{"status":"failed","code":"download_failed","remediation":"download: Package download returned HTTP 503. REA could not download or unpack the official Hopper package. Check network and filesystem access, then retry setup."}

Coverage also checks cancellation of failed response bodies, unchanged successful downloads, and generic diagnostics for missing or invalid statuses. Existing redirect and setup tests remain included. These are offline application-boundary results, not CLI or real-vendor output.

Validation performed

  • npm run test:focused -- tests/process-global/hopperDownloadHttpFailure.test.ts tests/process-global/hopperDownloadRedirect.test.ts src/application/LinuxHopper.test.ts src/application/SetupInstallFailure.test.ts: 81 tests passed across four files; independently rerun successfully.
  • Independent boundary smoke checks: 12 passed.
  • npm run check:fast: passed, including typecheck/lint.
  • npm run docs:check: passed.
  • Independent static review: no remaining blockers in the four-file patch.

Validation used isolated lockfile dependencies installed with npm 11.16.0 and npm ci --ignore-scripts; no lockfile change. Earlier shared-dependency mismatch and a direct TypeScript run exiting 137 were retained as failed attempts, not counted as passing evidence. The subsequent isolated official checks above passed.

Compatibility, safety, and release

Base: 1173c0a9dc1b352a60943a491462294db8f353ae. Reviewed tree: 57e48695ed681694580777508a6270bbe05c6980.

Optional result detail is additive; no migration or release metadata change. Only a numeric observed status is included, not response bodies or credentials. No automatic retry or weakened verification.

Not run: full aggregate suite, package verification, actual CLI setup, vendor download, package installation, macOS diagnostic acceptance, or real provider execution. Hosted CI remains pending. No maintainer agreement or broader setup reliability claim is implied.

Author readiness

Human owner: @WenyuChiou

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved.
  • Tests and affected validation support the final change.
  • Human review and required checks are complete.

@greptile-apps

greptile-apps Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; the added diagnostic preserves the existing download rejection and installation safeguards.

Summary

Preserves an observed HTTP failure status from the Hopper downloader through Linux setup diagnostics.

  • Linux Hopper setup shows the HTTP status when its package download fails.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Failed HTTP response] --> B[downloadHopperPackage]
  B --> C[Optional httpStatus]
  C --> D[installLinuxHopper]
  D --> E[operationFailure detail]
  E --> F[Setup remediation]
  F --> G[download_failed unchanged]
Loading

Reviews (1) · Last reviewed commit: "fix(setup): preserve Linux Hopper HTTP f..." · Reviewed by Greptile

@WenyuChiou
WenyuChiou marked this pull request as ready for review October 26, 2026 00:39
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-26T12:42:53.490873Z 701bf8a Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copy link
Copy Markdown
Contributor Author

@codex review

@gensokyo-dev

Copy link
Copy Markdown
Collaborator

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: 701bf8aff9

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@gensokyo-dev

Copy link
Copy Markdown
Collaborator

Independently validated head 701bf8aff9e19ebd3158ba8923c4caf41d7363c8 integrated onto current main 0211a07ec5c43b2f8cbdbcd80f3f3619773a7b72:

  • Original production implementation fails the new 404 and 503 regressions (2 failed, 9 passed); patched downloader → Linux installer → setup regression suite passes all 81 tests in four files.
  • Also exercised the production downloader over actual HTTPS sockets against a private loopback TLS server (explicit local test CA, no fetch stub): base loses both observed statuses; patched result retains httpStatus: 404 and 503 with zero retained failure bytes. The 200 control returns identical 24 package bytes. Exactly one request per response in both versions; no retry or installation.
  • HTTPS three-case workflow: base 0.574s wall / 0.523s CPU, patched 0.605s / 0.575s; sampled family RSS 86.10 and 81.18 MiB. Two CPUs, one sample, uncontrolled caches; no performance improvement claimed. Results add one optional integer and no extra fetch/context payload. Agent token count unmeasured.
  • check:fast, serial docs:check, and whitespace checks pass. An initial docs invocation was refused by the artifact lock while the focused build was active; the serial rerun passed. Initial test:local correctly rejected a built-project path, then the official focused command ran the red/green cases.
  • Inspected downloader ownership, all consumers (publisher, Linux and macOS installers), and existing response/redirect/cancellation bounds. No duplicate status interpretation or additional patch needed. Linux alone consumes the new optional diagnostic; other consumers keep their existing behavior.
  • CI run 40249030449 is successful for this exact PR head, including static/source/package/docs, all eight shards and native Linux package baseline. Fresh Codex review completed with no findings; Greptile 5/5 and no unresolved threads.

No vendor package was downloaded or installed, and no real Hopper execution or macOS diagnostic acceptance is claimed. The live TLS check verifies actual HTTP transport; installer/setup regression uses controlled hosts that reject installation effects.

@gensokyo-dev
gensokyo-dev merged commit 1a91630 into morluto:main Oct 26, 2026
43 of 44 checks passed
@github-actions github-actions Bot mentioned this pull request Oct 26, 2026
3 tasks done
SandstromPL added a commit to SandstromPL/rea that referenced this pull request Oct 26, 2026
Main's 1a91630 (morluto#7183) changed downloadHopperPackage to return a
HopperDownload that keeps the HTTP status of a refused response, and
split that refusal from the oversized-body check. Keep both: the merged
function returns HopperDownload with main's HTTP-status refusal and
content-length check, inside this branch's stall and overall timers.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@WenyuChiou
WenyuChiou deleted the fix/hopper-http-status-7182 branch October 26, 2026 20:47
@morluto morluto added area: setup Setup, packaging, upgrade, install, Doctor, and client registration bug Something isn't working provider: hopper Analysis provider / engine: hopper labels Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: setup Setup, packaging, upgrade, install, Doctor, and client registration bug Something isn't working provider: hopper Analysis provider / engine: hopper

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Hopper Linux setup drops HTTP failure status and gives the same recovery message for 404 and 503

3 participants