Skip to content

interactive shell sends prompt_cache_key on chat-completions endpoints but zero exec doesn't #624

Closed

Description

@cjgeremillo4638pam-oss

Version / branch / commit

zero 0.3.0 (installed via npm install -g @gitlawb/zero)

OS and environment

Windows 10/11, Command Prompt (cmd.exe) Provider: custom openai-compatible endpoint (NVIDIA NIM, https://integrate.api.nvidia.com/v1) apiFormat: chat-completions Model: minimaxai/minimax-m2.7

Steps to reproduce

  1. Run zero setup, select "Custom OpenAI-compatible" (or the "NVIDIA NIM" preset),
    set baseURL to https://integrate.api.nvidia.com/v1, paste a valid NVIDIA NIM API key,
    set model to minimaxai/minimax-m2.7
  2. Confirm setup is valid: zero doctor reports provider.config and provider.connectivity as pass
  3. Launch the interactive TUI: zero
  4. Send any prompt (e.g. "hello")
  5. Observe error: "provider request error: Validation: Unsupported parameter(s): prompt_cache_key"

For comparison:
6. Run the same prompt via headless mode instead: zero exec -p "hello"
7. This succeeds and returns a normal response

Expected behavior

The interactive TUI should return a response just like zero exec does, since both use the same
provider config and the endpoint doesn't support prompt_cache_key. Ideally the client should
either omit prompt_cache_key for openai-compatible providers that don't advertise support for it,
or expose a config flag to disable it per-provider.

Actual behavior

The interactive TUI fails every request with:
provider request error: Validation: Unsupported parameter(s): prompt_cache_key

zero exec with an identical provider/model config works correctly and returns valid completions,
indicating the interactive shell's request path adds a parameter that the one-shot exec path does not.

Relevant logs, screenshots, or error messages

provider request error: Validation: Unsupported parameter(s): prompt_cache_key

(zero doctor output, redacted — attach if helpful, e.g.:)
[pass] provider.config - Provider config loaded for nvidia-nim.
baseURL: https://integrate.api.nvidia.com/v1 | credentialConfigured: set | model: minimaxai/minimax-m2.7 | name: nvidia-nim | provider: openai-compatible
[pass] provider.connectivity - Provider endpoint reachable (200).
endpoint: https://integrate.api.nvidia.com/v1/models | statusCode: 200

Image Image

Activity

  1. added
    bug
    on Jul 9, 2026
  2. PierrunoYT commented on Jul 9, 2026

    @PierrunoYT
    Contributor

    Working on it!

  3. CengSin commented on Jul 10, 2026

    @CengSin
    Contributor

    Set the environment variable export ZERO_DISABLE_PROMPT_CACHE_KEY=1, then relaunch the interactive shell.

    Image
  4. gnanam1990 commented on Jul 10, 2026

    @gnanam1990
    Collaborator

    Fix PR opened

    A fix is up in: #636

    Root cause

    • Interactive TUI always creates a session and sets PromptCacheKey from the session ID.
    • The OpenAI-compatible chat-completions transport then serializes prompt_cache_key.
    • Strict gateways (NVIDIA NIM, etc.) reject unknown fields; plain zero exec usually has no session ID so it never sent the field — which is why exec worked and the TUI failed.

    Fix

    • Omit prompt_cache_key for provider_kind: openai-compatible.
    • Keep it for official OpenAI so multi-turn prefix-cache routing still works.
    • Existing workaround still works: ZERO_DISABLE_PROMPT_CACHE_KEY=1.

    Local workaround until this ships

    export ZERO_DISABLE_PROMPT_CACHE_KEY=1

    Then relaunch the interactive shell.

    Thanks for the clear repro and exec vs TUI comparison — that made the session-ID path difference obvious.

  5. added a commit that references this issue on Jul 10, 2026
    1af5882
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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions