Skip to content

feat: 嵌套 KV 结构 + 可配置 TTL + 条目清除#10

Merged
Hotakus merged 11 commits into
masterfrom
feat/nested-session-kv
Jul 14, 2026
Merged

feat: 嵌套 KV 结构 + 可配置 TTL + 条目清除#10
Hotakus merged 11 commits into
masterfrom
feat/nested-session-kv

Conversation

@Hotakus

@Hotakus Hotakus commented Jul 14, 2026

Copy link
Copy Markdown
Owner

嵌套 KV 结构

subagent_magazine.session_data 从扁平改为嵌套:

  • 父(主)会话为顶层 key,子会话 scroll/expanded/entries 存入 children[childSid]
  • resolveParent(sid) 通过 SDK parentID 判断归属
  • 访问时间 TTL:每次切回主会话刷新 ts,默认 3 天不过期

新命令

/subagent-ttl

配置数据保留期限:3 天 / 7 天 / 14 天 / 30 天 / 无期限。弹框标题显示当前值。

/subagent-clear-entries

清除当前会话全部子代理记录,使用 clearedIds 列表阻止扫描重建。

  • 条目级跳过 —— 旧条目不上屏,新条目正常创建
  • 有运行中条目时弹警告
  • 内存缓存 + 组件同步刷新

修复

  • clear-entries 同步清理 globalEntryCache 并触发组件重扫
  • clearTick 信号移到 untrack 外修复依赖追踪,forceReload 防止 copy prev
  • || 3 吞零 bug —— 改用 Number.isNaN 支持值 0(无期限)

@Hotakus Hotakus changed the title feat(kv): 嵌套会话结构 + 访问时间自动刷新 TTL feat: 嵌套 KV 结构 + 可配置 TTL + 条目清除 Jul 14, 2026
@Hotakus Hotakus self-assigned this Jul 14, 2026
@Hotakus Hotakus added the enhancement New feature or request label Jul 14, 2026
@Hotakus
Hotakus merged commit b527e42 into master Jul 14, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant