fix(events): mark team session events ignorable so history survives unknown readers - #7
Open
EthanHuangEbor wants to merge 1 commit into
Open
Conversation
agent-teams/* types are downstream/out-of-repo, so they are outside the harness core's known-event catalog. Mark each team event ignorable so a reader that does not recognize the type skips the informational record instead of refusing the whole session log with SessionFormatUnsupportedError. Team state is also durably persisted under .agent-teams/, so these records are safe to skip.
Owner
|
感谢贡献,问题判断是正确的。 不过官方目前还不支持通过 我们已在 18701c9 中通过跳过未知事件避免新日志损坏,因此这个 PR 暂时不需要合并。等官方提供正式接口后再采用这个方案。 |
|
harness 侧的 背景:官方 harness 的 进展:我们已在本地给 harness 的 另外 #19 的存量日志迁移工具已提交 PR(#21),旧日志可一键修复。 如果官方写入面合入,我可以接着提一个把 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix(events): mark team session events
ignorableso history survives unknown readersProblem
Any session that runs AgentTeams becomes un-loadable afterwards. Opening that
session's history fails with:
The whole session history is refused, not just the team events.
Root cause
appendTeamEventrecords team state into the captain'sSessionviasession.append(type, data)for seven custom event types:agent-teams/team-created,agent-teams/member-added,agent-teams/member-removed,agent-teams/task-created,agent-teams/task-updated,agent-teams/message-sent,agent-teams/team-deleted.These are downstream / out-of-repo types, so they are — by design — outside
the harness core's static
KNOWN_SESSION_EVENT_TYPEScatalog(
@deepseek-ai/dsh-session/known-event-types). The persistence read path(
assertEventsSupported) therefore refuses any log containing a type it doesnot recognize unless the event carries the envelope's
ignorable: truemarker.
That marker exists on the read side (
SessionEvent.ignorable), but the harnesscore's
Session.appendcurrently has no write-side support for emitting it, soour events are written as required. A reader that does not know the type then
has to refuse the entire log rather than skip the informational record.
Why
ignorableis correct hereTeam events are purely informational for the conversation tree view. The
authoritative team state is already durably persisted separately under
.agent-teams/, so losing or skipping these events can never corrupt sessionreconstruction. They are exactly the "purely informational records" the
ignorablemarker was designed for.Change
In
src/events.ts, emit every team event with the marker:Dependency
This relies on the harness core accepting
ignorableinSession.append.Today the option is silently dropped at runtime and rejected by the TypeScript
signature for non-surface types
(
...opts: T extends SurfaceEventType ? [opts: SurfaceIntent] : []). Acompanion change on the harness side is required so the marker is actually
written and type-checks. See the corresponding deepseek-harness issue.
Testing
Reproduced against a real session log containing 40
agent-teams/*events(first at seq 25009):
(
decodeStorageRecord+adoptSessionEvent+KNOWN_SESSION_EVENT_TYPES)reports 40 unsupported events → the log is refused.
ignorable, the same replay decodes all128,664 events with 0 unsupported → the log loads cleanly.
node --checkpasses on the compiled output.No behavior change for readers that do recognize the types: the web client's
agent-teamscard matches onevent.typeand still renders identically.