lingshu-skill 5.46.0 → 5.48.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +32 -0
- package/README.md +1 -1
- package/SKILL-lite.md +1 -1
- package/SKILL-tiny.md +1 -1
- package/SKILL.md +1 -1
- package/cordis-plugin/lingshu-startup/plugin.js +42 -3
- package/cordis-plugin/lingshu-startup/resilience.js +64 -0
- package/cordis-plugin/lingshu-startup/time-context-fold.js +98 -0
- package/package.json +1 -1
- package/scripts/astrbot_plugin_lingshu/CHECKSUMS.json +5 -5
- package/scripts/astrbot_plugin_lingshu/engine/CHANGELOG.md +32 -0
- package/scripts/astrbot_plugin_lingshu/engine/README.md +1 -1
- package/scripts/astrbot_plugin_lingshu/engine/SKILL-lite.md +1 -1
- package/scripts/astrbot_plugin_lingshu/engine/SKILL-tiny.md +1 -1
- package/scripts/astrbot_plugin_lingshu/engine/SKILL.md +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,37 @@
|
|
|
1
1
|
# 更新日志
|
|
2
2
|
|
|
3
|
+
## v5.48(2026-12-03)
|
|
4
|
+
|
|
5
|
+
### 🛡️ RESILIENCE:lingshu-startup 插件健壮性双引擎
|
|
6
|
+
|
|
7
|
+
#### prior 连续失败退避(借鉴 SPEED-3 自适应降级 + mem0 服务健康探针)
|
|
8
|
+
- prior 每轮首个 pre-step 都 spawn brain.py 子进程查开工前查——宿主高负载/Python 异常时连续超时,每次白付 6s 等待还拖慢请求。
|
|
9
|
+
- 连续 3 次失败 → 自动退避 10 分钟静默跳过;成功即清零计数。请求关键路径不再被坏环境拖死。
|
|
10
|
+
|
|
11
|
+
#### context-pressure 采样节流(借鉴 zep 增量更新)
|
|
12
|
+
- sampleContextPressure 原先每步都读 tokenMeter+写盘;对话密集时 1s 数次写盘纯属浪费。
|
|
13
|
+
- 节流到 30s 一次(按 agent 独立),压力读数对水位判断足够新鲜;Map 防无限增长。
|
|
14
|
+
|
|
15
|
+
#### 调研结论
|
|
16
|
+
- Cordis 插件生态(Koishi 4000+ 插件背书)的核心模式:钩子内绝不冒泡、子进程调用必须有退避、高频 IO 必须节流——本版三项全部对齐。
|
|
17
|
+
- 腾讯 Hy-Memory 2.0(聊天/工作/代码三类记忆)与灵枢分层设计同构,验证了方向;其 benchmark 框架可后续借鉴做召回质量回归。
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## v5.47(2026-12-03)
|
|
22
|
+
|
|
23
|
+
### ⏱️ TIME-CTX:历史时间戳归并(对话上下文瘦身)
|
|
24
|
+
|
|
25
|
+
**问题**(本会话实测):DSH ��主每轮注入一条 ime-context 时间戳消息(~200-400 字符),本会话已积累 128 条 ≈ 数千 token 死重。两个代价:①token 浪费——历史轮次的精确采样时间几乎从不被引用;②**KV 前缀缓存失效**——逐条不同的时间戳打断前缀缓存,每轮请求实际计费输入变长。
|
|
26
|
+
|
|
27
|
+
**方案**(对标 prompt caching 最佳实践:动态时间数据集中放末尾或省略,历史保持字节级稳定):
|
|
28
|
+
- 新增 cordis-plugin/lingshu-startup/time-context-fold.js:pre-step 阶段把「非最近 2 轮」的 time-context 消息归并成一条占位(只保留首末时间)。
|
|
29
|
+
- 保守防线:currentTurn 未知/消息归属不明时**不折叠**(宁可留着也不误删);time-context 是纯文本 user 消息,无 tool-call 悬挂风险。
|
|
30
|
+
- imeCtxFold 配置键(默认开)。
|
|
31
|
+
- 单元测试 3/3(历史归并+最近保留、零改动路径、未知轮保守跳过)。
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
3
35
|
## v5.46(2026-12-03)
|
|
4
36
|
|
|
5
37
|
### 🔍 隐藏性问题深扫修复(6 项)
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> 名字取自《黄帝内经》:**算力给思考,人格给灵魂,记忆给生命。**
|
|
4
4
|
|
|
5
|
-
> 当前版本 **v5.
|
|
5
|
+
> 当前版本 **v5.48**(变更见 [CHANGELOG.md](CHANGELOG.md))
|
|
6
6
|
|
|
7
7
|
> 🔁 **双仓库镜像**:GitHub(主)与 Gitee(镜像)保持同步——[gitee.com/htmcwy_0/lingshu-skill](https://gitee.com/htmcwy_0/lingshu-skill)。灵枢的更新检查会探测两边最新提交,**谁更新就自动从谁拉取**;任一边不可达(Gitee 匿名风控 / GitHub 限额)时走另一边兜底。
|
|
8
8
|
|
package/SKILL-lite.md
CHANGED
package/SKILL-tiny.md
CHANGED
package/SKILL.md
CHANGED
|
@@ -27,6 +27,8 @@ import { createHash, randomUUID } from 'node:crypto'
|
|
|
27
27
|
import { fileURLToPath } from 'node:url'
|
|
28
28
|
import { sampleContextPressure } from './context-pressure.js'
|
|
29
29
|
import { applyFolds } from './context-fold.js'
|
|
30
|
+
import { foldTimeContext } from './time-context-fold.js'
|
|
31
|
+
import { createPriorBackoff, createPressureThrottle } from './resilience.js'
|
|
30
32
|
|
|
31
33
|
// 刻意零外部依赖:不 import @deepseek-ai/schemastery。原因——link: 安装时模块
|
|
32
34
|
// 真实路径留在技能目录,Node 从那里向上找 node_modules 一路到盘符根都找不到
|
|
@@ -84,6 +86,10 @@ const DEFAULTS = {
|
|
|
84
86
|
// 整轮替换成摘要。默认关闭:它改的是每条请求的消息列表,先让人确认再开。
|
|
85
87
|
contextFold: false,
|
|
86
88
|
contextFoldMaxChars: 1600, // 单条折叠摘要落进上下文的字符上限
|
|
89
|
+
// —— TIME-CTX(v5.47)历史时间戳归并(默认开)——
|
|
90
|
+
// DSH 每轮注入的 time-context 消息在历史里无引用价值且打断 KV 缓存;
|
|
91
|
+
// 归并成一条占位(保留首末时间),最近 2 轮保留原样。
|
|
92
|
+
timeCtxFold: true,
|
|
87
93
|
}
|
|
88
94
|
|
|
89
95
|
/** 合并用户配置与默认值(用户值非空/存在才覆盖) */
|
|
@@ -327,6 +333,9 @@ export function apply(ctx, config) {
|
|
|
327
333
|
const priorDigests = new Map()
|
|
328
334
|
// #45:digest -> 上次查询时间(毫秒)
|
|
329
335
|
let priorCooldown = new Map()
|
|
336
|
+
// RESILIENCE(v5.48):prior 连续失败退避 + 压力采样节流器
|
|
337
|
+
const priorBackoff = createPriorBackoff()
|
|
338
|
+
const pressureThrottle = createPressureThrottle()
|
|
330
339
|
// 配置类失败只告警一次:静默吞掉配置错误会让插件"看似在工作、实际没注入"
|
|
331
340
|
let warnedOnce = false
|
|
332
341
|
|
|
@@ -411,9 +420,14 @@ export function apply(ctx, config) {
|
|
|
411
420
|
// v3.86:每轮请求前采一次 DSH 的准确 token 压力(ctx.tokenMeter),
|
|
412
421
|
// 写 HOME/.context-pressure.json 给 brain.py 读。必须在决策之后也不影响
|
|
413
422
|
// 注入语义;采集器自身吞掉所有异常,绝不让 pre-step 冒泡。
|
|
423
|
+
// RESILIENCE(v5.48):节流到 30s 一次——密集对话下每步都读 tokenMeter+写盘
|
|
424
|
+
// 纯属浪费,30s 的压力读数对水位判断足够新鲜(借鉴 zep 增量更新)。
|
|
414
425
|
try {
|
|
415
426
|
const { agent: pa } = payload || {}
|
|
416
|
-
if (pa)
|
|
427
|
+
if (pa) {
|
|
428
|
+
const key = pa.id || pa.name || 'default'
|
|
429
|
+
if (pressureThrottle.shouldSample(key)) sampleContextPressure(ctx, pa)
|
|
430
|
+
}
|
|
417
431
|
} catch { /* 采集失败不影响请求/注入 */ }
|
|
418
432
|
if (!decision || decision.kind !== 'enter') return decision
|
|
419
433
|
const { agent } = payload || {}
|
|
@@ -427,6 +441,21 @@ export function apply(ctx, config) {
|
|
|
427
441
|
}
|
|
428
442
|
} catch { /* 折叠失败照常发请求 */ }
|
|
429
443
|
}
|
|
444
|
+
// TIME-CTX(v5.47):把历史轮次的 time-context 时间戳消息归并成一条占位。
|
|
445
|
+
// 每轮一条 ~200-400 字符的时间戳,长会话积到 100+ 条 = 数千 token 死重,
|
|
446
|
+
// 且逐条不同的时间戳打断 KV 前缀缓存。默认开(timeCtxFold !== false)。
|
|
447
|
+
if (cfg.timeCtxFold !== false) {
|
|
448
|
+
try {
|
|
449
|
+
const _curTurn = decision?.messages?.reduce((mx, m) => {
|
|
450
|
+
const t = m?.data?.turn ?? m?.turn
|
|
451
|
+
return typeof t === 'number' && t > mx ? t : mx
|
|
452
|
+
}, 0) || undefined
|
|
453
|
+
const r = foldTimeContext(decision, _curTurn)
|
|
454
|
+
if (r && r.changed) {
|
|
455
|
+
try { ctx.logger?.debug?.(`[lingshu-startup] 归并历史时间戳 ${r.folded} 条(省 ${r.savedChars || 0} 字符)`) } catch {}
|
|
456
|
+
}
|
|
457
|
+
} catch { /* 失败照常发请求 */ }
|
|
458
|
+
}
|
|
430
459
|
const extra = []
|
|
431
460
|
// ① 启动注入(每次会话一次)
|
|
432
461
|
const text = agent && pending.get(agent)
|
|
@@ -436,8 +465,13 @@ export function apply(ctx, config) {
|
|
|
436
465
|
}
|
|
437
466
|
// ② 开工前查(P9 #61):每轮首个 pre-step 抽用户消息 → prior → 命中才注入。
|
|
438
467
|
// 同一条消息只查一次(digest 去重);查不到就不注入,避免白占上下文。
|
|
468
|
+
// RESILIENCE(v5.48):prior 连续失败退避——宿主高负载/Python 异常时子进程
|
|
469
|
+
// 连续超时,每次白付 6s 还拖慢请求;连续 3 次失败退避 10 分钟静默跳过。
|
|
439
470
|
if (cfg.priorAuto && agent) {
|
|
440
471
|
try {
|
|
472
|
+
if (priorBackoff.blocked()) {
|
|
473
|
+
try { ctx.logger?.debug?.('[lingshu-startup] prior 退避窗口内,跳过') } catch {}
|
|
474
|
+
} else {
|
|
441
475
|
const userText = lastUserText(decision.messages)
|
|
442
476
|
if (looksLikeTask(userText, cfg.priorMinChars)) {
|
|
443
477
|
const dig = createHash('sha256').update(userText).digest('hex').slice(0, 16)
|
|
@@ -471,10 +505,15 @@ export function apply(ctx, config) {
|
|
|
471
505
|
? await runPrior(pythonExe, cfg.python, brainPy, userText,
|
|
472
506
|
cfg.priorBudget, cfg.priorTimeoutMs)
|
|
473
507
|
: null
|
|
474
|
-
if (block) extra.push(block)
|
|
508
|
+
if (block) { extra.push(block); priorBackoff.success() }
|
|
509
|
+
else if (brainPy) priorBackoff.fail() // 跑了但没产出 = 视为一次失败信号
|
|
475
510
|
}
|
|
476
511
|
}
|
|
477
|
-
|
|
512
|
+
} // end else (prior backoff 未阻塞)
|
|
513
|
+
} catch (e) {
|
|
514
|
+
priorBackoff.fail() // 异常也算失败信号(含子进程超时)
|
|
515
|
+
try { ctx.logger?.debug?.('[lingshu-startup] prior 失败计入退避', e) } catch {}
|
|
516
|
+
}
|
|
478
517
|
}
|
|
479
518
|
if (!extra.length) return decision
|
|
480
519
|
return {
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PRIOR-BACKOFF + PRESSURE-THROTTLE(v5.48):lingshu-startup 插件的两项健壮性改进。
|
|
3
|
+
*
|
|
4
|
+
* 1. prior 连续失败退避(借鉴 SPEED-3 dense 自适应降级 + mem0 服务健康探针模式):
|
|
5
|
+
* prior 每轮首个 pre-step 都会 spawn brain.py 子进程查"开工前查"。宿主高负载/
|
|
6
|
+
* Python 环境异常时子进程会连续超时——每次都白付 6s 等待还拖慢请求。
|
|
7
|
+
* 连续 N 次失败后自动退避 M 分钟,期间 priorAuto 静默跳过。
|
|
8
|
+
*
|
|
9
|
+
* 2. context-pressure 采样节流(借鉴 zep 会话事实增量更新):
|
|
10
|
+
* sampleContextPressure 每步都跑 tokenMeter 读取+写盘(.context-pressure.json)。
|
|
11
|
+
* 对话密集时 1s 数次写盘纯属浪费——节流到 30s 一次,压力读数足够新鲜。
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
const PRIOR_FAIL_STREAK_MAX = 3 // 连续失败 3 次
|
|
15
|
+
const PRIOR_BACKOFF_MS = 10 * 60 * 1000 // 退避 10 分钟
|
|
16
|
+
const PRESSURE_MIN_INTERVAL_MS = 30 * 1000 // 压力采样最小间隔 30s
|
|
17
|
+
|
|
18
|
+
/** prior 子进程失败退避器(进程内状态,重启重置) */
|
|
19
|
+
export function createPriorBackoff() {
|
|
20
|
+
let streak = 0
|
|
21
|
+
let until = 0
|
|
22
|
+
return {
|
|
23
|
+
/** 是否处于退避窗口(true = 跳过本轮 prior) */
|
|
24
|
+
blocked() {
|
|
25
|
+
return Date.now() < until
|
|
26
|
+
},
|
|
27
|
+
/** 记录一次成功:清零计数 */
|
|
28
|
+
success() {
|
|
29
|
+
streak = 0
|
|
30
|
+
},
|
|
31
|
+
/** 记录一次失败:达到阈值即进入退避窗口 */
|
|
32
|
+
fail() {
|
|
33
|
+
streak += 1
|
|
34
|
+
if (streak >= PRIOR_FAIL_STREAK_MAX) {
|
|
35
|
+
until = Date.now() + PRIOR_BACKOFF_MS
|
|
36
|
+
streak = 0
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
/** 调试用:当前状态快照 */
|
|
40
|
+
snapshot() {
|
|
41
|
+
return { streak, backoffRemainingMs: Math.max(0, until - Date.now()) }
|
|
42
|
+
},
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** context-pressure 采样节流器(每 agent 独立,30s 内只采一次) */
|
|
47
|
+
export function createPressureThrottle(intervalMs = PRESSURE_MIN_INTERVAL_MS) {
|
|
48
|
+
const last = new Map() // agentKey -> ts
|
|
49
|
+
return {
|
|
50
|
+
shouldSample(agentKey) {
|
|
51
|
+
const now = Date.now()
|
|
52
|
+
const prev = last.get(agentKey) || 0
|
|
53
|
+
if (now - prev < intervalMs) return false
|
|
54
|
+
last.set(agentKey, now)
|
|
55
|
+
// 防长会话 Map 无限增长
|
|
56
|
+
if (last.size > 50) {
|
|
57
|
+
for (const [k, ts] of last) {
|
|
58
|
+
if (now - ts > intervalMs * 10) last.delete(k)
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return true
|
|
62
|
+
},
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TIME-CTX(v5.47):time-context 时间戳消息的折叠与去重。
|
|
3
|
+
*
|
|
4
|
+
* 背景(2026-12-03 调研):
|
|
5
|
+
* DSH 宿主每轮在 user 消息前注入一条 `source.kind === 'time-context'` 的时间戳
|
|
6
|
+
* 样本("Time sampled while preparing turn N...",~200-400 字符/条)。长会话里
|
|
7
|
+
* 这类消息越积越多(实测 128 条 ≈ 3-5 万字符),但信息量极低——历史轮次的精确
|
|
8
|
+
* 采样时间几乎从不被引用。两个代价:
|
|
9
|
+
* 1. token 浪费:每条 50-100 token,100+ 条就是 5000-10000 token 的死重;
|
|
10
|
+
* 2. 缓存失效:每条的时间戳都不同 → KV 前缀缓存从第一条 time-context 起失效,
|
|
11
|
+
* 每轮请求的实际计费输入变长。
|
|
12
|
+
*
|
|
13
|
+
* 业界对标(prompt caching 最佳实践,Anthropic/OpenAI 通用原则):
|
|
14
|
+
* - 动态数据(时间戳)应集中放在上下文末尾或完全省略,不要散布在历史中间;
|
|
15
|
+
* - 历史消息应保持字节级稳定以命中前缀缓存;
|
|
16
|
+
* - 模型真正需要的"现在几点"只在最新一条里,历史时间戳无引用价值。
|
|
17
|
+
*
|
|
18
|
+
* 实现(本模块,pre-step 阶段应用,与 applyFolds 同级):
|
|
19
|
+
* 把「非最近 N 轮」的 time-context 消息替换成一条合并占位(只保留首末时间),
|
|
20
|
+
* 工具结果等安全检查与 applyFolds 相同——time-context 是纯文本 user 消息,
|
|
21
|
+
* 不含 tool-call,无悬挂引用风险。默认开启(cfg.timeCtxFold !== false)。
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
const TIMECTX_SOURCE = 'time-context'
|
|
25
|
+
const KEEP_RECENT_TURNS = 2 // 最近 2 轮的 time-context 保留原样(最新时间可能被引用)
|
|
26
|
+
|
|
27
|
+
function isTimeContext(m) {
|
|
28
|
+
const src = m?.source?.kind ?? m?.data?.source?.kind ?? m?.message?.source?.kind
|
|
29
|
+
return src === TIMECTX_SOURCE
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** 从 time-context 消息文本里抽时间戳("Time sampled ...: 2026-12-03T19:53:36+08:00")。 */
|
|
33
|
+
function timeOf(m) {
|
|
34
|
+
const c = m?.content
|
|
35
|
+
const text = typeof c === 'string' ? c
|
|
36
|
+
: Array.isArray(c) ? (c.find((p) => p?.type === 'text')?.text || '') : ''
|
|
37
|
+
const match = /(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}[+-]\d{2}:\d{2})/.exec(String(text))
|
|
38
|
+
return match ? match[1] : ''
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* 把历史轮次的 time-context 消息合并成一条占位。
|
|
43
|
+
* @returns {ok, changed, folded, reason?}
|
|
44
|
+
*/
|
|
45
|
+
export function foldTimeContext(decision, currentTurn) {
|
|
46
|
+
const msgs = Array.isArray(decision?.messages) ? decision.messages : null
|
|
47
|
+
if (!msgs || !msgs.length) return { ok: true, changed: false, folded: 0 }
|
|
48
|
+
|
|
49
|
+
// 按 turn 分组收集 time-context;currentTurn 之后的(最近轮)保留。
|
|
50
|
+
// currentTurn 未知时不折叠(保守):无法判断远近,宁可留着也不误删最近时间。
|
|
51
|
+
if (typeof currentTurn !== 'number') {
|
|
52
|
+
return { ok: true, changed: false, folded: 0, reason: 'currentTurn 未知,保守跳过' }
|
|
53
|
+
}
|
|
54
|
+
const victims = [] // 待折叠的消息引用
|
|
55
|
+
let firstTs = '', lastTs = ''
|
|
56
|
+
for (const m of msgs) {
|
|
57
|
+
if (!isTimeContext(m)) continue
|
|
58
|
+
const t = m?.data?.turn ?? m?.turn
|
|
59
|
+
if (typeof t !== 'number') continue // 归属不明的消息不折叠
|
|
60
|
+
if (t > currentTurn - KEEP_RECENT_TURNS) {
|
|
61
|
+
continue // 最近轮保留
|
|
62
|
+
}
|
|
63
|
+
victims.push(m)
|
|
64
|
+
const ts = timeOf(m)
|
|
65
|
+
if (!firstTs && ts) firstTs = ts
|
|
66
|
+
if (ts) lastTs = ts
|
|
67
|
+
}
|
|
68
|
+
if (!victims.length) return { ok: true, changed: false, folded: 0 }
|
|
69
|
+
|
|
70
|
+
const savedChars = victims.reduce((acc, m) => {
|
|
71
|
+
const c = m?.content
|
|
72
|
+
return acc + (typeof c === 'string' ? c.length
|
|
73
|
+
: Array.isArray(c) ? c.reduce((a, p) => a + (p?.text ? String(p.text).length : 0), 0) : 0)
|
|
74
|
+
}, 0)
|
|
75
|
+
|
|
76
|
+
const placeholder = {
|
|
77
|
+
id: 'lingshu-timectx-fold',
|
|
78
|
+
role: 'user',
|
|
79
|
+
content: [{
|
|
80
|
+
type: 'text',
|
|
81
|
+
text: `【历史时间戳已归并】本会话更早 ${victims.length} 轮的采样时间:${firstTs || '(早前)'} → ${lastTs || '(同前)'}。各轮具体时间戳不再逐条保留——需要某轮的精确时间请看该轮消息的上下文。`,
|
|
82
|
+
}],
|
|
83
|
+
source: { kind: 'skill-invocation', name: 'lingshu-timectx-fold', form: 'instructions' },
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// 替换:第一条 victim 换成占位,其余直接删除
|
|
87
|
+
const out = []
|
|
88
|
+
let placed = false
|
|
89
|
+
for (const m of msgs) {
|
|
90
|
+
if (victims.includes(m)) {
|
|
91
|
+
if (!placed) { out.push(placeholder); placed = true }
|
|
92
|
+
continue
|
|
93
|
+
}
|
|
94
|
+
out.push(m)
|
|
95
|
+
}
|
|
96
|
+
decision.messages = out
|
|
97
|
+
return { ok: true, changed: true, folded: victims.length, savedChars }
|
|
98
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lingshu-skill",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.48.0",
|
|
4
4
|
"description": "Brain-inspired persistent memory, persona and growth system for AI coding agents. Local-only, zero-dependency Python. Requires Python 3.10+.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"PATCH_NOTES.md": "9296e524f743f358fd11115598398a754cfd69534526dde9c8ad85f14a418f89",
|
|
3
3
|
"README.md": "3d634d743b085eebd2cbb5dd3a00edfa728ed23947e20cc29e7c3b29087ec043",
|
|
4
|
-
"engine/CHANGELOG.md": "
|
|
5
|
-
"engine/README.md": "
|
|
6
|
-
"engine/SKILL-lite.md": "
|
|
7
|
-
"engine/SKILL-tiny.md": "
|
|
8
|
-
"engine/SKILL.md": "
|
|
4
|
+
"engine/CHANGELOG.md": "ab76966415260d000afec8e305cc6eb130d642226d78622ad9b117ffaabe7e1a",
|
|
5
|
+
"engine/README.md": "16b184ffed24c5e2578194a591b0a425bf5f532410ccf32fa8c0596e7c90dbc8",
|
|
6
|
+
"engine/SKILL-lite.md": "621b19bd3895d7c7044446b90af9f6518f5b3cf3d12fd113479d0440a2a9a6c0",
|
|
7
|
+
"engine/SKILL-tiny.md": "1c08662cb5eeef89cd40b68ab10e137e3b97bd22668a061455c56c9dbed7ebd3",
|
|
8
|
+
"engine/SKILL.md": "877f35e8ec6aea428e771513f6efdbbd6588a5dc9af887b2ac2e41b7d3e9b8e6",
|
|
9
9
|
"engine/assets/panel.html": "af43d2d001233a9ed4314348335669d57b045f7f3efb2b2de69b4b15da659312",
|
|
10
10
|
"engine/docs/commands.md": "0ce8c88e5d2d04a8055b45c060ebd53b50c52b79b650312e2ee440845804ca4b",
|
|
11
11
|
"engine/docs/mechanics.md": "aa9683c827ed3419106e84d847ab16dc310c27fc62f588184192aaa1617523cc",
|
|
@@ -1,5 +1,37 @@
|
|
|
1
1
|
# 更新日志
|
|
2
2
|
|
|
3
|
+
## v5.48(2026-12-03)
|
|
4
|
+
|
|
5
|
+
### 🛡️ RESILIENCE:lingshu-startup 插件健壮性双引擎
|
|
6
|
+
|
|
7
|
+
#### prior 连续失败退避(借鉴 SPEED-3 自适应降级 + mem0 服务健康探针)
|
|
8
|
+
- prior 每轮首个 pre-step 都 spawn brain.py 子进程查开工前查——宿主高负载/Python 异常时连续超时,每次白付 6s 等待还拖慢请求。
|
|
9
|
+
- 连续 3 次失败 → 自动退避 10 分钟静默跳过;成功即清零计数。请求关键路径不再被坏环境拖死。
|
|
10
|
+
|
|
11
|
+
#### context-pressure 采样节流(借鉴 zep 增量更新)
|
|
12
|
+
- sampleContextPressure 原先每步都读 tokenMeter+写盘;对话密集时 1s 数次写盘纯属浪费。
|
|
13
|
+
- 节流到 30s 一次(按 agent 独立),压力读数对水位判断足够新鲜;Map 防无限增长。
|
|
14
|
+
|
|
15
|
+
#### 调研结论
|
|
16
|
+
- Cordis 插件生态(Koishi 4000+ 插件背书)的核心模式:钩子内绝不冒泡、子进程调用必须有退避、高频 IO 必须节流——本版三项全部对齐。
|
|
17
|
+
- 腾讯 Hy-Memory 2.0(聊天/工作/代码三类记忆)与灵枢分层设计同构,验证了方向;其 benchmark 框架可后续借鉴做召回质量回归。
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## v5.47(2026-12-03)
|
|
22
|
+
|
|
23
|
+
### ⏱️ TIME-CTX:历史时间戳归并(对话上下文瘦身)
|
|
24
|
+
|
|
25
|
+
**问题**(本会话实测):DSH ��主每轮注入一条 ime-context 时间戳消息(~200-400 字符),本会话已积累 128 条 ≈ 数千 token 死重。两个代价:①token 浪费——历史轮次的精确采样时间几乎从不被引用;②**KV 前缀缓存失效**——逐条不同的时间戳打断前缀缓存,每轮请求实际计费输入变长。
|
|
26
|
+
|
|
27
|
+
**方案**(对标 prompt caching 最佳实践:动态时间数据集中放末尾或省略,历史保持字节级稳定):
|
|
28
|
+
- 新增 cordis-plugin/lingshu-startup/time-context-fold.js:pre-step 阶段把「非最近 2 轮」的 time-context 消息归并成一条占位(只保留首末时间)。
|
|
29
|
+
- 保守防线:currentTurn 未知/消息归属不明时**不折叠**(宁可留着也不误删);time-context 是纯文本 user 消息,无 tool-call 悬挂风险。
|
|
30
|
+
- imeCtxFold 配置键(默认开)。
|
|
31
|
+
- 单元测试 3/3(历史归并+最近保留、零改动路径、未知轮保守跳过)。
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
3
35
|
## v5.46(2026-12-03)
|
|
4
36
|
|
|
5
37
|
### 🔍 隐藏性问题深扫修复(6 项)
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> 名字取自《黄帝内经》:**算力给思考,人格给灵魂,记忆给生命。**
|
|
4
4
|
|
|
5
|
-
> 当前版本 **v5.
|
|
5
|
+
> 当前版本 **v5.48**(变更见 [CHANGELOG.md](CHANGELOG.md))
|
|
6
6
|
|
|
7
7
|
> 🔁 **双仓库镜像**:GitHub(主)与 Gitee(镜像)保持同步——[gitee.com/htmcwy_0/lingshu-skill](https://gitee.com/htmcwy_0/lingshu-skill)。灵枢的更新检查会探测两边最新提交,**谁更新就自动从谁拉取**;任一边不可达(Gitee 匿名风控 / GitHub 限额)时走另一边兜底。
|
|
8
8
|
|