Skip to content

[sentry:7854603802] models.files reaches modelFiles in src/terminal-setup/catalog.ts, which calls the core's fetchHfGgufFiles. The newest event (atc@0.2.21, darwin/arm64, core 0.24.8 - #114

Open
Ooooze wants to merge 1 commit into
mainfrom
codex/sentry-fix/7854603802
Open

Ooooze wants to merge 1 commit into
mainfrom
codex/sentry-fix/7854603802

Conversation

@Ooooze

@Ooooze Ooooze commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

models.files reaches modelFiles in src/terminal-setup/catalog.ts, which calls the core's fetchHfGgufFiles. The newest event (atc@0.2.21, darwin/arm64, core 0.24.8) carries diagnostic_cause_code=ECONNREFUSED and error_code=ECONNREFUSED; the innermost in-app frame is node_modules/@atomic-chat/core/dist/models/hf.js:28 (in_app=false), i.e. the runtime's fetch rejection. modelFiles only mapped AtomicCoreError matching HTTP (401|403), so the untyped transport rejection escaped through models.files to WorkspaceService.execute and was reported as an unexpected failure. Fix: in modelFiles, after the existing 401/403 mapping, a rejection whose own or cause-chain code (up to five levels) is one of ECONNREFUSED, ConnectionRefused (Bun), ECONNRESET, ENOTFOUND, EAI_AGAIN, ENETUNREACH, EHOSTUNREACH, ETIMEDOUT, UND_ERR_SOCKET, UND_ERR_CONNECT_TIMEOUT becomes AtcError('ATC_USAGE', 'Could not reach Hugging Face for this repository.', { details: 'Network error: <code>', hint: 'Check this machine’s network or proxy, then retry.' }). Every other rejection, the shard/projector filters and the sort are unchanged. The carried regression test failed on the base with the raw TypeError and passes with the patch; no core or telemetry change is required.

Evidence:
Event da77eabd (atc@0.2.21, dist 55067cf, darwin/arm64, core 0.24.8, operation models.files): facts carry diagnostic_cause_code=ECONNREFUSED and error_code=ECONNREFUSED; exception is TypeError 'workspace models.files: unknown'; innermost frame node_modules/@atomic-chat/core/dist/models/hf.js:28, in_app=false.
Event 89303256 (atc@0.2.19, win32, core 0.23.4) shows the identical TypeError and stack without a cause tag (the observer did not exist in that release); same symptom on both hosts, so no regression.
src/terminal-setup/catalog.ts modelFiles() mapped only AtomicCoreError matching /HTTP (401|403)/ to ATC_USAGE and rethrew every other rejection unchanged.
Probe on base 55067cf: modelFiles('owner/repo', fetch rejecting with TypeError('fetch failed') cause {code:'ECONNREFUSED'}) rejected with the TypeError; 'expected TypeError: fetch failed to be an instance of AtcError' failed.
After the patch, the same test passes: the rejection is an AtcError with code ATC_USAGE and message 'Could not reach Hugging Face for this repository.'
src/terminal-setup/catalog.ts searchHub() already answers a catalog outage as 'Model catalog unavailable (HTTP ). Retry when connected.' — in-file precedent for a connectivity answer.
src/telemetry/reports.ts classifies ECONNREFUSED/ECONNRESET/ENOTFOUND/UND_ERR_* as an environment condition for downloads, consistent with treating this as a network condition, not a defect.
0.2.21 release sha equals base sha (empty release diff), so the inspected base is the code that produced the newest event.

Regression tests: src/terminal-setup/catalog.test.ts

Full CI and human review are required.

Report: http://127.0.0.1:8080/tenants/707d0855-80ab-4e1f-a156-f1c4546cbf52/runs/8b4c3675-9cad-4db9-9144-51c8586896b7

Sentry: https://atomic-chat.sentry.io/issues/7854603802/

This branch has not been deployed

No deployments
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.

1 participant