📦 Responses Third-Party Prompt Cache Patch — 技能工具
v0.1.2Patch an installed OpenClaw dist bundle so third-party OpenAI-compatible Responses endpoints keep prompt_cache_key and prompt_cache_retention instead of havi...
0· 82·0 当前·0 累计
安全扫描
OpenClaw
安全
high confidenceThe skill's code and instructions consistently implement a narrow local patch workflow for an OpenClaw dist bundle; it modifies files under dist/, creates backups, validates syntax, and offers rollback — nothing in the files indicates unexpected exfiltration or unrelated capabilities.
评估建议
This skill performs local file edits to your OpenClaw installation and is coherent with its stated purpose, but take these precautions before use: 1) Run the provided --dry-run first and test against a copied fixture (as the SKILL.md recommends). 2) Ensure you have Python 3 and Node.js installed and understand you'll need to restart the OpenClaw gateway. 3) Verify the included code matches the version you expect and inspect the backup files created under dist/ before applying to production. 4) P...详细分析 ▾
ℹ 用途与能力
The skill's name/description match the included scripts: they locate an OpenClaw install, patch a single function in dist/*.js, create backups, validate with node, and support rollback. Minor inconsistency: the registry metadata lists no required binaries, but the SKILL.md and scripts explicitly require Python 3 (to run the scripts) and Node.js (used for node --check); the skill also expects the openclaw CLI and may call systemctl. These are proportionate to the stated purpose but should be declared.
✓ 指令范围
The SKILL.md and scripts are narrowly scoped to locating an OpenClaw installation, reading/writing JS bundles under dist/, making timestamped backups, running node --check, and optionally reading a user systemd service file or resolving the openclaw executable. The scripts do not transmit data externally, execute obfuscated code, or read unrelated secrets.
✓ 安装机制
This is an instruction-only skill (no install spec). The code files are included in the skill bundle; there is no network download or archive extraction during install. No high-risk install mechanism is present.
✓ 凭证需求
The skill requests no environment variables or credentials. It reads local files (dist bundles, optional systemd service file, and resolves the openclaw executable) and writes backups and patched bundles under the target installation — which is consistent with its purpose.
✓ 持久化与权限
The skill does not request permanent or always-on privileges. It runs as an invoked script and only changes files under the specified OpenClaw installation. It does not modify other skills or global agent config.
安全有层次,运行前请审查代码。
运行时依赖
无特殊依赖
版本
latestv0.1.22026/3/31
Add GitHub source link and a one-line OpenClaw quick install command to the skill page.
● 无害
安装命令
点击复制官方npx clawhub@latest install responses-third-party-prompt-cache-patch
镜像加速npx clawhub@latest install responses-third-party-prompt-cache-patch --registry https://cn.longxiaskill.com
技能文档
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
openclawexecutable. - Accept
--root /path/to/openclawto patch a copied fixture or a different installation. - Scan
dist/pi-embedded-.jsfirst, then fall back to otherdist/.jsbundles 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 --checkafter 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
- Run
--dry-runon the real installation. - Copy the target bundle into a fixture and run
--rootfor real apply testing. - Run apply again to confirm idempotency.
- Run rollback on the same fixture.