Skip to content

[sentry:7857488946] POST /atomic/v1/engines/:engine/update with a variant-only target resolved the variant against catalog.available by strict string equality in LlamacppEngine.target. T - #127

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

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

Conversation

@Ooooze

@Ooooze Ooooze commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

POST /atomic/v1/engines/:engine/update with a variant-only target resolved the variant against catalog.available by strict string equality in LlamacppEngine.target. The client's variant can be a minor-less CUDA family id (win-cuda-13-x64, what staticLatestVariants/latestBackendOptions put behind the "Latest CUDA 13" dropdown and what version_backend may hold), while the catalog lists concrete assets (win-cuda-13.5-x64, the event's active backend). The strict lookup found nothing and raised AtomicCoreError('BACKEND_TAG_UNRESOLVED', 'The llamacpp-upstream catalog has no <variant> build for this computer.') — an HTTP 500 for a build the catalog does have. Fix: target() now resolves a variant-only target through resolveLatestVersionBackend(variant, catalog.available) (exact id first, then the newest concrete member of the family — the resolution UPSTREAM_POLICY.resolveSentinel and the app's resolveLatestBackendString already use) and parses the resulting <version>/<backend> with the existing parseKey. A variant the catalog truly lacks still raises BACKEND_TAG_UNRESOLVED with the same code, message shape and details. Explicit <version>/<variant> targets are unchanged. The carried regression test passes with the fix; the pre-existing test that a variant absent from the catalog is refused still holds because win-cuda12-x64 is not a family id under WIN_CUDA_FAMILY_RE. Sentry's http request: unknown wording comes from BACKEND_TAG_UNRESOLVED being classified neither EXPECTED nor OPERATIONAL in src/telemetry/diagnostics.ts — a protected telemetry change outside this repair and not the defect. Windows behaviour was not exercised in this Linux sandbox; the probe drives the engine with a fake catalog that mirrors the event's ids.

Evidence:
Event stack: src/engines/llamacpp.ts target (lineno 213), updateHeld (lineno 124), src/backend/install/service.ts operate (lineno 432).
Base target() used catalog.available.find((entry) => entry.backend === variant) then threw BACKEND_TAG_UNRESOLVED; probe on base failed with 'The llamacpp-upstream catalog has no win-cuda-13-x64 build for this computer.'
src/backend/catalog/cuda-family.ts resolveLatestVersionBackend: exact backend match first, else resolveGpuFamilyConcrete picks the numerically newest concrete member of the family; used by UPSTREAM_POLICY.resolveSentinel and optimal-cache.
src/backend/select/recovery.ts staticLatestVariants('windows') returns minor-less ids ['win-cpu-x64','win-cuda-12-x64','win-cuda-13-x64','win-rocm-x64','win-vulkan-x64'] behind the Latest dropdown entries.
Event facts: active_backend=win-cuda-13.5-x64, source=control_route, component=http, operation=request, http_status=500, error_code=BACKEND_TAG_UNRESOLVED, release atomic-chat-core@0.24.7 (dist 2072fa6). Release diff to 0.24.8 touches only src/runtime/strata/** and src/core/{create,strata}.ts.
Pre-existing test 'refuses a variant the catalog does not have' uses variant win-cuda12-x64, which WIN_CUDA_FAMILY_RE does not match, so resolveLatestVersionBackend returns null and the refusal is preserved.
Check run after the fix: src/engines/llamacpp-family-target.test.ts — 1 passed, exit code 0.

Regression tests: src/engines/llamacpp-family-target.test.ts

Full CI and human review are required.

Report: http://127.0.0.1:8080/tenants/707d0855-80ab-4e1f-a156-f1c4546cbf52/runs/0282f0db-3256-4149-b0e4-c11aa8322814

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

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