Skip to content

⏲️ fix: Preserve Responses Cache Write TTL Usage - #673

Merged
danny-avila merged 2 commits into
mainfrom
lia/responses-cache-ttl-usage
Nov 10, 2026
Merged

danny-avila merged 2 commits into
mainfrom
lia/responses-cache-ttl-usage

Conversation

@lia-by-librechat

@lia-by-librechat lia-by-librechat Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Preserve Responses cache-write TTL subsets as cache_creation_12h and cache_creation_30m in normalized usage.
  • Keep aggregate cache creation and token totals unchanged, retain user metadata, and remove internal bridge keys.
  • Restore custom TTL details after chunk concatenation so final messages and handleLLMEnd callbacks agree.
  • At the Langfuse boundary, keep the aggregate cache bucket without overlapping TTL subsets. Public usage retains its TTL details; uncached input is no longer subtracted twice.

Verification

  • npx tsc --noEmit: passed.
  • Touched-file ESLint and import-order checks: passed.
  • Cache usage, summarization usage, stream metadata, provider smoke, Langfuse, masking, and deterministic trace ID tests: 332 passed across 17 suites.
  • npm run build: passed, including declaration generation.

No version bump or release. Cyber integration remains blocked until a maintainer publishes the required dependency.

Title emoji: no ⏲️ occurrences across 1,915 agents main commit subjects.

@lia-by-librechat

Copy link
Copy Markdown
Contributor Author

Verified head: 882b144c20b099e0ade0e462304f216a6710d740.

Normalized usage exposes input_token_details.cache_creation_12h and cache_creation_30m. OpenAI and Azure mock-fetch invocation tests cover final messages and actual handleLLMEnd callbacks for streaming and non-streaming calls, explicit streams, callback-preferred streaming, zero counts, and missing optional usage. TTL subsets do not change aggregate cache creation or token totals.

Local checks passed: npx tsc --noEmit; touched-file ESLint and import-order checks; npm run build including declarations; 115 focused tests; 205 tracing tests. Prettier applied to changed code, with unrelated baseline formatting preserved.

Not run locally: full library suite or live-provider API suites. Independent review is being coordinated by the parent task. CI status will be reported separately.

No version bump, merge, publish, or release.

@danny-avila

Copy link
Copy Markdown
Collaborator

@codex review the latest head, final review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-10T17:35:49.685610Z 882b144 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: 882b144c20

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@lia-by-librechat

Copy link
Copy Markdown
Contributor Author

Head: 176b34408e66956142070b07e9cce716cbe4d82c. Fixes review finding SDK-1 (P2): Langfuse now receives disjoint cache usage without changing public TTL details or the source messages. Regression tests exercise actual Langfuse callbacks for messages/chunks, partial/zero TTLs and masked generations. All 332 focused SDK/tracing tests, tsc --noEmit, scoped ESLint/import checks and the declaration build pass. A fresh independent review is running for this exact head. No SDK version bump or release.

@lia-by-librechat

Copy link
Copy Markdown
Contributor Author

Independent review completed for 176b34408e66956142070b07e9cce716cbe4d82c: no findings. SDK-1 (P2, overlapping Langfuse TTL buckets) is confirmed fixed. Public TTL details are preserved while the export boundary avoids double counting. Local verification: 332 focused tests, typecheck, scoped lint/import checks and declaration build passed. No version bump or release was performed.

@danny-avila
danny-avila merged commit fb655b1 into main Nov 10, 2026
13 checks passed
@lia-by-librechat lia-by-librechat Bot mentioned this pull request Nov 10, 2026
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