Conversation
b113f46 to
7475368
Compare
ktz03
left a comment
There was a problem hiding this comment.
First-pass review (Integration / DSH — compaction boundary commit)
Verdict: Right product move — covers the PreCompact-equivalent gap. LGTM from a first-pass with a couple of non-blocking notes.
What checks out
compaction/startcommits unconditionally before transcript rewrite (aligned with Claude PreCompact / docs matrix).- Honors
syncTurns/ capture gating; skipped & failed boundaries stay silent; success notices use the plugin-sourced marker and are filtered from re-capture (defense-in-depth atcapture()). - Retryable commit failures enqueue
commitSessionfor later drain; metadata read failures do not block the boundary commit. - EN/CN docs + README updated; version
0.5.8→0.5.9with lock sync; CI green. - Tests cover below-threshold commit, start-only boundary, pending-queue path, notice suppressions.
Non-blocking
keep_recent_counton the happy path:commitAtCompactionBoundarybuildscommitPayload.keep_recent_countbut the successfulcommitSession(sessionId, peerId)call does not pass it (same shape as existingturn/end). Docs say keep 10 — fine if the client default already does that; worth a one-line confirm so the compaction path cannot silently diverge later.- Version overlap: several open plugin PRs also target dsh
0.5.9(#4714 / #5393 / #5313). Whichever lands second will need a rebase bump — not a blocker for this review.
Happy to re-check if you change the commit options wiring.
|
Checked the keep-window question against head So no extra commit-options wiring appears necessary for that review point. One small description correction remains: the body still says 0.4.5, while the current package/config are 0.5.9. The next plugin PR merged may also require a fresh version bump as noted above. |
|
Thanks @r266-tech — agreed, the diff stays exactly as you verified it. Housekeeping only: corrected the PR body version string (0.4.5 → 0.5.9) so it matches the plugin |
Adversarial review results (external rollout context)Hi — before rolling the dsh memory plugin to our two production DSH instances (stable + rc), we ran an independent adversarial review of the rollout. This PR implements the boundary-commit guarantee tracked in our internal Confirms the gap this PR closes
Confirms the approach is safe
One operational note (FYI, not blocking)
From our side this is ready for final approval — thank you @ktz03 for the thorough first-pass review and the maintainers for the |
|
Thanks for the production verification. One blocker before final approval that hasn't been raised on this PR yet:
Suggested before merging:
Happy to re-review once that's addressed. |
ktz03
left a comment
There was a problem hiding this comment.
Follow-up on maintainer blocker (appendBoundaryNotice)
Agree with the compaction-window concern. My earlier first-pass LGTM covered the boundary commit path; it did not validate that DSH’s own compaction summary still writes back when a plugin user/message is appended between compaction/start and compaction/end.
From a first-pass perspective, the suggested shape looks right before merge:
- Drop the notice, or move it to after
compaction/endand keep it opt-in (default off). - Promote boundary-commit / notice failures from debug to
warnso a failed boundary is visible. - Re-verify on a real DSH session that the host compaction summary is written back.
Happy to re-review once that lands.
7475368 to
c0fa20c
Compare
…ilure logging Reviewer blocker on volcengine#5254: the boundary notice appended a plugin user/message between compaction/start and compaction/end, which broke the host's compaction summary write-back in maintainer runs. The notice now stays queued until after compaction/end AND requires the new dsh-local boundaryNotice flag (host input boundaryNotice: true or OPENVIKING_BOUNDARY_NOTICE=1); with the default, the plugin never appends around compaction. Boundary-commit permanent failures and notice-append failures now warn once per session and stage (success re-arms), carrying a bounded status/code token and never message payloads — the same warnOnce shape volcengine#5393 proposes for capture failures, so the two PRs converge. The flag is resolved in dsh config.mjs rather than the shared schema: a shared-lib edit counts as a change to every distributed plugin and would force six version bumps for a dsh-only feature.
|
Hi @t0saki, @ktz03 — thank you for catching this. You were right: appending the notice inside the compaction window was a real interaction bug, not a theoretical one, and your suggested shape is what's now on the branch. 1. Notice no longer lands inside the compaction window — and is now opt-in (default off). 2. Boundary failures now warn instead of hiding in debug. 3. Re-verified on a real DSH session with this change in place.
Also note: the branch has been rebased onto current CI is green. Ready for another look whenever you are. |
DSH appends the durable compaction/start event before summarization and then rewrites the history range, so a session that compacted below commitTokenThreshold (20000) lost every captured-but-uncommitted message: they lived only in the transcript range the compaction rewrote. The other harness integrations cover this boundary from a PreCompact hook; dsh was the only one the capability matrix documented as "None (does not listen for compaction events)". maybeCommit already runs on the session/event feed, so routing compaction/start to an unconditional commit (keep 10) covers the same boundary in-process with no harness change. A successful flush appends a user/message notice (marker "OpenViking boundary commit"; source.summary repeats the sentence for the collapsed chat row) so client-side visualization can badge it. Skipped commits, failed metadata reads and the pending-queue path stay silent, and self-sourced notices are never re-captured: the wiring-point guard now covers both the legacy `plugin` kind and the canonical `plugin:<name>` producer kind. Docs: EN/ZH capability tables, the dsh integration page and the plugin README describe the new boundary. Version 0.5.8 -> 0.5.9 (plugin-versions gate). Tests cover the boundary commit, the notice contract, the silent drop paths and the capture guard.
An append between compaction/start and compaction/end changed the session surface during summarization, so the compaction surface guard disqualified every bracket in an actively appending session. The notice is now queued at the boundary and flushed after compaction/end; the commit itself stays at compaction/start, so PT-002 provenance is unchanged. Also sync package-lock to the published 0.4.6 and release 0.4.7.
…ilure logging Reviewer blocker on volcengine#5254: the boundary notice appended a plugin user/message between compaction/start and compaction/end, which broke the host's compaction summary write-back in maintainer runs. The notice now stays queued until after compaction/end AND requires the new dsh-local boundaryNotice flag (host input boundaryNotice: true or OPENVIKING_BOUNDARY_NOTICE=1); with the default, the plugin never appends around compaction. Boundary-commit permanent failures and notice-append failures now warn once per session and stage (success re-arms), carrying a bounded status/code token and never message payloads — the same warnOnce shape volcengine#5393 proposes for capture failures, so the two PRs converge. The flag is resolved in dsh config.mjs rather than the shared schema: a shared-lib edit counts as a change to every distributed plugin and would force six version bumps for a dsh-only feature.
…n/end The capability rows, the dsh integration page and the plugin README now describe the notice as gated behind boundaryNotice (default off), appended after compaction/end rather than inside the compaction window, with warn-once failure logging. Also replaces the stale 'compaction remains invisible to the plugin' note in the dsh behavior section, which contradicted the boundary-commit rows.
compaction/end could arrive before the chained boundary commit finished, so the flush read a not-yet-queued count and silently dropped the notice; a backlogged chain could even carry the append into the next bracket, re-creating the mid-bracket append this PR exists to remove. The flush now reads and clears the queued count inside the write chain, holds the notice while a bracket is open, and skips id-stub sessions on the disposeAll path. Regression tests pin the race, the reopened bracket, and the boundary_notice warn re-arm.
5b1aea8 to
45c8907
Compare
ktz03
left a comment
There was a problem hiding this comment.
AI-assisted follow-up review. Re-reviewed 45c890732f86b9bb3a3fb8a050439f01b067259f against current main df32bf6e50a40843438f9491a26069ca4bd08f1f. The remaining integration blockers are the merge conflicts and plugin version:
- A local, non-mutating
git merge-tree --write-treereports conflicts indocs/en/agent-integrations/16-capability-reference.md,docs/en/agent-integrations/17-dsh.md, their two Chinese counterparts, andexamples/dsh-memory-plugin/{config.mjs,package.json,package-lock.json}. GitHub also reportsCONFLICTING/DIRTY. Please integrate current main and preserve its updated documentation and plugin changes while retaining the boundary behavior. - Main now has DSH 0.5.13, while this head has 0.5.12. Please choose a fresh version above the current main version and synchronize
PLUGIN_VERSION, the package manifest and both root version entries in the lockfile. The official version script currently exits 0 with0.5.13 -> 0.5.12; it checks that the strings differ, so that passing result does not establish a newer release version.
Scoped verification on this exact head, using Node 24.21.0 and the existing locked DSH dependencies:
node examples/memory-plugin-shared/sync.mjsfollowed bynode --test examples/memory-plugin-shared/sync.test.mjs: 9 passed; committed generator output remains clean.npm run check:version --prefix examples/dsh-memory-plugin: passed. All 44 top-level/shared.mjsfiles passnode --check.npm test --prefix examples/dsh-memory-plugin: 110 passed, 1 opt-in live-recall test skipped, 0 failed. This includes default-off notices, delayed notice flushing, an unfinished-commit/end race, reopened brackets, warning reset and failed-append containment.
The tracked DSH plugin files are unchanged from the previously examined 5b1aea86 to this rebased head. The notice remains opt-in and is checked inside the write chain after compaction/end; the pinned DSH Session.append() updates its log synchronously, so this path has no await between the open-bracket check and accepting the notice. I found no additional runtime blocker in this scoped pass.
I have not independently rerun real DSH compaction-summary writeback. The September 30 live-session results remain author-provided evidence, distinct from the local checks above. After resolving the conflicts and choosing the fresh version, please rerun the scoped plugin/generator checks and refresh CI on the resulting head before final maintainer review.
…ommit # Conflicts: # docs/en/agent-integrations/16-capability-reference.md # docs/en/agent-integrations/17-dsh.md # docs/zh/agent-integrations/16-capability-reference.md # docs/zh/agent-integrations/17-dsh.md # examples/dsh-memory-plugin/config.mjs # examples/dsh-memory-plugin/package-lock.json # examples/dsh-memory-plugin/package.json
… 56, no test executed)
There was a problem hiding this comment.
AI-assisted follow-up on 16e1dff8e5e27d74f02db2c50910e97efb896e00 against current main 9d9bc85e1f6a15afa7f23b0d7bf114a7c61cad14 (2026-10-03).
Thanks for confirming the earlier conflict/version fixes and identifying the live result as author-run. This revision changes only the DSH README. Its updated wording explicitly distinguishes issuing the boundary commit from server-side extraction and states that the in-process gate does not exercise the host feed or full event payload. I found no new must-fix issue in this scoped follow-up.
Current main has one subsequent commit affecting .gitattributes and the Studio build workflow, and is not an ancestor of this head. A fresh git merge-tree --write-tree against that main succeeds without conflicts; the resulting merge tree differs from the head tree. The four DSH version entries remain consistent at 0.5.15 > current main 0.5.13.
No new local test run was needed for this README-only revision: all 11 tracked production .mjs blobs, all 15 test blobs and the package/config/lock metadata are byte-identical to 5e39e329. The prior Windows / Node 24.21.0 validation belongs to that 5e39e329 snapshot: DSH 110 passed / 2 explicitly skipped / 0 failed (112 total), shared generator/distribution suite 9 passed, 45 .mjs syntax checks passed and generated tracked files remained clean. I have not independently enabled either live gate. The author's accepted task/archive identifier is useful runtime-to-server acceptance evidence; host event routing, actual compaction/summary writeback, completed archival and recall remain outside this in-process gate's assertions. Settlement readback is logged rather than asserted.
Actual official CI on this new 16e1dff8 head is 5 successful checks / 6 non-applicable checks skipped / 0 failures. Plugin checks run 37114689244 has 1482 passed / 29 skipped / 0 failed, with 22 installer tests passed; both live gates remain skipped. API/CLI run 37114689011 completed successfully: filesystem API 14 passed; basic API 54 passed / 1 skipped; released-CLI compatibility 16 passed; current-source CLI integration 25 passed / 21 skipped. The CLI skips are 19 cases without upstream API authentication, one documented timeout-parameter mismatch and one without a skill fixture; VLM/Embedding credentials were unavailable. These runs precede the subsequent main commit described above; they are current-head CI, not execution on the new merge tree. GitHub reports MERGEABLE / REVIEW_REQUIRED; final maintainer review remains pending.
Earlier snapshot and CI evidence on 27c5ed93 (retained as history):
AI-assisted follow-up review of 27c5ed934e4669333a0d23987348e1c379b66374 against current main 7e47957da87a29ae9096161af7cc80fb6f074ec4.
The two integration blockers from my previous review are addressed in this snapshot:
- Current main is included in the author branch.
git merge-tree --write-treecompletes without conflicts and returns the PR head tree; GitHub reportsMERGEABLE. - DSH is now 0.5.15, above main's 0.5.13.
PLUGIN_VERSION,package.json, and both lockfile root version entries match. The official distributed-plugin version check against this main passes. The author also chose a version above the 0.5.14 proposed in open #5567; later landing order still determines whether another bump becomes necessary.
Scoped verification on this exact head, on Windows with Node 24.21.0 and the pinned DSH 0.1.0-rc.6 dependencies:
- Shared generator output remains clean; generator/distribution suite: 9 passed.
- DSH suite: 110 passed, 1 live-recall test skipped, 0 failed. This includes default-off notices, delayed notice flushing, the unfinished-commit/end race, reopened compaction brackets, and warning re-arming.
- All 44 top-level/shared
.mjsfiles pass syntax checks; the internal package/config version check passes.
The boundary runtime, capture path, and their focused regression files are byte-identical to the previously reviewed 45c89073; the merge brought in current main's other plugin and skill changes. I found no additional runtime blocker in this scoped pass. Real DSH compaction-summary writeback remains the author's September 30 live-session evidence; I have not independently rerun that deployment, and the opt-in live-recall test remains skipped without an endpoint.
Final CI update on the same 27c5ed93 head: current main remains 7e47957d; GitHub reports MERGEABLE, with 5 successful checks, 6 non-applicable checks skipped, 0 failures. The API/CLI job completed successfully in 29m40s: filesystem API 14 passed; basic API 54 passed / 1 skipped; released-CLI compatibility 16 passed; current-source CLI integration 25 passed / 21 skipped. The CLI skips comprise 19 cases without upstream API authentication, one documented CLI/server timeout-parameter mismatch, and one without a skill fixture; VLM/Embedding credentials were unavailable, so this is the workflow's basic integration scope. The retry completed the download and CLI stages that the preceding CDN reset prevented. Final maintainer review remains pending.
verify-live.test.mjs mirrors the live-recall gate (OPENVIKING_E2E=1, skipped in CI): stages user messages as server-side pending tokens below any threshold, feeds the durable compaction/start event the way compaction-basic appends it, and asserts the boundary commit on a real server — commitSession accepted (task id + archive uri), pending_tokens drained to commit_count >= 1, no local retry-queue residue. README gains a Live verification section.
…ted, evidence format matches test output
…solate pending dir from shared harness state
…nfra race, not our diff)
…ommit # Conflicts: # docs/en/agent-integrations/16-capability-reference.md # docs/zh/agent-integrations/16-capability-reference.md
…s to what the gate proves
…ime, not routed by the host feed
…r, survival asserted not recall
…e — untouched by this diff, 3/3 green locally, 4 prior CI greens today)
…ival follows from the archive, not from write ordering
…timing race, examples/opencode-plugin, untouched by this PR; failed 2/3 recent CI runs, passed on intermediate retrigger)
|
Thank you — your follow-up review confirmed both integration blockers closed, and the numbers match our local runs exactly (including Node 24.21.0 parity: 9/9 generator suite, 112 plugin tests → 110 pass / 2 opt-in skips / 0 fail). To close the one remaining caveat: the live compaction-summary writeback is now reproducible — The branch was also re-integrated with current main (a second union merge kept the boundary documentation inside main's rewritten capability tables). The PR description has been updated to the current head (0.5.15, CI table, how-to-verify-live). Ready for final review. |
Description
The dsh memory bundle never committed at the compaction boundary — the capability matrix documented dsh as "None (does not listen for compaction events)" (§3.3.2) and "Unaware" (§3.4.1) at the time of filing (those tables have since been rewritten upstream). DSH appends the durable
compaction/startevent before summarization (compaction-basic/src/region.ts:210) and then rewrites the history range, so a session that compacted belowcommitTokenThreshold(20000) left every captured-but-uncommitted message unarchived: the capture is pushed to the server at event time, but without a commit nothing is archived or recallable, and the live transcript copy — the only copy a reader could see — was rewritten.Session.append()broadcasts every event through the Cordissession/eventfeed with no type filter, and the bundle already subscribes to it — so the fix is plugin-side only, no harness change needed.maybeCommitroutescompaction/startto a newcommitAtCompactionBoundarymirroring the PreCompact hooks of the other integrations.Human Involvement
Related Issue
Closes #5253
Type of Change
Changes Made
runtime.mjs:maybeCommitroutescompaction/starttocommitAtCompactionBoundary— unconditional commit gated by the master capture switch, serialized on the per-session write chain, 30s client timeout, retryable failures enqueue a pending-queue entry, permanent failures log and drop. Onlycompaction/startis a boundary;compaction/enddoes not commit at all — it only flushes the opt-in notice — and the threshold commit stays onturn/end.runtime.test.mjs: 20 colocated tests (16 → 36) — 9 covering the boundary-commit paths (below-threshold unconditional commit, onlycompaction/startcounts, retryable queue / permanent drop, nothing-pending silence, metadata-read resilience, server-never-ready drop, latched-outage ordering,syncTurns:falseskip) and 11 covering the opt-in boundary notice (bracket timing, end-race survival, warning re-arm, cross-repo marker text) and the synthetic-message guard.runtime-drain.test.mjs: hermeticity fix (isolatedOPENVIKING_PENDING_DIR)..gitignore: ignore*.tgzat the root — localnpm packruns during plugin testing/publishing drop tarballs that must never be committed; scoped to build artifacts, unrelated to the fix's behavior.verify-live.test.mjs(new): opt-in live gate (OPENVIKING_E2E=1) — drives the runtime against a real OpenViking server: stages messages as server-side pending tokens (no threshold is reached), asserts no commit fires before the boundary, feedscompaction/startthe waycompaction-basicappends it, and asserts the plugin'scommitSessionwas accepted with a task id and archive uri plus no local retry-queue residue. The server-side settlement (commit_count) is polled and logged as a closing confirmation, not asserted. Skipped in CI (no server secret).config.mjs: an opt-inboundaryNoticeknob (OPENVIKING_BOUNDARY_NOTICEenv, default off) — when on, the plugin appends oneuser/messagenotice aftercompaction/end, never inside the compaction window.capture.mjs: the notice markerOPENVIKING_BOUNDARY_NOTICE_MARKER("OpenViking boundary commit") is a cross-repo UI contract — thedsh-ov-vizclient module pins the same marker plus the notice's trailing phrase (client.jsBOUNDARY_MARKERand itsBOUNDARY_PATTERNregex…archived to memory), and the plugin emits that tail atruntime.mjs:342— so the contract is three-sided (marker, tail, classifier) and all sides must change together.capture.mjsalso carries the synthetic-message guard so the plugin never re-captures its own notice/context messages.PLUGIN_VERSIONandpackage.jsonagree — it does not compare against main — so the "above main" property was verified by direct semver comparison plus an additions-only scan of the open PRs touching this package (15 PRs; none proposes 0.5.15 or higher — the max is 0.5.14 in fix(plugins): strip CRLF from doctor command paths #5567).Testing
I have added tests that prove my fix is effective
New and existing unit tests pass locally
macOS (CI on ubuntu-24.04 — see the checks tab for each head); Node 24.21.0 parity verified (same numbers as Node 25: 9/9 generator suite, 112 plugin tests → 110 pass / 2 opt-in skips / 0 fail)
npm run checkexit 0 (all 45 top-level/shared.mjspassnode --check+ version check)node --test *.test.mjs: 112 tests → 110 pass, 2 skipped, 0 fail — the 2 skips are the opt-in live gates (live-recall,verify-live, bothOPENVIKING_E2E=1); the shared generator suite (examples/memory-plugin-shared/sync.test.mjs) is 9/9Live verification (author-run; not reproducible from CI, which skips it): needs
OPENVIKING_E2E=1, credentials and a reachable server with an extraction backend. Our run printedLIVE-VERIFY: PASS boundary=compaction/startwith a server-issued task id; the archive uri is asserted in the same test. The pending-token count is a per-run value (it moves with the server tokenizer) and the test asserts only that it is> 0. To run it yourself:OPENVIKING_E2E=1 node --test verify-live.test.mjs.CI on the pushed head:
plugin-tests,plugin-versions,check-depsandBuild Docspass;API & CLI Integration Testsis the long pole (~30 min) — see the checks tab for its final state on this head.Checklist