Repository navigation
feat(compress): opt-in nudge-low-effort — clamp thinking/effort on first compression-nudge turn (#617) - #619
ranxianglei wants to merge 1 commit into
Conversation
…rst compression-nudge turn Port of ranxianglei/billion-context PR#1780 (settled in #1640) into pi-acp. New opt-in config compress.nudgeLowEffort (default off): on the FIRST request of a compression-nudge episode, clamps the already-present thinking/effort field toward the wire floor for that one turn only, restoring on the next request. Targets the summary-writing turn where thinking models burn a large reasoning budget. Clamp-only (rank-based: never injects or raises a value), prompt-cache-safe (effort sits outside the message prefix). Dialects: anthropic thinking.budget_tokens->1024, openai/responses reasoning_effort/reasoning.effort->low, gemini thinkingBudget->128. Wired through before_provider_request (composed with strip-images; also fixes the prior early-return that skipped the hook entirely when stripImages was disabled) plus a fresh-nudge signal armed at the context-transform nudge-push site. No acp-kernel change, no cross-repo dependency. 28 new tests. Closes #617. Refs ranxianglei/billion-context#1640, PR#1780.
c49da1e to
7d5151d
Compare
📦 Built Extension ArtifactBranch: Option A — Install from npm PR tag (recommended)pi install npm:billion-context-pi@pr-619Each push to this PR publishes a new version under the Option B — Download artifact
tar xzf billion-context-pi-pr619.tgz
pi install ./packageThis comment is automatically updated on each push. |
[bot] 🏷 PR #619 review 完成(rebased head 查重全仓检索 nudgeLowEffort / reasoning_effort / budget_tokens / thinkingBudget(含已关闭 issue/PR):仅 #617(原始需求)与本 PR,无重复。 我做了什么(已验证)PR 分支基于旧 master(fork 点落后 ~25 个提交),GitHub 报
CI(新 head):9 个 check run 全 success(test ubuntu/windows × node 22/24、e2e ×2、build-artifact、docker、pr-validation)。当前 既有行为回归审查(逐项)
已知局限(非阻塞,留档供 owner 决定)连续两个回合各出现一次全新 nudge episode(压缩后立即又越过 growthFloor)时,第二 episode 的首回合会漏掉一次 clamp(prev flag 要等一个无注入回合才复位)。下回合即自愈;且机制无法区分「模型没压」与「压完又涨」,要修需引入 compress-outcome 追踪(更多状态)。opt-in 实验特性,代价至多多烧一轮高 effort——建议接受现状,不单独立项(同机制族,归本 PR 线程)。 结构化七问
测试质量:28 个新 case 断言有牙(逐 wire clamp+floor、低于 floor 不抬、缺失不注入、unknown/none 不抬、google -1 不动、幂等、输入不被原地改、malformed 安全、null-protocol no-op、classifier 无关、decision 真值表+整周期、config 三级合并+默认关),bug 回归时可抓得住。 判定:代码、测试、文档、CI 均就绪,可合并。 按 §7.4 auto-merge gate,本 PR 属 |
What
Port of billion-context#1640 / billion-context PR#1780 into pi-acp, addressing #617: lower the model's thinking/reasoning effort specifically on the compression turn.
Behavior — new opt-in config
compress.nudgeLowEffortBoolean, default
false, resolved through the same three-level cascade as every othercompress.*field (global -> provider -> model). When enabled:none < minimal < low < medium < high < xhigh < max) down tolow; never injects an absent field and never raises a value (a no-reasoningnonestaysnone).thinking.budget_tokens -> 1024, openai/responsesreasoning_effort/reasoning.effort -> low, geminigenerationConfig.thinkingConfig.thinkingBudget -> 128(-1dynamic left alone).Regression / behavior notes
before_provider_requesthandler previously early-returned whenstripImageswas disabled; it now always runs so the two opt-in wire levers compose. Observable behavior for strip-images users is unchanged; for everyone else the added per-request work is inert bookkeeping (two Map lookups + a flag check).acp-kernelchange, no cross-repo dependency, packageversionuntouched.Tests
28 new cases in
tests/nudge-low-effort.test.tsmirroring PR#1780: per-wire clamp + floor, below-floor never raised, absent not injected, unknown/nonenever raised (rank rule), google-1untouched, idempotent, malformed/null/array safe, null-protocol no-op, classifier-independent (clamps a plain user turn too), decision truth-table, config three-level merge + default-off. Existingstrip-imagesandnudge-reinjectsuites remain green. Typecheck + build clean. Full suite runs in CI.Closes #617.