Skip to content

feat(issue-120): improve session prompt dedupe and cache hits#379

Open
zzp1221 wants to merge 4 commits into
TencentCloud:mainfrom
zzp1221:codex/issue-120-prompt-cache-prep
Open

feat(issue-120): improve session prompt dedupe and cache hits#379
zzp1221 wants to merge 4 commits into
TencentCloud:mainfrom
zzp1221:codex/issue-120-prompt-cache-prep

Conversation

@zzp1221

@zzp1221 zzp1221 commented Jul 3, 2026

Copy link
Copy Markdown

Description | 描述

本 PR 针对 Issue #120,优化 memory 注入导致的 prompt cache 波动,并补充 session 级稳定系统提示去重研究与诊断能力。

主要改动:

Related Issue | 关联 Issue

Fix #120

Change Type | 修改类型

  • Bug fix | Bug 修复
  • New feature | 新功能
  • Documentation update | 文档更新
  • Code optimization | 代码优化

Self-test Checklist | 自测清单

  • Verified locally | 本地验证通过
  • No existing features affected | 无影响现有功能

Additional Notes | 其他说明

已完成验证:

  • npx.cmd vitest run
  • npm.cmd run build:plugin
  • node tmp/session-system-prompt-cache-probe.mjs

真实 provider 探针结果:

  • DeepSeek:去重追加 相比 重复追加,prompt tokens 下降 57.36%,cache miss tokens 下降 99.24%。
  • Mimo:去重追加 相比 重复追加,prompt tokens 下降 56.93%,cache miss tokens 下降 93.45%。

说明:

本 PR 没有在插件侧做不安全的跨轮 appendSystemContext 省略。真正的跨轮系统提示去重应在 OpenClaw host 侧实现,并且需要
host 支持 session 持久系统提示语义。

@zzp1221 zzp1221 force-pushed the codex/issue-120-prompt-cache-prep branch from 34fea32 to 84a86ad Compare July 3, 2026 03:37
@zzp1221 zzp1221 changed the title Codex/issue 120 prompt cache prep feat(issue-120): improve session prompt dedupe and cache hits Jul 3, 2026
@Maxwell-Code07

Copy link
Copy Markdown
Collaborator

Thank you for your contribution and interest! We will schedule an internal review of your code and get back to you soon.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

prependContext + showInjected 导致 OpenAI-compatible provider 前缀缓存命中率退化 / Prompt cache hit rate regression

2 participants