[Bug][gateway/internal] DSH 历史加载失败:cannot safely transform unclassified message source #6101
Replies: 2 comments 1 reply
|
补充三个定位细节,帮你在报 issue 之前先自证。 1. 抛错的不是「历史加载」这一层,所以它比看起来严重。 完整链条是三段拼接: 关键在第三段:这是观察(observe)阶段,不是「打开某个会话」的操作失败。也就是说这条会话在任何读取路径上都会失败——列表、投影、恢复都一样。按迁移契约( 2. 拒的边界正好是「消息来源 kind」三处,这也是最可能的根因。 检查只在三处触发(
守卫本身是: const SOURCE_KINDS = new Set(['user', 'plugin', 'model', 'tool', 'agent-instructions', 'session-reference',
'team-message', 'goal', 'skill-invocation', 'skill-catalog', 'coordinator', 'subagent-report',
'subagent-settled', 'webhook', 'agent-message']) // payload.ts:10
if (typeof source['kind'] !== 'string' || !SOURCE_KINDS.has(source['kind'])) {
throw new SessionFormatUnsupportedMigrationError('cannot safely transform unclassified message source')
} // payload.ts:112-113所以「unclassified」= 这 15 个之外的一个 kind 字符串,或者 3. 好消息是:修复所需的取证,你自己就能做完,不需要新版本的 dsh 去「看见」那条日志。 这一点很重要,因为现在你可能以为「打不开就查不出来」。其实这个错误故意把 offender 省掉了,而它的兄弟错误不会—— // payload.ts:50 —— 事件类型层面(event.type 不在 released 处置表里时)
throw new SessionFormatUnsupportedMigrationError(
'format v2 to v3 cannot safely transform unclassified event ' + event.type) // ← 带名字而 取证方法(只读,不解压到磁盘): cd ~/.dsh/sessions/--Users-yuzhimin-Desktop-iOS-maopao--/session-f37432fc-3819-4229-8674-cfa4477018fb/
zstd -dc session.jsonl.zstd | python3 -c '
import sys, json, collections
kinds, missing, lines = collections.Counter(), 0, 0
for n, line in enumerate(sys.stdin, 1):
lines += 1
try: ev = json.loads(line)
except Exception: continue
d = ev.get("data") or {}
msgs = []
if ev.get("type") == "user/message": msgs = [d]
elif ev.get("type") in ("assistant/message", "tool/result"): msgs = [d.get("message") or {}]
else: continue
for m in msgs:
s = m.get("source")
if not isinstance(s, dict): missing += 1; continue
k = s.get("kind")
kinds[repr(k) if not isinstance(k, str) else k] += 1
if k not in {"user","plugin","model","tool","agent-instructions","session-reference","team-message",
"goal","skill-invocation","skill-catalog","coordinator","subagent-report",
"subagent-settled","webhook","agent-message"}:
print("OFFENDER line", n, "event", ev.get("type"), "kind", repr(k), "source", json.dumps(s, ensure_ascii=False)[:200])
print("lines", lines, "missing-source", missing)
print("kinds seen:", dict(kinds))
'( 关于插件面(顺带回答可能的下一个问题):这个缺口在 |
Uh oh!
There was an error while loading. Please reload this page.
历史加载失败:failed to observe session "session-f37432fc-3819-4229-8674-cfa4477018fb": cannot safely transform unclassified message source; source v0 artifact remains unchanged (raw log: /Users/yuzhimin/.dsh/sessions/--Users-yuzhimin-Desktop-iOS-maopao--/session-f37432fc-3819-4229-8674-cfa4477018fb/session.jsonl.zstd)(gateway/internal)
dsh --version 0.1.5-rc.1
All reactions