fix(openai): preserve managed request metadata - #306
Conversation
|
Marked ready for review as the small follow-up to It fixes provider-tier metadata and cache-breakpoint retention needed by LibreChat model support, independently of native PTC. Because the Agents CI is scoped to PRs targeting |
e1d4ea6 to
4826739
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4826739647
ℹ️ 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".
4826739 to
05f80e3
Compare
|
Follow-up update: this branch is now rebased directly onto current main (v3.2.65). The valid cache-breakpoint rollover review finding is fixed, with an exact regression test, and I replied on the inline thread. Local validation on the rebased single-commit head: 59 focused tests, TypeScript, ESLint for the changed files, and the full Agents build all pass. |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 05f80e379f
ℹ️ 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".
05f80e3 to
b399e88
Compare
|
Addressed the latest review in b399e88 after rebasing onto main v3.2.67. Cache-breakpoint selection now exits as soon as it has the two newest assistant/tool completion candidates. Added a long-history regression confirming the selected breakpoints. Validation: focused tests, TypeScript, targeted ESLint, and the full production build all pass. |
b399e88 to
e117c9b
Compare
e117c9b to
30aa46b
Compare
30aa46b to
bb47b86
Compare
bb47b86 to
b5007fe
Compare
|
Rebased this focused follow-up onto current Agents main (v3.7.1). The patch is unchanged in substance and remains cleanly mergeable. Revalidated: 71 focused tests, TypeScript, production build, changed-file ESLint, and diff whitespace checks all pass. |
Summary
Preserve the managed OpenAI request metadata that LibreChat needs for reliable explicit caching and tier-aware accounting.
service_tieron non-streaming Chat Completions messages.Why
Live sequential-request testing showed that replacing the prior history marker on every turn could produce another cache write instead of a cache read. LibreChat's generated prompt cache key also needed to be represented in the shared managed-request options so it reaches all four OpenAI/Azure transport paths. Non-streaming Chat Completions dropped the response-level service tier during LangChain conversion, forcing downstream accounting to infer the requested tier instead of using the provider-reported tier.
Change Type
Testing
npx jest src/llm/openai/managedRequests.test.ts src/llm/openai/llm.spec.ts --runInBand— 71 tests passed.npx tsc --noEmit— passed.npm run build— passed.git diff --check— passed.Test Configuration
mainat v3.7.1.Checklist