Skip to content

QVAC-16601 test[skiplog]: add kv-cache disk persistence test for tool…#1319

Merged
Victor-Rodzko merged 4 commits into
mainfrom
test/kv-cache-tools-save-persistence
Apr 7, 2026
Merged

QVAC-16601 test[skiplog]: add kv-cache disk persistence test for tool…#1319
Victor-Rodzko merged 4 commits into
mainfrom
test/kv-cache-tools-save-persistence

Conversation

@Victor-Rodzko

@Victor-Rodzko Victor-Rodzko commented Apr 2, 2026

Copy link
Copy Markdown
Contributor

…-calling completions

ATTENTION: should be merged after #1298

What problem does this PR solve?

There was no test coverage for KV-cache disk persistence in tool-calling completion flows. The race condition fixed in #1298 (gusttav-lang/fix/tool-cache) — where the addon silently rejected cache saves without a cache path and saveResp.await() was not called — could regress without detection.

How does it solve it?

  • Adds kv-cache-tools-sequential-save test: two sequential streaming completions with tools + shared kvCache key
  • Between calls, evicts and reloads the tools model to clear in-memory KV state, forcing the second call to rely solely on the on-disk cache
  • Asserts that cacheTokens increases on the second call — proving the save persisted to disk
  • Without the fix: test deterministically fails (second call cache tokens ≤ first call)
  • With the fix: test passes on both desktop and mobile

How was it tested?

  • Desktop (macOS M4 Pro): confirmed test fails on unfixed branch (secondCacheTokens=304 ≤ firstCacheTokens=316), passes on gusttav-lang/fix/tool-cache (html report attached)
    kv-cache-local-desktop.html
  • Verified on-disk cache directory is empty without the fix, contains .bin file with the fix
  • Full kv-cache suite (16 tests): 15 existing tests unaffected, new test behaves correctly
  • Mobile (iOS): prebuild generated, test runs successfully (html report attached)
    kv-cache-local-ios.html

tobi-legan
tobi-legan previously approved these changes Apr 2, 2026
@github-actions

github-actions Bot commented Apr 2, 2026

Copy link
Copy Markdown
Contributor

Tier-based Approval Status

**PR Tier:** TIER1

**Current Status:** ✅ APPROVED

**Requirements:**
- 1 Team Member approval ✅ (1/1)
- 1 Team Lead OR Management approval ✅ (1/1)



---
*This comment is automatically updated when reviews change.*

@kinsta

kinsta Bot commented Apr 7, 2026

Copy link
Copy Markdown

Preview deployments for qvac-docs-staging ⚡️

Status Branch preview Commit preview
✅ Ready Visit preview Visit preview

Commit: baf03b387640fa7e822ba33831203d549fbd0611

Deployment ID: c77b8913-b59e-4dab-b6dd-a8e0d9f60be9

Static site name: qvac-docs-staging-fazwv

@Victor-Rodzko

Copy link
Copy Markdown
Contributor Author

/review

@Victor-Rodzko Victor-Rodzko merged commit b7ad9ee into main Apr 7, 2026
20 checks passed
@Victor-Rodzko Victor-Rodzko deleted the test/kv-cache-tools-save-persistence branch April 7, 2026 08:42
Proletter pushed a commit that referenced this pull request May 24, 2026
#1319)

* QVAC-16601 test[skiplog]: add kv-cache disk persistence test for tool-calling completions

* QVAC-16601 test[skiplog]: type kv-cache executor handler signatures
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants