Skip to content

Add explicit Responses API prompt caching - #336967

Merged
Dileep Yavanmandha (dileepyavan) merged 6 commits into
mainfrom
DileepY/promptCaching_updated
Sep 21, 2026
Merged

Dileep Yavanmandha (dileepyavan) merged 6 commits into
mainfrom
DileepY/promptCaching_updated

Conversation

@dileepyavan

@dileepyavan Dileep Yavanmandha (dileepyavan) commented Sep 21, 2026 •

Copy link
Copy Markdown
Member

Summary

  • add explicit prompt cache breakpoint placement for supported Responses API models
  • retain two stable prefix anchors and the latest 20 conversation boundaries
  • support GPT-5.6 variants and GPT-6 models, including GPT-6 Astra
  • enable explicit prompt caching by default for supported models

Testing

  • npm run test:unit -- src/extension/intents/node/test/cacheBreakpoints.spec.ts src/platform/endpoint/node/test/responsesApi.spec.ts
  • 85 tests passed

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings September 21, 2026 04:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Continuation renders can misclassify and eventually discard the global-context prefix anchor.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Adds explicit prompt-cache breakpoint placement for supported Responses API models.

Changes:

  • Retains two stable prefix anchors and the latest 20 conversation boundaries.
  • Prevents cache markers from mutating opaque content.
  • Expands unit and integration coverage.
File Description
extensions/​copilot/​src/​platform/​endpoint/​node/​test/​responsesApi.spec.ts Tests opaque-content isolation.
extensions/​copilot/​src/​platform/​endpoint/​node/​responsesApi.ts Clones opaque content before annotation.
extensions/​copilot/​src/​platform/​configuration/​common/​configurationService.ts Clarifies the experimental setting.
extensions/​copilot/​src/​extension/​prompts/​node/​agent/​test/​agentPrompt.spec.tsx Tests rendered-history boundaries.
extensions/​copilot/​src/​extension/​intents/​node/​test/​cacheBreakpoints.spec.ts Covers breakpoint placement and serialization.
extensions/​copilot/​src/​extension/​intents/​node/​cacheBreakpoints.ts Implements bounded Responses cache anchors.
extensions/​copilot/​package.nls.json Updates the user-facing setting description.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +116 to +120
while (messages[leadingEnd]?.role === Raw.ChatRole.System || messages[leadingEnd]?.role === Raw.ChatRole.User) {
if (messages[leadingEnd].role === Raw.ChatRole.User) {
firstConversationIndex = leadingEnd;
}
leadingEnd++;
@github-actions

github-actions Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Screenshot Changes

Base: c0f6c8cd Current: 6341842a

Changed (1)

sessions/connectionDiagnostics/connectionDiagnostics/MobileDismissedDiscovery/Light
Before After
before after

3 insignificant change(s) omitted (≤20 px, Δ≤2). See CI logs for details.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dileepyavan
Dileep Yavanmandha (dileepyavan) merged commit 70365f1 into main Sep 21, 2026
34 checks passed
@dileepyavan
Dileep Yavanmandha (dileepyavan) deleted the DileepY/promptCaching_updated branch September 21, 2026 07:07
@vs-code-engineering vs-code-engineering Bot added this to the 1.140.0 milestone Sep 21, 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.

3 participants