Skip to content

fix(cli): catalog says the registry could not be read instead of listing nothing - #7015

Merged
miguel-heygen merged 1 commit into
mainfrom
fix/catalog-fails-loudly
Nov 2, 2026
Merged

miguel-heygen merged 1 commit into
mainfrom
fix/catalog-fails-loudly

Conversation

@miguel-heygen

Copy link
Copy Markdown
Collaborator

What

When the registry can't be read and nothing is cached, hyperframes catalog exits 1 and prints why, for example The registry could not be read: fetch failed (getaddrinfo ENOTFOUND raw.githubusercontent.com). Before, it printed [] (or "No items found in registry.") and exited 0.

Why

An unreachable registry and a registry with no items gave the same answer. On networks that block raw.githubusercontent.com (mainland China and some ISPs elsewhere), HyperFrames Desktop read that [] as an empty catalog and told people "The catalog is empty". Its retry could never help, and nothing said what was wrong.

To reproduce before this change: deny raw.githubusercontent.com (for example 127.0.0.1 raw.githubusercontent.com in the hosts file), clear ~/.hyperframes/cache, run hyperframes catalog --json. It prints [] and exits 0.

Related work

Refs #7014, which adds a CDN mirror those networks reach. This PR is the part that stands alone: it says plainly what failed, mirror or not.

How

  • readRegistryManifest (registry/remote.ts) is the manifest read as before, fresh cache, then network, then stale cache. When all of those come up empty it throws The registry could not be read: <reason> instead of answering undefined.
  • fetchRegistryManifest keeps its contract by wrapping it (undefined when unreachable and uncached), so listRegistryItems and the picker's fallback to bundled items are unchanged.
  • catalog uses readRegistryManifest, prints the message to stderr and exits 1. A reachable registry with no items still prints [].

Test plan

fails without the fix: remote.test.ts › "throws why when the registry host cannot be reached and nothing is cached", catalog.test.ts › "exits non-zero with the reason instead of printing an empty list"

  • Unit tests added/updated: the two above. Both fail on main. The changed test files plus resolver.test.ts and transport.test.ts pass 3 runs in a row (126 tests).
  • The whole packages/cli suite has no failure that main doesn't also have in my environment (the existing ones come from packages not built there). oxlint, oxfmt and the comment ratchet are clean.
  • Manual testing performed: not on a blocked network.
  • Documentation updated: not needed.
  • Comments follow CONTRIBUTING.md "Comments"

Size

4 files, 67 lines. It's split from #7014 on purpose: that PR waits on the mirror going live, and this part helps people on blocked networks without it.

@heygengenesis heygengenesis Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approving at 51801c93. I found no blockers.

  • Fail-without-fix check: The fails without the fix: line names two tests. I put back the base versions of remote.ts and catalog.ts (from 036e41fa) and both tests failed. With the PR's code, remote.test.ts and catalog.test.ts pass (98 tests), and tsc reports no errors in the files this PR touches.
  • Contract: fetchRegistryManifest still returns undefined when the registry is unreachable and nothing is cached, so listRegistryItems, the picker fallback and testHome behave as before. Only catalog moves to the version that throws. If a stale cache exists, it is still used before anything throws.
  • Catalog path: finishCommand(1) returns never, so manifest is a non-optional type after the .catch. A reachable registry with no items still prints [].
  • Nit (not blocking): With --json, the error goes to stderr as plain text rather than JSON. That's fine for Desktop, which reads the exit code, but say so in the changelog if anything parses stderr.

CI: some runs (CI, CodeQL, Windows render verification) were still running when I reviewed. Every run that had finished had passed.

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Edit accuracy: accurate 271 (base branch 271), smooth 98 of those

The gate passes.
Smoothness is reported in the artifact, not gated. A case fails only if it fails 2 of 3 runs.

Quarantined, measured but not gated (0)

Unstable (2)

  • seqplainkeys-none-px-r0-root-z100: tracking 0.06, pressJump 0, drop 0, reload 0, render 0.03, renderKey -, undo false, teleport true / tracking 0.06, pressJump 0, drop 0, reload 0, render 0.03, renderKey -, undo true, teleport true / tracking 0.06, pressJump 0, drop 0, reload 0, render 0.03, renderKey -, undo true, teleport true
  • seqfastkeys-none-px-r0-root-z100: tracking 0.07, pressJump 0.05, drop 0, reload 0, render 0.02, renderKey -, undo false, teleport true / tracking 0.06, pressJump 0.05, drop 0, reload 0, render 0.02, renderKey -, undo true, teleport true / tracking 0.06, pressJump 0.05, drop 0, reload 0, render 0.02, renderKey -, undo true, teleport true

@miguel-heygen
miguel-heygen added this pull request to the merge queue Nov 2, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 2, 2026
@miguel-heygen
miguel-heygen added this pull request to the merge queue Nov 2, 2026
Merged via the queue into main with commit 5a07ea2 Nov 2, 2026
83 checks passed
@miguel-heygen
miguel-heygen deleted the fix/catalog-fails-loudly branch November 2, 2026 15:05
@testgoodly

Copy link
Copy Markdown

fix/catalog-fails-loudly

SanHsien added a commit to SanHsien/hyperframes that referenced this pull request Nov 3, 2026
Port upstream heygen-com#7015 (5a07ea2): catalog used to print an empty list and
exit 0 when the registry was unreachable. It now exits 1 and explains
why, in every output mode. The catalog test was ported by hand because
of a conflict with fork tests. Watermarks stay put; the remaining
upstream backlog is tracked in ROADMAP.md.

Co-authored-by: Miguel Ángel <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
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