[PR #3034] [CLOSED] [Other] Refresh conversation-cache metrics after refused parking #4413

Closed
opened 2026-11-07 15:35:32 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/3034
Author: @oscarlius
Created: 10/18/2026
Status: ❌ Closed

Base: main ← Head: fix/conversation-cache-pressure-metrics-20261018


📝 Commits (1)

  • 06ea882 fix(serve): stop reporting stale cache occupancy after refused parking

📊 Changes

4 files changed (+180 additions, -0 deletions)

View changed files

📝 docs/DETAILS.md (+5 -0)
📝 serve/server.py (+21 -0)
📝 serve/test_monitor.py (+152 -0)
📝 serve/web/app.js (+2 -0)

📄 Description

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.

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.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/3034 **Author:** [@oscarlius](https://github.com/oscarlius) **Created:** 10/18/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/conversation-cache-pressure-metrics-20261018` --- ### 📝 Commits (1) - [`06ea882`](https://github.com/Niko1221/Strata/commit/06ea882b3be98f8c044f49ad8eb812ea6d9cd964) fix(serve): stop reporting stale cache occupancy after refused parking ### 📊 Changes **4 files changed** (+180 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `docs/DETAILS.md` (+5 -0) 📝 `serve/server.py` (+21 -0) 📝 `serve/test_monitor.py` (+152 -0) 📝 `serve/web/app.js` (+2 -0) </details> ### 📄 Description ## 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 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 15:35:32 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#4413
No description provided.