Repository navigation
fix: warn once per distinct config-validation error set (#346) - #347
ranxianglei wants to merge 1 commit into
Conversation
caad877 to
fe70885
Compare
📦 Built Package ArtifactBranch: Option A — Install from npm PR tag (recommended)In your adapter project: npm install acp-kernel@pr-347Each push to this PR publishes a new version under the Option B — Download artifact
tar xzf acp-kernel-pr347.tgz
npm install ./packageThis comment is automatically updated on each push. |
[bot] 🏷 Verified PR #347 (fix: warn once per distinct config-validation error set, closes #346). I did not redo the work — I pulled the branch, reviewed the code, checked CI, and fixed one blocker that was preventing merge. Code review — passes. Implementation is correct, minimal, well-targeted:
Blocker found & fixed: stale-base merge conflict. The PR branched from an older master; master had since advanced through releases v0.0.79–v0.0.82 and the Verification after rebase (head
Not merging — merge is human-only per repo rules. Please approve + merge: #347 Notes:
中文摘要:修复了 PR #347 因落后于 master(期间合入 v0.0.79–v0.0.82 与 acp_rule 功能)导致的合并冲突——已 rebase 到最新 master 并按字段并集解决 5 处冲突;本地 typecheck + 874 项测试 + 构建全绿,GitHub CI(test 22/24、pr-validation、build-artifact)也全绿。代码实现正确、测试充分,diff 干净,现只差人工审批,可以合并。 |
|
@ework-daemon 与 master 冲突了,请 rebase 到当前 master 后重推,CI 绿后待合。 |
fe70885 to
d00e96b
Compare
[bot] 🏷 已完成 rebase + 重推,CI 全绿,待合。 做了什么:
验证:
待合: 只差人工审批/合并(合并为人工操作,我不代合)。链接: #347 中文摘要:已将 PR #347 rebase 到当前 master(v0.0.89)并按字段并集解决 4 处冲突后重推( |
d00e96b to
7a6f88e
Compare
[bot] 🏷 Rebase 完成,分支已更新,可合。
CI 将在 force-push 后重跑;合并请人工执行(PR merges are human-only)。 一句话总结:#347 已 rebase 到当前 master 并四处并集解冲突,本地三门禁全绿(1093/1093),可以合并。 |
Closes #346
Problem
processTurnunconditionally calledconsole.warnon every turn whenevervalidateConfigreturned errors. Withnudge.minContextLimitPct > nudge.maxContextLimitPct(a valid soft-target setup exposed by billion-context — ranxianglei/billion-context#1122), that is one log line per upstream request in proxy deployments: unbounded noise for a configuration that works fine.Verified: the two limits gate independent code paths in
decideNudge(max → pressure zone at src/compress.ts:1222; min → first-sight mass bypass + tier-count usage floor at src/compress.ts:1291,1304). Nothing depends on [min, max) being non-empty, so thresholds do fire correctly — the warning is informational only.Fix
Deduplicate per session/state, as suggested in the issue: remember the last emitted validation-error set on
CompressionState.lastConfigWarnings(new optional field) and re-warn only when the set actually changes (config edit). Warning text unchanged.src/compress.ts— processTurn compares the new error set against the stored one (sameWarningSet, order-insensitive) before emitting; writes the updated set back to state every turn ([]when valid).src/types.ts— new optional fieldCompressionState.lastConfigWarnings?: string[].src/state.ts—createInitialState()initializes it to[].src/sync.ts,cloneStateinsrc/compress.ts,mergeCompressionStateinsrc/persist/state-merge.ts— all three explicit state constructors carry the field, so dedup memory survives both the per-turn sync clone and host persist/load cycles (the exact proxy scenario from validation: minContextLimitPct > maxContextLimitPct warns once per processTurn (log spam) #346). The sync clone was dropping it initially — caught by the new round-trip test.Behavior change (old → new)
console.warnperprocessTurncall while any config-validation error exists (log spam proportional to request volume).console.warnper change of the validation-error set — once at first detection, again if the config is edited into a different invalid shape, and again across an invalid→valid→invalid transition. Silent for valid configs.Verification
tsc --noEmitclean;npm run buildOK.npm run format:checkfails repo-wide without this change too (no prettier config committed; ~107 files flagged incl. untouched ones like tsconfig.json). This diff follows the surrounding code style.