Responses Third Party Prompt Cache Patch for Openclaw

A specialized utility to prevent OpenClaw from stripping caching headers for third-party OpenAI-compatible API providers.

tsunheimat
v0.1.2
Apr 1, 2026
0
693
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install responses-third-party-prompt-cache-patch

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install responses-third-party-prompt-cache-patch using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Responses Third Party Prompt Cache Patch?

The Responses Third Party Prompt Cache Patch is a technical utility designed for the Openclaw Skills ecosystem. It addresses a specific limitation where the agent strips prompt_cache_key and prompt_cache_retention metadata from third-party API responses. By applying a surgical patch to the OpenClaw distribution bundle, developers can ensure that advanced caching features of alternative LLM providers remain intact.

This tool is essential for users who leverage non-OpenAI endpoints that support these specific caching parameters to reduce latency and costs. It operates as a local patch, providing a workflow that includes dry-runs, automatic backups, and syntax validation to ensure the stability of the agent installation.

Responses Third Party Prompt Cache Patch Use Cases

  • Enabling prompt caching on third-party OpenAI-compatible endpoints to improve performance.
  • Reducing API latency by preserving cache keys in the agent response handling logic.
  • Maintaining custom metadata for cost-tracking and efficiency within Openclaw Skills environments.
  • Local patching of OpenClaw installations without waiting for upstream refactors or configuration changes.

How Responses Third Party Prompt Cache Patch Works

  1. The script locates the OpenClaw installation root by resolving the openclaw executable path or using a provided root flag.
  2. It scans the dist directory for the appropriate JavaScript bundle, prioritizing embedded files.
  3. A timestamped backup of the original bundle is created before any modifications are written.
  4. The patcher applies a narrow modification to the shouldStripResponsesPromptCache function to allow specific metadata retention.
  5. The modified file is validated using node --check to ensure no syntax errors were introduced.
  6. Upon successful validation, the user restarts the gateway to activate the changes across their Openclaw Skills.

Responses Third Party Prompt Cache Patch Setup

To install this skill into your workspace, use the following command:

clawhub install responses-third-party-prompt-cache-patch --workdir ~/.openclaw/workspace

Once installed, navigate to the skill directory and execute the patcher:

python3 scripts/patch_prompt_cache.py --dry-run
python3 scripts/patch_prompt_cache.py
openclaw gateway restart

Responses Third Party Prompt Cache Patch Data Schema & Taxonomy

Component Description
scripts/patch_prompt_cache.py Primary automation script for applying the cache retention patch.
scripts/revert_prompt_cache.py Safety utility to restore the system to its pre-patched state.
Backups Local timestamped copies of the dist bundles stored for recovery.
Target Logic Specific modification of the shouldStripResponsesPromptCache(model) function.

Responses Third Party Prompt Cache Patch Advanced Features

  • Dry-run capability to preview file changes without modifying the actual installation.
  • Integrated rollback system that automatically identifies and restores the latest matching backup.
  • Syntax validation using Node.js to prevent gateway crashes after patching.
  • Upgrade-aware reapplication logic that detects if a bundle needs a fresh patch after an agent update.
  • Support for custom root paths to test patches on fixtures or alternative installations.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*