Repository navigation
fix(core): honor zero prompt cache TTL - #1531
Draft
Solaris-star wants to merge 1 commit into
Draft
Solaris-star wants to merge 1 commit into
Solaris-star wants to merge 1 commit into
Conversation
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
🦋 Changeset detectedLatest commit: 0649c99 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Checklist
Current behavior
A per-prompt
ttl: 0is treated as absent when reading an existing cache entry. Even an entry originally cached with zero TTL can be reused when the next lookup occurs in the same millisecond.New behavior
Honor zero explicitly and expire it immediately. Positive and default TTL behavior, including the existing positive-TTL expiry boundary, is unchanged.
Part of #1493, only its prompt-cache TTL correctness item. This does not close the broader issue or change MCP authentication, sandboxing, logging, or cache-key selection. #1522 excludes this item; #1521 concerns cache keys.
Validation
OTEL_TRACES_SAMPLER=always_on: 1,407 passed, 2 skipped, 1 todo across 111 files; type tests passed. The clean base under the same condition passed 1,400 tests, with the same 2 skips and 1 todo.parentbased_traceidratiowith ratio0.01. Its first core runs failed the same 16 named observability tests on both base and fixed code. Those results are retained; no global or production sampling setting was changed.publint --strictpassed. Biome reported 5 existing complexity warnings; publint reported 2 suggestions.Environment: Linux, Node 24.22.1, pnpm 8.10.5, frozen repository lockfile. Dependency setup completed with optional native-build warnings; unrelated browser and CUDA downloads were skipped using their supported settings. No dependency or lockfile changes are included.
No live VoltOps/model calls, full-monorepo build/test, or Node 20/22 matrix was performed. The seven new cases are included in the larger totals above, not additive. Draft CI is configured upstream to skip its jobs, so local validation is not remote-CI success.
Notes for reviewers
Prepared, tested, and independently reviewed with OpenAI Codex assistance. No prior human or maintainer approval is claimed. The patch is limited to TTL handling, seven regressions, and its changeset.
Summary by cubic
Honors a prompt cache TTL of zero so cached prompts expire immediately. Previously
ttl: 0was treated as absent, letting an entry cached with zero TTL be reused; now it expires even when the next lookup happens in the same millisecond. Positive and default TTL behavior are unchanged. This addresses only the prompt-cache TTL correctness item in #1493; MCP authentication, sandboxing, logging, and cache-key selection (#1521, #1522) are untouched.Tests
Written for commit 0649c99. Summary will update on new commits.