Pull requests / #3333

#3333 [Other] Refresh conversation-cache metrics after refused parking

open · @oscarlius · 0 Kommentare · Auf GitHub

Setup & installServer & APISecurityWindows

Beschreibung

## Problem and result

After a refused conversation-cache park, the Monitor and `/metrics` could retain a prior occupancy. This change records only the remaining count where the refusal establishes it, marks unknown bytes and cumulative evictions as unknown, and hides occupancy bars until a later authoritative event.

## Related discussion

Continues #3034 after the 0.2.0-beta tracker reset. The original passed the new format check, but GitHub refused to reopen the rebased branch; [the reset bot](https://github.com/Niko1221/Strata/pull/3034#issuecomment-6282589985) explicitly suggested a new linked pull request.

Closes #3033.

## Approach

Parse physical-pressure, minimum-length, and other refusal log lines in the server observer. Add regression coverage for log replay, the local loopback `/metrics` endpoint, and the Monitor card. The native cache policy and inference paths are unchanged.

## Validation

Rebased on upstream main `e88ee39d1d6be6e3364183af3b39b62a7ed6f211` (0.2.0-beta); tested candidate `8d0a488f5a4ba8c06afae70f1739121345bcbab0` on Windows, Python 3.14.3. Each test command starts a fresh local process.

**Passed:**
- `py -3.12 -m ruff check --output-format json serve/server.py serve/test_monitor.py` (Ruff 0.2.1): 10 existing diagnostics, same as unmodified main; zero new diagnostics.

- `python -m unittest -v serve.test_monitor serve.test_prometheus` — 24 tests passed.
- `python -m py_compile serve/server.py serve/test_monitor.py`.
- `node --check serve/web/app.js`.
- `git diff --check e88ee39d1d6be6e3364183af3b39b62a7ed6f211..HEAD`.

**Failed:**
- With exact base production files restored, the pressure regression set failed (8 tests; 10 assertion failures and one environment error before the local `regex` dependency was installed). The fresh loopback HTTP `/metrics` red test then failed as expected: stale `(parked, bytes)` remained `(1, 104857600)` instead of `(0, 0)`.

**Not run:**
- No GPU, native backend, model download, or hardware inference test.

## Limits

The proof covers the Python observer, local mock engine, loopback HTTP server, and Monitor JavaScript rendering. It does not measure a real engine's memory-admission behavior.

Mehr auf der Site

Links zu Install, Modellen, Releases.