Skip to content

[NET-1367] feat: Add support for capturing cache-write tokens in OpenAI #116

Open
akash-vijay-kv wants to merge 6 commits into
devfrom
feat/openai-cache-write-tokens
Open

[NET-1367] feat: Add support for capturing cache-write tokens in OpenAI #116
akash-vijay-kv wants to merge 6 commits into
devfrom
feat/openai-cache-write-tokens

Conversation

@akash-vijay-kv

Copy link
Copy Markdown
Collaborator

Changes

  • feat: Changes how Netra handles spans from auto-instrumentation libraries not in the root_instruments allow-list, moving from a "drop the whole subtree" strategy (v1) to a "drop-and-reparent" strategy (v2).

JIRA

https://getnetra.atlassian.net/browse/NET-1367

AkhileshNair2201 and others added 6 commits July 14, 2026 10:38
* 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>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
* 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>
* 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