Replies: 3 comments
|
和 #3802 / #2778 同一条路:仓外 type 不在生成的 dsh-session-surgeon 的 若同时还有 seq gap / torn / 缺 message.id,那些可以 dry-run 修: dsh plugin --profile web add "github:xiaoshenming/dsh-session-surgeon#main" |
|
Another real out-of-repo consumer here — and as far as I can tell, the only one currently running a registration implementation in production. Adding our data points to this thread since it is the most recent formal proposal. Our consumer caseWe ship a multi-agent theater engine as a DSH plugin: scripted flows drive several subagent actors plus a director main agent, and the plugin persists presentation-only chat lines to session logs as one custom type (
Our production implementation (running since 2026-08-21)Our fork carries a ~40-line runtime registry on the session package, essentially the shape several threads have sketched: const registeredEventTypes = new Set<string>()
export function registerSessionEventType(type: string): () => void {
registeredEventTypes.add(type)
return () => { registeredEventTypes.delete(type) }
}
export function isKnownSessionEventType(type: string): boolean {
return KNOWN_SESSION_EVENT_TYPES.has(type) || registeredEventTypes.has(type)
}
Six days of production use, zero issues attributable to the registry itself. What a week of production adds to the design discussion
What we would contributeOnce the team lands on a direction — an envelope-level skippable field with an append option (as #1538 sketched), a type registration seam, a session-header manifest of plugin types, or something else — we are happy to prepare the PR, contribute our registry as reference, and run validation against our real sessions on an alpha branch. |
Current-master update and a concrete SDD consumerI am adding another out-of-repo consumer, with an important refinement to the original proposal. I reviewed the current design on Consumer caseWe are specifying an external Spec-Driven Development engine plugin. Its project state is Git-shareable and authoritative under This produces both required semantics:
Consequently, a registration API that only adds arbitrary strings to a process-local “known” set is not sufficient. Optional versus required semantics must be explicit and durable; otherwise the same stored bytes can silently acquire different meaning under a different plugin composition. Requested foundationA safe external-event extension would provide:
This does not request restoring the old call-site This refines the earlier consumer report in #802 and the registration proposal in this thread with a use case that needs both optional and required external records. |
Uh oh!
There was an error while loading. Please reload this page.
Summary
When an external / downstream Cordis plugin appends custom event types to a session (for example, a reasoning router recording
reasoning-router/initial-consult), the live interaction works as expected. However, upon reopening the session or inspecting history viasessionPersistence.load/inspect, DSH refuses to read the session log with aSessionFormatUnsupportedError.This renders previous session history completely inaccessible to users in the Web UI:
Background & Context
In
packages/core/session/src/known-event-types.tsanddocs/subsystems/persistence.md, the design rationale notes:And in
packages/session/session-persistence/src/coordinator.ts:Now that the Cordis plugin ecosystem is actively growing with real-world plugins (such as LLM reasoning routers, verifiers, and multi-agent workflows), real consumers requiring custom
SessionEventlogging have emerged.Technical Challenges with Current Workarounds
When external plugins currently attempt to declare and register events:
When running via
tsx(which executes TypeScript source trees directly) alongside pre-compiled dependencies innode_modules/, mutating a locally importedKNOWN_SESSION_EVENT_TYPESSetonly affects the copy within that specific package's bundle. The persistence coordinator in the runtime tree reads from its own module instance, causing the registration to be missed.There is currently no formal Cordis service API on
SessionStore(e.g.ctx.sessions.registerEventType(...)or declarative plugin manifests) to register custom event types cleanly during lifecycle boot.Proposed Solutions
Provide a method on
SessionStoreorContext(e.g.ctx.sessions.registerEventType(name: string, options?: { ignorable?: boolean })) allowing plugins to register custom vocabulary duringapply(ctx).Store the runtime
KNOWN_SESSION_EVENT_TYPESset using a process-wide Symbol (e.g.globalThis[Symbol.for('@deepseek-ai/dsh-session/known-event-types')]), ensuring that registrations across different package copies and TSX/CJS/ESM boundaries stay synchronized.ignorableGuidance / Helper:Provide clear utilities or default conventions for plugins emitting purely advisory / non-structural records so they can easily set
ignorable: trueat write time (Session.append).Benefits
All reactions