Repository navigation
v0.1.7 — Version self-report, nested bundles, reload-loop fix, bundle overview
opencode-okf-context v0.1.7
Four fixes hardened by real-world debugging sessions.
1. Version self-reporting (diagnosability)
The plugin now stamps its version into the L0 manifest, the okf_list bundle overview, and the okf_validate report header: opencode-okf-context v0.1.7. opencode's @latest package cache can go stale — one user ran 0.1.4 while believing they were on 0.1.6, and diagnosing it took days. Now "which build is actually loaded" is answerable in one tool call.
2. Nested explicit bundles
A directory whose own index.md declares okf_version (spec §12) is now accepted as its own bundle even when nested inside another detected bundle root, and its subtree is excluded from the outer bundle's concepts. Previously an accidentally-detected project root (e.g. one whose index.md was created by an AI following a validate fix suggestion) swallowed the real nested knowledge bundle — doca/wiki could never surface as its own bundle.
3. Anti-reload-loop unload placeholders
Unload placeholders previously read as directives ("unloaded — reload with okf_read"), and models dutifully re-read after every unload — a read→unload→reload loop that burned minutes and tens of thousands of tokens when verifying long documents. New wording states the unload is routine context management, no action is needed, and okf_read is only for when the full text is genuinely required again.
4. okf_list without a bundle arg shows an overview
Calling okf_list with no arguments now lists all available bundles (name, concept count, root preview, browse hint) instead of erroring with Bundle not found: (none). Also: validate's bundle-level fix commands now warn against creating a root index.md on accidentally-detected directories (declare bundles in okf.jsonc instead).
Verified: 110 tests pass (new: version sync gate, nested-bundle H4, overview). E2E trigger hit-rate re-measured at 100% (5/5 positive + 1/1 negative) on deepseek-v4-flash after the manifest change.
中文摘要
四项实战打磨出的修复:
- 版本自报——manifest、
okf_list概览、okf_validate报告头都会标注当前运行版本(如v0.1.7)。opencode 的@latest包缓存可能不刷新(有用户实际跑着 0.1.4 却以为是 0.1.6,排查花了数天);现在一次工具调用即可确认实际加载的构建。 - 嵌套 bundle——自己的
index.md声明了okf_version的目录,即使位于另一个被识别的 bundle 内部,也会作为独立 bundle 被发现,且其子树从外层 bundle 的 concepts 中排除。此前误判的项目根(例如 AI 按 validate 建议创建了根 index.md)会把真正的知识 bundle 整个吞掉。 - 卸载占位符防reload循环——旧文案 "unloaded — reload with okf_read" 会被模型当作指令,触发 读→卸载→重读 死循环(实测烧掉 3 分钟/50K token)。新文案明确"例行上下文管理、无需操作、仅在确实需要全文时再 okf_read"。
okf_list无参概览——不带 bundle 参数时列出全部可用 bundle 概览而非报错;validate 的 bundle 级修复命令也加了警告:误判目录不要创建根 index.md,改用okf.jsonc声明。
验证:110 测试全过;manifest 改动后 E2E 触发命中率复测 100%。