Repository navigation
Replies: 1 comment 1 reply
|
Excellent, precise analysis β I can confirm the full source chain on current Why it happens β the range selection is purely positional, not source-aware.
const regionMessages = shadowedSeqs
.map(seq => session.deriveEventMessage(session.eventAt(seq)!))
.filter(...)So The Two things I'd add beyond your suggestions, both grounded in the same seam:
On the fix direction: I'd steer toward making the compaction range/summarizer source-kind-aware via the MessageSourceMap (a Happy to help trace the precise range/shadow mechanics or test a patch if you'd like to open one against |
Uh oh!
There was an error while loading. Please reload this page.
Version: 0.1.2-rc.1, local model via llama.cpp. Related: #5420 (the
catalog re-render seen from a continuable subagent β argszero's branch (A)
there is this case) and #5524 (a report of a skill "no longer available" after
compaction). Paths are under
node_modules/@deepseek-ai/in the rc.1 install.What happens
compaction-basicselects its range from the first surface node with nosource check (
selectCompactableRange,dsh-compaction-basic/lib/index.js:381-403); the compactable universe isuser/message,assistant/message,tool/result(
dsh-session/lib/index.js:70-74). The skill catalog(
source.kind: skill-catalog) and the AGENTS.md baseline(
source.kind: agent-instructions) are ordinaryuser/messages, so theysit inside the range.
buildSummarizationInputreplays the range to the summariser as ordinaryconversation (
:651-659), so the two<system-reminder>blocks arecondensed into the checkpoint along with everything else.
dsh-tool-skill(catalogHistory,:331-348) anddsh-agent-instructions(visibleBaselineSource,:1063-1069) eachnotice their message is no longer on the surface and re-inject the full
text β the catalog as a replacement ("The available skill catalog changed.
This complete catalog replaces every earlier available-skills list",
:269) although nothing changed.Measured on one hands-off job (29 turns, 7 automatic compactions): 7 of 7
compactions were followed by an
agent-instructionsbaseline (9.4 KB) and askill-catalog {update: true}message (3.0 KB) as the first two records ofthe next step. Every compaction paid the summariser for ~12 KB it then
re-injected verbatim, and each checkpoint carries a condensed copy of text
that is also present in full one message later β twice the tokens, once
lossy. On a local model the summarise call is the most expensive thing a
session does (144β204 s each here), so what goes into it is not free.
The asymmetric case: a loaded skill body
A model-invoked
skillreturns its SKILL.md as atool/result(
dsh-tool-skill/lib/index.js:138-157): compactable, and pruned to a4,096-char head plus a 1,024-char tail once it passes 8,192 chars
(
dsh-compaction-tool-result-pruner/lib/index.js:8-14). A/nameinvocationlands as a
skill-invocationmessage (:184-195). Neither is re-injected byanything. After a compaction the model is told, by the replacement catalog,
that the skill exists β and has none of its instructions. That is the shape
of the report in #5524 (skill "not found", fallback to an ad-hoc output
format), though our own job loaded no skill, so the mechanism is read, not
the loss measured.
Suggestions
already know which messages are theirs, so a
source.restorable: true(ora plugin-declared predicate on
agent/pre-step) would letselectCompactableRangeleave them on the surface andbuildSummarizationInputleave them out of the summariser's input.catalogHistoryre-injects after a compaction, re-inject the bodies of skills loaded in the
compacted span as well (or exempt
skillresults from the pruner and therange).
what happened ("restored after compaction; entries unchanged") rather than
"changed".
How to see it
Any session with skills mounted that reaches an automatic compaction. In the
transcript, the first records after
compaction/endare auser/messagewith
source.kind: "agent-instructions"and one withsource.kind: "skill-catalog", "update": true; the shadowed range that thecheckpoint replaced includes the previous copies of both.
All reactions