Skip to content

Low prompt-cache hit rate with Sign in with ChatGPT; stable <code>session_id</code> header restores caching</p> #119

Backlog

Description

@Pozselm

Description

Droid’s native Sign in with ChatGPT integration shows inconsistent prompt-cache reuse during conversations. Normal sessions often average around 50%, and controlled tests produced consecutive requests with zero cached input.

Adding only a stable, conversation-specific session_id HTTP header restored consistent cache reuse.

Version and configuration

  • Droid: 1.21.1
  • Model: gpt-6.1-sol
  • Reasoning effort: low
  • Authentication: native Sign in with ChatGPT, using ChatGPT subscription access
  • Transport: streaming Responses API
  • Reproduced in two independent environments

Steps to reproduce

  1. Select gpt-6.1-sol through the native ChatGPT integration.

  2. Start a conversation with several thousand input tokens.

  3. Have Droid perform several sequential, deterministic read-only tool calls, using different arguments to avoid triggering loop detection.

  4. Capture outgoing request headers and bodies, along with upstream response usage.

  5. Repeat while adding only:

    session_id: <stable ID for this conversation>
    
  6. Compare cached_tokens / input_tokens, excluding the first cold request when assessing warmed performance.

Observed behavior

Without the header:

  • The request body contains a stable prompt_cache_key.
  • The session_id HTTP header is absent.
  • Responses return a different effective prompt_cache_key for each request.
  • The authentication token and tool definitions remain unchanged.
  • Existing input items remain an exact prefix of subsequent requests; conversation history only grows by appending items.

With the header:

  • The returned cache key remains stable and matches the supplied header.
  • Warmed requests consistently reuse cached input.

Controlled results

Test Original requests With stable header, after warm-up
A 6 consecutive requests: 0% 5 requests: 96.77% weighted hit rate
B 5 consecutive requests: 0% 4 requests: 96.63% weighted hit rate

Removing the header again in Test A caused the next request to return to 0%.

These figures use upstream usage counters. Occasional cache hits also occurred without the header; the problem is unreliable reuse rather than every request missing.

Expected behavior

The native ChatGPT integration should automatically provide the session information required for reliable cache reuse:

  • Keep session_id stable across tool calls, subsequent turns, and session resume.
  • Use a distinct value for each new conversation.
  • Preserve native ChatGPT subscription authentication.

Request

Could the team confirm whether the missing header is intentional and investigate adding it to the native ChatGPT request transport? Is there an existing supported configuration for this behavior?

Sanitized request/response evidence can be provided. This report omits account identifiers, credentials, actual session IDs, machine details, and local paths.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions