responses-third-party-prompt-cache-patch

Patch an installed OpenClaw dist bundle so third-party OpenAI-compatible Responses endpoints keep prompt_cache_key and prompt_cache_retention instead of having them stripped. Use when the user wants a local patch on a machine running OpenClaw, not an upstream refactor or config change, and needs a workflow with dry-run, backup, rollback, syntax validation, and upgrade-aware reapply.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "responses-third-party-prompt-cache-patch" with this command: npx skills add responses-third-party-prompt-cache-patch

Responses Third Party Prompt Cache Patch

Patch the installed OpenClaw dist bundle so shouldStripResponsesPromptCache(model) stops deleting prompt_cache_key and prompt_cache_retention for third-party OpenAI-compatible Responses endpoints.

Source: https://github.com/tsunheimat/openclaw-responses-prompt-cache-patch

Quick install for OpenClaw

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

Risks

  • Write directly into the OpenClaw installation directory under dist/.
  • Require Python 3 and Node.js on the target machine.
  • Need a gateway restart after apply or rollback for the change to take effect.

Quick start

Run from this skill directory:

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

Roll back

python3 scripts/revert_prompt_cache.py
openclaw gateway restart

Target selection

  • Default to the currently installed OpenClaw root by resolving the openclaw executable.
  • Accept --root /path/to/openclaw to patch a copied fixture or a different installation.
  • Scan dist/pi-embedded-*.js first, then fall back to other dist/*.js bundles only if the target function moved.

What the scripts do

scripts/patch_prompt_cache.py

  • Support --dry-run
  • Create timestamped backups before writing
  • Apply a narrow patch only inside shouldStripResponsesPromptCache(model)
  • Run node --check after writing
  • Auto-restore the fresh backup if syntax validation fails
  • Detect already-patched bundles and upgrade-style reapply situations

scripts/revert_prompt_cache.py

  • Restore the latest matching backup for each currently patched bundle
  • Support --dry-run
  • Validate restored files with node --check

Recommended verification flow

  1. Run --dry-run on the real installation.
  2. Copy the target bundle into a fixture and run --root <fixture> for real apply testing.
  3. Run apply again to confirm idempotency.
  4. Run rollback on the same fixture.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

gitlab-mr-reviewer

当需要审核 GitLab 合并请求、检查 MR diff 风险、发布 GitLab 审查评论、执行 approve/request changes,或发送 MR 审查通知时使用。

Registry SourceRecently Updated
1490whrime
General

Voice Transcriber Toolkit

Voice-to-Text Transcription Toolkit - 语音识别转文字,支持Whisper/Vosk引擎,批量处理,字幕导出 | Speech recognition & transcription with Whisper/Vosk engines, batch processing, su...

Registry SourceRecently Updated
General

Gigo Lobster Taster

🦞 GIGO · gigo-lobster-taster: 正式试吃模式:跑完整评测,默认上传云端、生成个人结果页并进入排行榜。 Triggers: 试吃我的龙虾 / 品鉴我的龙虾 / lobster taste / lobster taster.

Registry SourceRecently Updated
General

Gigo Lobster Local

🦞 GIGO · gigo-lobster-local: 本地模式:跑完整评测,但不上云、不注册个人结果页,证书二维码回到官网首页。 Triggers: 本地试吃龙虾 / 离线试吃龙虾 / local lobster taste / offline lobster taste.

Registry SourceRecently Updated