Skip to content

v0.2.0: okf CLI + large-context defaults + search dedup/aging

Choose a tag to compare

@likai-hust likai-hust released this 06 Sep 08:56
· 3 commits to main since this release

English

  • okf CLI — the package now ships a standalone binary with the same operations as the okf_* tools, for non-opencode agents (via their shell tool), humans, and CI (okf validate --all as a repo gate). Read intake control (--fields / --section / --max-chars), read-only by default (--write to enable writes), CI-friendly exit codes. Note: installing via opencode plugin does NOT put okf on PATH — it comes from npm install -g opencode-okf-context.
  • Shared operations layer (src/operations.ts) — plugin tool output is byte-identical to v0.1.8; the CLI renders shell-style hints and a read footer that never mentions okf_unload (no unload exists outside opencode).
  • Defaults tuned for large (256K-token) context windows — unload.afterTurns 2→4, keepRecent 1→2, nudge.threshold 6000→25000. Reloads are expensive; hold concepts a little longer and only nudge when retained knowledge is genuinely large.
  • okf_search outputs are now deduped and aged out like reads (same query keeps only the latest results) — cuts the retained-context slope from ~2.7K to ~1.3K chars per question in long sessions.
  • Benchmarks + opt-in live-LLM test suites (stress / hit-rate / compaction / read-efficiency; reload, compaction & efficiency E2E gates). 146 tests green.

中文

  • okf CLI——包内新增独立命令行工具,与 okf_* 工具同一套内核,面向非 opencode 的 Agent、人和 CI(okf validate --all 可作仓库门禁)。读取摄入控制(--fields / --section / --max-chars),默认只读(--write 显式开启写),退出码 CI 友好。注意:opencode plugin 安装不提供 CLI 命令,需另行 npm install -g opencode-okf-context。
  • 共享操作层(src/operations.ts)——插件侧工具输出与 v0.1.8 逐字节一致;CLI 侧输出为 shell 风格提示,read 页脚不会提及 okf_unload(opencode 之外没有卸载机制,不做虚假承诺)。
  • 默认参数按大上下文窗口(256K)调优——afterTurns 2→4、keepRecent 1→2、nudge.threshold 6000→25000:重读有成本,概念多留几轮;提醒只在滞留量真正大时触发。
  • 检索输出参与去重与老化——同词重复搜索只保留最新结果,旧检索结果像读取一样按轮次占位化,长会话滞留斜率从 ~2.7K 降至 ~1.3K 字符/问。
  • 附基准测试与 opt-in 真实 LLM 测试套件(压测 / 命中率 / 压缩抗性 / 读效率)。146 项测试全绿。