LearnNewsExamplesServices
Frontmatter
id16880
titleOllama admission is invisible to provider activity metrics
stateClosed
labels
bugaiperformance
assigneesneo-opus-grace
createdAtAug 10, 2026, 2:11 PM
updatedAtAug 11, 2026, 5:51 PM
githubUrlhttps://github.com/neomjs/neo/issues/16880
authorneo-gpt-emmy
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtAug 11, 2026, 5:51 PM

Ollama admission is invisible to provider activity metrics

Closed Backlog/active-chunk-14 bugaiperformance
neo-gpt-emmy
neo-gpt-emmy commented on Aug 10, 2026, 2:11 PM

Context

PR #16862 correctly adds native Ollama admission control, but exact-head producer tracing found that the admitted call still enters observeUnqueuedProviderActivity(). That helper explicitly records queueDisposition: 'not-applicable', makes enqueuedAt === startedAt, and therefore publishes no measured queue wait.

The PR's new getOllamaEmbeddingAdmission() method reports {cap, inFlight, waiting} only to unit tests; an exact-tree caller search at 9bc05dda52 found no production consumer. The queue is enforced, but the existing public observer will describe its admitted work as unqueued.

Live latest-open sweep: checked the latest 20 open issues at 2026-08-10T12:11:21.358Z; no equivalent found. Semantic and exact searches surfaced #16770 and #16780 as adjacent authority, not duplicates; the all-state A2A claim sweep over the latest 30 messages found no overlapping lane claim.

The Problem

Correct control flow can manufacture false operational evidence. A caller that waits behind the Ollama cap will be recorded with a null queue interval and not-applicable, so an operator cannot distinguish provider execution from Neo admission wait or reconcile the declared cap with current {inFlight, waiting} demand.

This is a day-after-merge observability transfer, not a reason to hold the admission repair: cancellation, slot release, dynamic cap reads, and Compose reach are independently safe at the reviewed head.

The Architectural Reality

TextEmbeddingService.#embedOllama() owns admission and dispatch. createProviderActivityLifecycle() in ai/services/shared/providerActivityLedger.mjs already owns truthful enqueuedAt, startedAt, queueDisposition: 'neo-queued', and queueWaitMs semantics. get_memory_core_tool_metrics.providerActivity is the existing cross-process public observer; no new MCP tool is warranted.

The provider ledger is shared by Knowledge Base and Memory Core recorders. Admission facts must be written at the producing process, then projected by the existing observer; a process-local getter alone cannot satisfy deployed operator visibility.

Structure-map V-B-A confirms both owners already exist in ai/services/memory-core and ai/services/shared; this ticket introduces no new service boundary.

The Fix

Bind native Ollama admission to createProviderActivityLifecycle() instead of the unqueued helper:

  • stamp enqueue before an admission wait and start only after the slot is acquired;
  • record queueDisposition: 'neo-queued' and measured wait duration for both queued and uncontended calls;
  • preserve provider-settlement ownership of completion and slot release; and
  • extend the existing provider-activity projection with bounded native-admission state sufficient to report cap, executing/in-flight, and waiting without a new tool.

Retire or production-bind getOllamaEmbeddingAdmission() so it is not a test-only promise.

Contract Ledger Matrix

Target Surface Source of Authority Proposed Behavior Fallback Docs Evidence
Native Ollama provider-activity row TextEmbeddingService admission + createProviderActivityLifecycle neo-queued; enqueue precedes wait; start follows acquisition; real queueWaitMs fail observation open without changing provider result existing lifecycle JSDoc blocked/uncontended timing controls
get_memory_core_tool_metrics.providerActivity admission projection shared provider ledger bounded native Ollama cap, executing/in-flight, and waiting state through the existing observer unknown/partial when recorder or cap provenance is unavailable; never fabricated zero OpenAPI schema/description cross-recorder projection control
getOllamaEmbeddingAdmission() TextEmbeddingService consumed by the production projection or removed as redundant no test-only public promise JSDoc caller census + mutation

Decision Record impact

none — composes the existing admission and provider-observation authorities; no ADR is amended.

Acceptance Criteria

  • A native Ollama caller blocked behind the cap records queueDisposition: 'neo-queued', startedAt > enqueuedAt, and positive queueWaitMs.
  • An uncontended native Ollama call remains synchronously dispatched while recording neo-queued with a measured zero wait.
  • Provider settlement—not caller abort or admission release—completes the provider-activity row.
  • The existing public provider-activity observer reports bounded cap, executing/in-flight, and waiting state across recorder processes without a new MCP tool.
  • Missing, disabled, partial, or stale recorder/cap provenance reports unknown/partial rather than zero idle demand.
  • A production caller census proves getOllamaEmbeddingAdmission() is consumed or the redundant method is removed.
  • Restoring observeUnqueuedProviderActivity() reddens the queue-disposition and wait-duration witnesses.
  • A cross-process mutation that keeps the admission snapshot process-local reddens the public-projection witness.

Out of Scope

  • Changing the cap value or admission/cancellation state machine delivered by #16861 / PR #16862.
  • Reopening #16861; this successor owns only the transferred observability gap.
  • Adding a second Ollama limiter or a new diagnostic MCP tool.

Avoided Traps

  • Treating an enforced queue as observed. A production writer and a deployed consumer are both required.
  • Publishing zero wait. Zero is measured immediacy; unavailable evidence is null/unknown.
  • A process-local status getter. It cannot describe other producer processes on the deployed topology.

Related

Related: #16780 · #16770 · #16861 · PR #16862

Origin Session ID: 878f05af-2c4e-4da2-a5c2-9e4af666fcb8

Retrieval Hint: native Ollama admission providerActivity neo-queued queueWaitMs cap inFlight waiting

Authored by Emmy (GPT-5.6 Sol Ultra, Codex).

tobiu referenced in commit accfdb0 - "fix(memory-core): native Ollama admission was enforced and then described as absent (#16880) (#16943) on Aug 11, 2026, 5:51 PM
tobiu closed this issue on Aug 11, 2026, 5:51 PM