Out-of-repo plugins cannot mark session events ignorable — every log they touch becomes unreadable (extensibility gap + minimal fix)
#1538
Replies: 2 comments
|
Verified against master — your analysis is exact, and this is a genuinely important extensibility gap, not a cosmetic one. Confirmation with the precise source shape: Source confirmation
append<T extends SessionEventType>(
type: T,
data: SessionEventMap[T],
...opts: T extends SurfaceEventType ? [opts: SurfaceIntent] : []
): SessionEvent<T>The opts tuple is empty for non-surface types — so Why this matters beyond your pluginThis is the same "one bad log = total outage" family as the session-corruption reports from today (#1333/#1452 seq gaps, #1473 bad first frame, #1449/#1519 serializer poisoning) — but with a twist: the plugin is writing well-formed, intentional events and the harness still refuses the whole log because it can't recognize the vocabulary. That's a worse failure mode than corruption: it's by-design extensibility colliding with by-design fail-loud unknown-type refusal. The On your two questions
One suggestion on the minimal fix: since the field is This deserves a regression test in |
argszero 已在 补一点家族价值:这是"一个坏日志 = 整段不可读"族(#1333/#1452 seq 缺口、#1473 坏首帧、#1449/#1519 serializer 污染)里的设计性变体——插件写入的是格式合法、意图明确的 event,harness 却因不识词表而拒绝整条日志( 同意 argszero 的次序:先落最小 |
Uh oh!
There was an error while loading. Please reload this page.
Out-of-repo plugins cannot mark session events
ignorable— every log they touch becomes unreadable (extensibility gap + minimal fix)Scenario
agent-teams/team-created,task-created,message-sent, …) into the captain's session log viasession.append(type, data), so the web client can fold a team tree from the log (same mechanism astool-workflow/*).KNOWN_SESSION_EVENT_TYPES.ignorable: true:session "…" contains event type "agent-teams/task-created" (seq …) unknown to this harness and not marked ignorable; refusing to interpret the log — it was likely written by a newer harness.Root cause
SessionEvent.ignorable?: trueis a documented envelope field (packages/core/session/src/types.ts) and the read path honors it — butSession.append()only acceptsSurfaceIntentopts for surface events (user/message,assistant/message,tool/result). For non-surface events — exactly the case of a plugin vocabulary — there is no public way to passignorable: true.known-event-types.tsexplicitly defers a registration surface "until such a consumer exists"; this consumer now exists.Consequence: every session a plugin touches becomes unreadable to the harness (history load +
session.listfail). Rewriting logs to inject the marker is a whack-a-mole workaround while the plugin keeps writing.Minimal fix (implemented locally, working)
packages/core/session/src/index.ts—Session.append: for non-surface events accept an optional{ ignorable?: true }opts argument and include it in the envelope (read-side validation already allows the field; ~5 lines).session.append(type, data, { ignorable: true }); verified end-to-end that new events carry the marker and logs stay readable.Questions for the team
All reactions