Skip to content

docs: add messageFilters config reference + examples (EN/ZH) - #381

Open
ranxianglei wants to merge 3 commits into
masterfrom
2026-09-09_message-filters-docs
Open

docs: add messageFilters config reference + examples (EN/ZH)#381
ranxianglei wants to merge 3 commits into
masterfrom
2026-09-09_message-filters-docs

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

Closes #369

Issue #369 asked how to safely remove oh-my-opencode's redundant injected prompts. The answer is that ACP already ships 5 built-in OMO message filters (enabled by default since v1.14.8) — but the messageFilters config surface was completely undocumented, so the feature was undiscoverable.

Changes (docs only, no code)

  • CONFIGURATION.md / CONFIGURATION.zh-CN.md — new ### messageFilters section:
    • messageFilters.enabled (master switch, default true)
    • messageFilters.filters (per-filter enabled + keepLast)
    • built-in filter table (name, version, behavior) for all 5 OMO filters
    • full config example
    • new recipe in Common Config Recipes / 常用配置模板: tune keepLast, disable one filter, or turn the subsystem off
  • README.md / README.zh-CN.mdmessageFilters entry added to the Default Configuration block (EN + ZH comments)

Verification

  • Documented defaults cross-checked against source: lib/config.ts (defaults), lib/messages/filter/builtin/*.ts (filter names/versions/keepLast), lib/messages/filter/apply.ts:115-116 (keepLast resolution)
  • npm run typecheck ✅, npm run build ✅, full test suite 1112/1112 pass ✅

Notes

  • Pre-existing inconsistency noticed while editing (out of scope, not fixed here): qualityGate.algorithms.rouge-recall-v1.layer1MinRetentionPct is documented as 5.0 in the CONFIGURATION.md table but 1.0 in the README default-config block. Worth a separate fix.
  • Devlog: devlog/2026-09-09_message-filters-docs/ (REQ + WORKLOG)

Issue #369 showed the default-on OMO message filters are undiscoverable.
Add the missing messageFilters documentation:

- CONFIGURATION.md / CONFIGURATION.zh-CN.md: new messageFilters section
  (enabled, filters, builtin filter table, example) + a tuning/disabling
  recipe in Common Config Recipes
- README.md / README.zh-CN.md: messageFilters entry in the default-config
  block

Docs only — no code changes. Verified defaults against source
(lib/config.ts, lib/messages/filter/builtin/*). typecheck/build/test pass
(1112/1112).
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown

📦 Built Plugin Artifact

Branch: 2026-09-09_message-filters-docs (a6d4fd5)

Option A — Install from npm PR tag (recommended)

opencode plugin opencode-acp@pr-381 --global

Each push to this PR publishes a new version under the pr-381 npm tag.

Option B — Install from GitHub

opencode plugin "github:ranxianglei/opencode-acp#2026-09-09_message-filters-docs" --global

Option C — Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf opencode-acp-pr381.tgz
cp -r package/dist ~/.cache/opencode/packages/opencode-acp@latest/node_modules/opencode-acp/dist
  1. Restart opencode to pick up changes.

This comment is automatically updated on each push.

@ranxianglei

Copy link
Copy Markdown
Owner Author

解决冲突

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

冲突已解决,已推送到分支 2026-09-09_message-filters-docs(merge commit a6d4fd5)。

冲突原因:master(v1.15.0 / v1.16.0 storagePath 功能)和本 PR 都在 CONFIGURATION.md / CONFIGURATION.zh-CN.md 的 "Common Config Recipes" 一节、紧跟 "Protect sensitive files" 之后追加了新 recipe——本 PR 加的是 OMO messageFilters recipe,master 加的是 storagePath recipe,同一位置各加各的,产生冲突。

解决方式:两边内容都保留(OMO 过滤器 recipe 在前,"Relocate session state storage" / "自定义会话状态存储位置" 在后),无内容丢弃。#messagefilters 锚点链接已验证可解析到 ### \messageFilters`` 小节。

合并后重新验证

  • npm run typecheck
  • npm run build
  • 全量测试 1131/1131 通过 ✅(master 合入后带入了 storage-path 测试,数量从 1112 增至 1131)
  • scripts/ci/check-pr.sh 全部通过 ✅
  • GitHub API 确认 mergeable: true

WORKLOG 已补充冲突解决记录。PR 现在 CI 跑完后即可由你合并(按规范合并操作只由人工执行)。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Question] How can I safely remove the redundant/ineffective system prompts that oh-my-opencode injects into the context? (I'm using ACP.)

1 participant