Repository navigation
[sentry:7877309542] Repaired the severed cause chain in runLiteRtHostJson (src/runtime/litert-lm/host-process.ts). The child.on('error') branch now passes { cause: error } to its `Atom - #147
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 severed cause chain in
runLiteRtHostJson(src/runtime/litert-lm/host-process.ts). Thechild.on('error')branch now passes{ cause: error }to itsAtomicCoreError, so the spawn failure's OS code survives. Code, message${failure.what}: the LiteRT-LM host could not be started.anddetails(String(error)) are byte-identical, soErrorBody,toJSON(), the HTTP 500 and the reported event are unchanged. Effect:errorChainnow reaches the spawnError,classifyFailurefinds a recognized OS code in the reverse chain (ENOENT -> not_found, EACCES/EPERM -> disk_permission),cause_codebecomes that code, and the existing agent observer emitsdiagnostic_cause_code. Before, the wrapper code ENGINE_INSTALL_FAILED — in neither the EXPECTED nor OPERATIONAL table — producedfailure_category=unknown,failure_reason=unknown,cause_code=ENGINE_INSTALL_FAILEDand no cause code, i.e. the event'shttp request: unknown. Added docs/decisions/2026-12-02-preserve-host-spawn-cause-on-litert-lm-probe-errors.md with one INDEX bullet, following the two 2026-11-06 precedents for the same class of loss. This does not explain or fix why the macOS host binary could not be spawned (missing, non-executable or Gatekeeper-quarantined); the next event will name that condition. Platform validation remains limited to this Linux sandbox.Evidence:
Carried probe src/runtime/litert-lm/host-process-spawn-cause.test.ts fails on base at its diagnostic-tags assertion and passes after the edit: check exited 0, 1/1 tests passed, "keeps the operating-system code of a host spawn failure" passed.
Before the edit, src/runtime/litert-lm/host-process.ts:99-107 built
new AtomicCoreError(failure.code,${failure.what}: the LiteRT-LM host could not be started., String(error))with no options argument, soError.causewas unset; after the edit the same call passes{ cause: error }.src/contracts/errors.ts:318
AtomicCoreErroracceptsAtomicCoreErrorOptions { cause?: unknown }and forwards it viasuper(message, { cause });toJSON()still emits only code/message/details, so the wire contract is untouched.src/telemetry/policy.ts
errorCodeOfrecognizes ENOENT/EACCES/EPERM/ENOSPC/EIO/etc.; src/telemetry/diagnostics.tsdiagnosticTagstakescause_codefrom the reversed chain's first recognized code, andclassifyFailuremaps OPERATIONAL reasons from that chain — both previously stopped at ENGINE_INSTALL_FAILED.src/telemetry/sentry-agent-diagnostics.ts walks
causeup to depth 5 and emitsdiagnostic_cause_codeonly from its allowlist, which contains ENOENT/EACCES/EPERM — so the preserved cause now reaches the observer without any observer change.Event 67ff3467e8824407ad4574889f1a4293 facts (release atomic-chat-core@0.24.10, darwin/arm64, gpu_vendor=apple, http_status=500, source=control_route, cause_code=ENGINE_INSTALL_FAILED, failure_category=unknown, failure_reason=unknown) and its exception value 'http request: unknown' match exactly the pre-fix behavior of this path; the stack bottoms out at host-process.ts:99.
Release diff atomic-chat-core@0.24.10#5267d2d03a37 touches src/core/create.ts, src/diffusion/, src/drafters/, src/server/control/* and src/version.ts — not src/runtime/litert-lm/host-process.ts — so the release carries the same defect.
docs/decisions/2026-11-06-preserve-cause-on-staged-engine-install-errors.md and 2026-11-06-preserve-cause-on-llamacpp-engine-install-errors.md record the identical one-line
{ cause: error }repair for the same symptom.Regression tests: src/runtime/litert-lm/host-process-spawn-cause.test.ts
Full CI and human review are required.
Report: http://127.0.0.1:8080/tenants/707d0855-80ab-4e1f-a156-f1c4546cbf52/runs/db170bc8-2d77-48d0-832a-a8d5efbed650
Sentry: https://atomic-chat.sentry.io/issues/7877309542/