Skip to content

v0.1.3 — Better knowledge-exploration triggers + nudge force fix

Choose a tag to compare

@likai-hust likai-hust released this 01 Aug 00:11
· 11 commits to main since this release

opencode-okf-context v0.1.3

This release makes the plugin fire reliably when an agent needs to explore knowledge (not just when the user explicitly asks), and fixes a config option that was silently a no-op.

Prompt improvements (cover proactive exploration)

The plugin now triggers in both situations:

  • Reactive — the user asks to understand/explain a concept, metric, or term.
  • Proactive — the agent itself needs domain context while writing code (e.g. it hits a metric name it's unsure about, or is about to hardcode a value the bundle defines). When unsure, it now reaches for okf_search before guessing.

Details:

  • Manifest (indexing.ts): added reactive + proactive trigger conditions, bilingual (zh/en) trigger phrases, and a quick decision guide so the agent picks okf_search first when it hears a term instead of always starting from okf_list.
  • okf_search description (tools.ts): rewritten to lead with the use case — "THE entry point when you hear a term" — instead of implementation detail, so the model selects it as the first action.

Bug fix (nudge force config was a no-op)

  • messages.ts: force: "strong" now emits a directive tone (frames unloading as a context-quality necessity); "soft" keeps the suggestion tone. Previously both ternary branches produced identical text, so the option did nothing.
  • Added a regression test guarding that the two tones differ.
  • Documented the force field in okf.schema.json.

Tests

68 tests pass (1 new regression test for nudge tone); tsc --noEmit clean.

Upgrade

npm install opencode-okf-context@0.1.3

No breaking changes; config and tool APIs are unchanged.


Full changes: commit 624d90e under tag v0.1.3.


中文说明

opencode-okf-context v0.1.3

本次发布让插件在 agent 主动探索知识时也能可靠触发(不只是用户明确提问时),并修了一个静默失效的配置项。

提示词优化(覆盖主动探索场景)

插件现在在两种情况下触发:

  • 被动触发 —— 用户要求理解/解释某个概念、指标或术语。
  • 主动触发 —— agent 自己写代码时需要领域上下文(例如遇到不确定的指标名、或准备硬编码一个 bundle 里可能已定义的值)。现在它会先 okf_search 查证,而不是靠参数知识硬猜。

细节:

  • Manifest(indexing.ts):新增被动+主动双触发条件、中英双语触发短语、决策流指引(听到术语时优先 okf_search,而不是总从 okf_list 兜圈)。
  • okf_search 描述(tools.ts):改为"场景优先"开头——"听到术语时的第一入口"——而非实现细节,让模型把它选为第一动作。

Bug 修复(nudge force 配置静默失效)

  • messages.ts:force: "strong" 现在产出指令性文案(把卸载框定为上下文质量必需);"soft" 保持建议性语气。之前两个三元分支文案完全相同,该配置项实际不生效。
  • 新增回归测试,守护两种语气互不相同。
  • 在 okf.schema.json 中补全了 force 字段说明。

测试

68 个测试通过(新增 1 个 nudge 语气回归测试);tsc --noEmit 无错。

升级

npm install opencode-okf-context@0.1.3

无破坏性变更;配置和工具 API 均不变。


完整变更:tag v0.1.3 下的 commit 624d90e。