Skip to content

fix: preserve OpenAI OAuth prompt cache affinity#3800

Open
2314860760 wants to merge 1 commit into
chatboxai:mainfrom
2314860760:fix/openai-oauth-prompt-cache-key
Open

fix: preserve OpenAI OAuth prompt cache affinity#3800
2314860760 wants to merge 1 commit into
chatboxai:mainfrom
2314860760:fix/openai-oauth-prompt-cache-key

Conversation

@2314860760

@2314860760 2314860760 commented Jul 19, 2026

Copy link
Copy Markdown

Description

OpenAI OAuth requests use stateless Responses API calls and already carry the Chatbox session ID through the chat orchestration layer. However, the session ID was not propagated to OpenAI's prompt_cache_key option, so consecutive requests could lose prompt-cache affinity.

This change:

  • Uses the existing session ID as promptCacheKey for stateless OAuth Responses requests.
  • Preserves store: false for OAuth requests.
  • Avoids changing behavior for regular API-key Responses providers.
  • Adds regression tests for session and missing-session cases.

Testing

  • Targeted Vitest tests passed (4/4)
  • Biome check passed
  • TypeScript check passed
  • Electron production build passed
  • git diff --check passed

The full local suite also exposed unrelated environment-specific failures in Electron dependency installation and one Windows path-separator assertion; no failures were caused by the changed files.

Additional Notes

This uses the official OpenAI Responses API prompt_cache_key provider option and does not modify OAuth endpoints, token handling, or authentication behavior.

Contributor Agreement

By submitting this Pull Request, I confirm that I have read and agree to the contribution terms in the repository's PR template.

  • I have read and agree with the above statement.

@coderabbitai

coderabbitai Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 2c2dc80a-7d04-4f94-ac24-f01482b9aaa8

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

1 participant