Skip to content

NET-1329 simplify cache TTL to module const and per-call override#112

Merged
AkhileshNair2201 merged 3 commits into
feat/sdk-cachingfrom
NET-1329-simplify-cache-ttl
Jul 13, 2026
Merged

NET-1329 simplify cache TTL to module const and per-call override#112
AkhileshNair2201 merged 3 commits into
feat/sdk-cachingfrom
NET-1329-simplify-cache-ttl

Conversation

@AkhileshNair2201

@AkhileshNair2201 AkhileshNair2201 commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

TICKET (https://getnetra.atlassian.net/browse/NET-1329)

Summary

  • Drop cacheTtlSeconds init config and NETRA_CACHE_TTL_SECONDS env — they were unused; callers only ever hit the default.
  • Prompts now use module constant PROMPT_CACHE_TTL_SECONDS (60); override only via per-call cacheTtl (same pattern as models’ MODEL_PRICING_CACHE_TTL_SECONDS).
  • Update README and CHANGELOG to match.

Why

Init/env TTL added config surface without real usage. Aligning prompts with the Phase 2 models pattern keeps one clear rule: module default + per-call override.

Test plan

  • vitest prompts/models/shutdown/cache suites
  • Confirm no callers rely on cacheTtlSeconds / NETRA_CACHE_TTL_SECONDS

Made with Cursor

AkhileshNair2201 and others added 3 commits July 10, 2026 18:57
Co-authored-by: Cursor <cursoragent@cursor.com>
…/netra-sdk-js into NET-1329-simplify-cache-ttl
Assert PROMPT_CACHE_TTL_SECONDS expiry when cacheTtl is omitted, and stop passing the removed Config option in models client tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
akash-vijay-kv
akash-vijay-kv approved these changes Jul 10, 2026
@AkhileshNair2201 AkhileshNair2201 merged commit cc2578f into feat/sdk-caching Jul 13, 2026
AkhileshNair2201 added a commit that referenced this pull request Jul 13, 2026
* feat: add opt-in TTL caching for getPrompt

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix: downgrade vitest for Node 18 and tighten cache tests

Use Vitest 3.x so dev test runs align with engines.node >=18, and add
getPrompt cacheTtl integration coverage plus shutdown re-init behavior.

Co-authored-by: Cursor <cursoragent@cursor.com>

* feat(models): add getModelPricing with opt-in TTL cache

* test(models): cover getModelPricing HTTP client failure paths

Co-authored-by: Cursor <cursoragent@cursor.com>

* NET-1329 simplify cache TTL to module const and per-call override (#112)

* NET-1329 simplify cache TTL to module const and per-call override

Co-authored-by: Cursor <cursoragent@cursor.com>

* test: cover prompt default TTL and drop removed cacheTtlSeconds

Assert PROMPT_CACHE_TTL_SECONDS expiry when cacheTtl is omitted, and stop passing the removed Config option in models client tests.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>

* docs: document Models API and expand caching changelog

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants