Repository navigation
feat: absorb tool for instant tool-result compression (issue #14) - #213
ranxianglei wants to merge 1 commit into
Conversation
Adapts the proxy to acp-kernel 0.0.45's absorb pipeline: - src/absorb.ts: absorb settings resolution (absorbEnabled, applyAbsorbConfig with percent parsing) and executeAbsorb — the wire result text carries the model's summary verbatim inside <absorbed-summary> (the absorb tool_use is rewritten to text, so this is the only durable record). - Tool injection for all three protocols (anthropic/openai/responses, streaming loops included), plugin manifest + MCP tool list now advertise absorb; plugin tool API can execute it. - Kernel 0.0.31 -> 0.0.45-pr.160.14 (exact pin; flips to 0.0.45 when kernel release PR #160 merges): - openaiToCore now hoists the leading system/developer prefix out of the fold space: prepareOpenai re-injects systemText (and restores a developer head role) or the host system prompt is silently lost. - KEEP_LAST_ORPHANED=2 changed hide-consumed semantics: plugin-mode wire echoes of executed compress calls are orphans that stay visible; hidePluginEchoCompressCalls drops the consumed tail pair. - Tests: roundtrip hoist contract, manifest/MCP 5-tool lists, 6 new absorb unit tests. 518/518 pass.
|
Review vs master 3cd85b6 (kernel 0.0.56): ❌ superseded in approach — do not merge; use as design reference (#605). Two blockers:
Rework direction (#605): wire the kernel API the same way (tracking: #605) |
|
Superseded by PR #615 (full kernel-absorb wiring, tracked in #605/#616). PR #615 完整实现了本 PR 的意图, 且基于 kernel 0.0.56 的官方 absorb API (
关闭本 PR, 保留其原始设计价值作为 #605 spec 的参考。感谢提交! |
Closes #605 — tracking issue for this PR.
What
Adapts the proxy to acp-kernel 0.0.45's new
absorbpipeline (kernel PR #139, merged) — closes #14 on the companion billion-context-pi tracker direction: 小上下文场景下, 工具调用后模型立即复述关键结果, 原始工具输出下一轮隐藏.absorbEnabled/applyAbsorbConfig(settings → kernelConfig.absorb, percent parsing forcontextThresholdPct) andexecuteAbsorb. The wire result carries the model's summary verbatim inside<absorbed-summary>— the absorb tool_use is rewritten to text on the wire, so that text is the only durable record of the original output.absorbbeing enabled in compress settings. Plugin manifest and MCP tool list now advertise absorb (5 tools); plugin tool API executes it under the session lock.Kernel 0.0.31 → 0.0.45 upgrade fallout (fixed here)
openaiToCorenow hoists the leading system/developer prefix out of the fold space.prepareOpenaire-injectssystemText(restoring adeveloperhead role) — without this the host system prompt is silently dropped from every rebuilt request.KEEP_LAST_ORPHANED=2(issue release v0.1.2 #9 fix) keeps the newest two orphaned compress calls visible. In plugin mode the wire echo of an executed compress carries a host id that never matches the block'splugin_*call id → permanent orphan → stays visible.hidePluginEchoCompressCallsdrops the consumed tail pair before the turn.acp-kernelto exact0.0.45-pr.160.14(the npm preview of kernel release PR refactor: adopt acp-kernel/wire — codecs move to the kernel #160). Follow-up commit flips this to0.0.45once the kernel release lands on npm — merge this PR after that.Tests
518/518 pass (
node --import tsx --test),tsc --noEmit --project tsconfig.build.jsonclean, tsup build clean:systemText+injectOpenaiSystem)absorbEnabled/applyAbsorbConfig/executeAbsorb(disabled fast-fail, missing-summary guidance, success records + hides + verbatim summary, idempotency, unknown ref)Merge is human-only per AGENTS.md.