tool-skill repeatedly emits unchanged replacement catalogs during continuable subagent turns #5420
Replies: 3 comments
|
Thanks for the precise write-up — this is very reproducible. I verified the native listener against the npm package you're running (dsh-tool-skill@0.1.1-rc.2) and against the current alpha sources (repo HEAD 0.1.2-alpha.4 and npm 0.1.2-alpha.5): the dedup logic is behaviorally identical across all three (the alpha line only refactors it — a How the listener actually decides (catalog pre-step listener +
So a replacement is emitted exactly when the guard believes the newest catalog is NOT in the current surface — which matches what you instrumented ("recently injected catalog messages are not consistently available to the next cycle's history check"). The remaining question is why the catalog drops out of (A) Genuine eviction (compaction / context trim). Re-rendering is correct by design here — the model must not keep acting from a catalog it can no longer see. A naive per-agent "same digest → never re-emit" guard would regress exactly this recovery path. (B) Surface re-anchor shadowing. If the duplicate emissions align with continuable-subagent boundaries, the continuation materializes its context by REPLACING a surface range; when that range includes the catalog event, the catalog leaves The fastest discriminator: at the pre-step where seq 55's replacement was emitted, did the assembled model context still contain the seq-10 catalog (two copies visible → the guard's inputs diverge from what the model sees), or had seq 10 already dropped out of the visible context (single visible copy per step, accumulation only in the durable log)? The replacement surface events in the transcript list their |
|
Independent measurement that adds the cache-cost side of this exact issue, from a DSH Web on Windows (deepseek-v4-flash via opencode-go), reading the same ~/.dsh/sessions zstd logs.
|
|
Standalone follow-up / sibling report (independent of the replay case above; cross-links the cache-cost angle) Title: Skill catalog updates append stale mid-stream copies that are never pruned — each update re-breaks the provider prefix cache Full report: see my earlier comment (#5420 (comment)). Short version:
Impact: one catalog update = one full re-prefix. Plugin installs/reloads that change the visible catalog dominate the miss budget in long sessions. |
Uh oh!
There was an error while loading. Please reload this page.
The native skill catalog listener republishes an identical
skill-catalogreplacement message on repeatedagent/pre-stepcycles.This becomes visible when a parent agent uses a continuable subagent such as
browser_subagent. The catalog contents do not change, but DSH emits multiple “Replacement catalog” messages, wasting context tokens.Environment
@deepseek-ai/dsh-tool-skill@0.1.1-rc.2Reproduction
browser-delegation.Actual behavior
The same catalog is emitted repeatedly as a replacement:
The session contained identical catalog entries at multiple event sequences:
10,55,175,241, and404.The catalog contents were unchanged each time.
Expected behavior
The catalog should be emitted once initially and only be replaced when its canonical skill entries actually change.
Subsequent
agent/pre-stepcycles should reuse the existing catalog without adding another replacement message.Additional findings
I instrumented both the custom capability plugin and the native DSH listener. The repeated publications came from:
The custom plugin did not publish the duplicate messages.
The issue appears related to the native listener relying on session surface/history state during repeated pre-step cycles. Recently injected catalog messages are not consistently available to the next cycle’s history check, so the listener treats the unchanged catalog as changed.
A per-agent in-memory digest guard prevents the problem.
Suggested fix
Track the last published catalog digest per agent/session, or make the durable history check include recently injected catalog messages before deciding to emit a replacement.
Do not emit a replacement when:
This should remain true across continuable subagent turns and subagent report delivery.
All reactions