Skip to content

fix: preserve dynamic pruning and verify tool continuity - #40

Merged
LeXwDeX merged 4 commits into
masterfrom
fix/38-pruning-continuity
Sep 4, 2026
Merged

fix: preserve dynamic pruning and verify tool continuity#40
LeXwDeX merged 4 commits into
masterfrom
fix/38-pruning-continuity

Conversation

@LeXwDeX

@LeXwDeX LeXwDeX commented Sep 4, 2026

Copy link
Copy Markdown
Owner

Closes #38
Closes #39

为什么

DCP 6.0.0 treated ordinary file, directory and agent reference markers as unknown content and skipped pruning until those markers left history. Retained attachments on host-compacted results had the same effect. The old host loop disabled automatic compaction and reported constant low usage, so it did not cover the user's requirement that pruning remain useful without interrupting tools.

变更内容

  • Count verified non-wire user markers correctly and recognize attachments already omitted by the host's compacted-result renderer. Preserve original parts, full inputs, live-media protection and all existing pruning invariants.
  • Add public-hook and projection regressions, including negative role/payload cases and one-request forced pruning.
  • Extend the real public host suite with default automatic compaction, growing reported usage, file references, summary continuation, slow native tools and explicit cancellation. Keep the existing concurrency, model-switch and manual-summary assertions.
  • Pin the host to reviewed native-tool-settlement source 8d9972908c308da1836a004cebe27c7c23db1acc (host PR fix(session): settle native tools before compaction OpenCode-GraphAgent#539). DCP still has no session execution or cancellation control.
  • Prepare patch release 6.0.1 and document the budget boundary: protected recent content and later system/tool overhead can leave no pruning opportunity in a small window.

证据

  • Both marker and hidden-attachment regressions failed before the engine fix, then passed.
  • Node unit tests: 70 passed; typecheck and formatting passed.
  • OPENCODE_SOURCE_ROOT=/tmp/dcp-host-native-fix npm run test:host: 9 passed against the exact pin.
  • 64K default-auto scenarios: ordinary and file-reference tasks each completed 56 tools, pruning before the first native summary, then continuing through five automatic summaries. Stored tool outputs and call/result pairing remained intact.
  • 32K default protection: 40 tools completed through seven automatic summaries. This validates continuity, not a guarantee of DCP activity in every window.
  • Slow native shell: the old host aborted it before completion; the fixed host waits for exit 0 before compaction. Explicit cancellation still stops a 30-second command before its final sentinel.
  • ESM package verification passed, 33 tarball entries. Simulated model usage is test input, not a real-provider tokenizer claim.

清单

  • Local regressions and exact-pin host checks passed.
  • Independent cross-author review passed at 754ce1e: Standards 0 findings, Spec 0 findings; an independent targeted run passed 35 tests. The review is recorded on this PR.
  • Required CI and SpecGit acceptance passed at 754ce1e (specgit finish --json exit 0); PR Checks run 33835654423 succeeded.
  • Merged as 9016478; tag v6.0.1 trusted publication run 33836518914 succeeded. Official npm exact version and latest both resolve to 6.0.1. Local install integrity matches the registry and the reviewed build; isolated startup with the installed OpenCode binary initialized the 6.0.1 plugin and tool successfully. Configuration was backed up before updating the plugin reference; active processes were not restarted.

@LeXwDeX LeXwDeX changed the title fix: keep pruning through host reference markers fix: preserve dynamic pruning and verify tool continuity Sep 4, 2026
@LeXwDeX
LeXwDeX marked this pull request as ready for review September 4, 2026 04:07

@LeXwDeX LeXwDeX left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent cross-author review of commit 754ce1e20dc8ef5ffd403e1d8edee7d0f32489c2, compared with e994518dd7636eaee6cb9cbd754975a46de88f42 (master at review time). Scope: all 13 changed files, repository AGENTS/CONTRIBUTING standards, and issues #38 and #39. The reviewer authored the separate host correction and did not author these DCP changes.

Standards

0 findings. The estimator exceptions remain limited to verified host serialization behavior. Projection still changes only eligible request-local compacted markers, retains existing protections, and preserves unknown live-media fail-open behavior. Test and documentation changes accurately distinguish estimated history capacity from the final provider request.

Spec

0 findings. Verified the pinned host's message-v2.ts serialization: ordinary user text-file, directory and agent reference markers do not enter the model request; expanded text remains counted; already-compacted successful assistant tools omit only state.attachments. The new tests check immutable persistent history and normal/forced projection. Public host scenarios check pruning before the first automatic summary, original output recovery in that summary, continued tool execution, slow-shell exit 0, and explicit cancellation with the host's completed-but-aborted shell result contract.

Independent validation: node --import tsx --test tests/projection.test.ts tests/request-hooks.test.ts — 35 passed, 0 failed, 0 skipped. The complete diff and the public-host test assertions were reviewed; this review did not independently rerun the full host integration suite.

Standards: 0 findings. Spec: 0 findings. This review comment is not a CI, SpecGit, DAG, merge or release approval. Those required gates must still pass before publication.

@LeXwDeX
LeXwDeX merged commit 9016478 into master Sep 4, 2026
11 of 12 checks passed
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.

test: cover automatic compaction under context pressure fix: keep pruning through host reference markers

1 participant