Repository navigation
[sentry:7858737683] Repaired the lost-cause defect behind ATOMIC-CHAT-CORE-DN (IO_ERROR: http request: unknown, release atomic-chat-core@0.24.7#2072fa6f1692). SettingsStore.persist (src/ - #129
Open
Ooooze wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Repaired the lost-cause defect behind ATOMIC-CHAT-CORE-DN (
IO_ERROR: http request: unknown, release atomic-chat-core@0.24.7#2072fa6f1692).SettingsStore.persist(src/settings/store.ts:583 in the release, identical in base) wrapped a failed mkdir/writeFile/rename intonew AtomicCoreError('IO_ERROR', ...)with nocause, soerrorChainin src/telemetry/diagnostics.ts stopped at the AtomicCoreError: the fsErrnoException.code(EPERM/EACCES/EBUSY/ENOSPC/EIO) never reachedclassifyFailure, the event was reportedfailure_category: unknown,failure_reason: unknown,cause_code: IO_ERRORand surfaced as HTTP 500IO_ERROR: http request: unknownon Windows x64. The fix passes{ cause: e }to that single AtomicCoreError; message,code,detailsandtoJSON()/ErrorBodyare unchanged, so the wire contract and write behavior are identical. The carried regression probe src/settings/store-persist-cause.test.ts now passes (it failed on base atexpect(errorChain(error)).toEqual([error, locked])) and additionally asserts classification becomesoperational/disk_permissionwithcause_code: EPERM. A new ADR documents the decision and the index links it. The underlying Windows condition that made the write fail (likely a file hold) is not fixed by this repair; the next occurrence will name the real errno instead ofunknown, and no retry was added because no event evidence supports a transient hold.Evidence:
Event facts: component=http, operation=request, source=control_route, error_code/cause_code=IO_ERROR, failure_category=unknown, failure_reason=unknown, http_status=500, os.name=win32, release atomic-chat-core@0.24.7#2072fa6f1692.
Frames
persist(src/settings/store.ts:583) and its caller (src/settings/store.ts:552) match the current base exactly; the release diff touches only src/core/create.ts, src/core/strata.ts, src/runtime/strata/* and src/version.ts.Base persist raised
new AtomicCoreError('IO_ERROR',cannot write ${this.path}: ${(e as Error).message})with no options, soError.causewas undefined; src/contracts/errors.ts forwardsoptions.causetosuper(message, { cause })andtoJSON()still emits only{code, message, details}.src/telemetry/diagnostics.ts
errorChainwalksError.cause; OPERATIONAL maps EPERM/EACCES→disk_permission, EBUSY→disk_file_locked, ENOSPC→disk_full, anddiagnosticTagsderivescause_codefrom that chain — impossible with a dropped cause.Applied fix keeps the same code, message and undefined details and adds
{ cause: e }as the fourth AtomicCoreError argument in src/settings/store.ts.Check on the fixed working copy: src/settings/store-persist-cause.test.ts passes (1 test, 2 suites passed, exit 0); the same file failed on base at
expect(errorChain(error)).toEqual([error, locked])with length 1 vs 2.Precedent ADRs: 2026-11-03-preserve-filesystem-cause-on-instance-lock-io-errors.md, 2026-11-06-preserve-cause-on-staged-engine-install-errors.md, 2026-11-06-preserve-cause-on-llamacpp-engine-install-errors.md made the identical change elsewhere.
Existing test
rolls the in-memory document back when the rename fails(src/settings/store.test.ts) only asserts{ code: 'IO_ERROR' }and throws a plain Error without acodeproperty, so it never observed the severed cause.Regression tests: src/settings/store-persist-cause.test.ts
Full CI and human review are required.
Report: http://127.0.0.1:8080/tenants/707d0855-80ab-4e1f-a156-f1c4546cbf52/runs/44926c2e-e2e6-426a-9dfe-6f228e0a79bf
Sentry: https://atomic-chat.sentry.io/issues/7858737683/