Downstream plugins cannot safely persist their own Session events #802
Nunchakus888
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Summary
DeepSeek Harness explicitly encourages out-of-tree plugins, and
SessionEventMapis declaration-merge extensible. A downstream plugin can therefore compile a call such assession.append('budget/exceeded', data). The resulting Session cannot be loaded again through the standard persistence coordinator, however, because the event type is absent from the repository-generatedKNOWN_SESSION_EVENT_TYPESandSession.append()exposes no way to set the envelope'signorable: truemarker.This leaves external plugins with two choices: avoid durable domain events, or write a Session that the next Harness process refuses to open.
Audited at commit
47f943859bef60e4160492346772ded9b24f765aand npm release0.1.0-rc.6.Concrete consumer
dsh-turn-budgetis an out-of-tree policy plugin using the publicagent/pre-stepandtools/pre-executeextension points. Step and token ceilings need a durable, log-only receipt naming the applied limit, observed usage, and enforcement point. That receipt is informational: a Harness build without the plugin may skip it safely becauseturn/endandtool/resultalready preserve the canonical execution outcome.The plugin currently omits that receipt because appending it would make the persisted Session unloadable.
Reproduction
The refusal is internally consistent:
packages/core/session/src/known-event-types.tsstates that downstream events are outside the generated set and that a registration surface is deferred until a consumer exists.packages/session/session-persistence/src/coordinator.tsrejects every unknown type withoutignorable: true.SessionEventpublicly declaresignorable?: true.Session.append()accepts surface metadata only for surface events and no options for log-only events, so a downstream producer cannot set the marker through the supported write API.Expected behavior
An out-of-tree plugin should have a supported way to write a log-only event with explicit forward-compatibility semantics:
ignorable: true, allowing Harness to load the Session when the plugin is absent.Minimal API direction
The smallest useful first step is an append option restricted to downstream log-only event types:
A complete required-event path can add an effect-scoped registry later:
The persistence coordinator would accept the generated repository vocabulary plus currently registered downstream types. Removing the plugin would restore fail-closed loading for its required events. Registration must activate before Session restoration and unwind with the plugin fiber.
Why this matters
Durable domain state is a core extension path in the architecture, while the contribution guide directs external code into independent plugins. Closing this gap enables ecosystem plugins for budgets, memory, workflow audit, evaluation, and governance without weakening the existing unknown-event refusal rule.
All reactions