System-reminder baked into same content array as the real user message #4269
Replies: 1 comment
|
Good report — I verified the injection shape against rc.2 (HEAD b150a55), and the source tells a slightly different (and more hopeful) story than "same event, same array". The gap you hit is real, but it is a documentation gap, not a shape bug.
So the discriminator plugin authors need already exists: message.source.kind — 'user' vs 'agent-instructions' vs 'skill-catalog' (plus any other plugin's own marker). A plugin can skip an event by checking the source kind instead of text-stripping, and never risk dropping the real user text.
The framing-is-caller-owned decision and the "consumers that need the distinction read the durable event log (source, meta)" guidance live in an internal agent note (.agents/notes/implemented/simplification/2026-07-20-unwrap-injected-content-envelopes.md), not in public docs. source.kind appears only incidentally in docs/subsystems/session-title.md; system-reminder only in docs/subsystems/skills.md for the skill-catalog case. There is no plugin-facing page that says "user/message events carry a source.kind; here is the table". Your strip-filter was a rational thing to build given that vacuum — and it is exactly the kind of per-plugin reinvention that a documented contract would remove.
Your local verification (guard state update, strip function unit tests) is the right instinct — with source.kind you can keep the guard logic and delete the text-stripping entirely. |
Uh oh!
There was an error while loading. Please reload this page.
Background
I'm a regular DSH user; these notes come from debugging on my own machine with an AI assistant.
Issue:
<system-reminder>injection is baked into the same content array as the real user messageagent-instructionsbakes the<system-reminder>block into the very samecontentarray of auser/messageevent as the real user text (same event, same array). Plugins that process user messages therefore cannot simply test "does the event contain an injected block" and skip the whole event — the real user text would be dropped together with the injection. They have to implement their own stripping (we do: remove thesystem-reminderblocks, then process the remainder; only skip when nothing is left).Suggestion
Document the injection shape (block markers, position in
content), or provide an official convention for stripping it, so plugin authors don't each reinvent the same filter.Local verification
Bug observed live (a whole message dropped → guard state never updated); fix verified by unit tests on the strip function and an integration test with a mixed content array.
All reactions