mirror of
https://github.com/cexll/myclaude.git
synced 2026-02-09 03:09:30 +08:00
fix: 移除未知事件格式的日志噪声 (#96)
问题: - codeagent-wrapper 在处理 Claude Code 等其他后端的事件流时 - 对无法识别的事件格式(turn.started/assistant/user)打印警告日志 - 造成输出噪声,影响用户体验 修复: - parser.go:274 - 移除对未知事件的 warnFn 日志打印 - 改为静默 continue,直接跳过这些事件 - 添加注释说明这些事件来自其他后端,无需处理 测试: - 新增 parser_unknown_event_test.go 回归测试 - 验证未知事件不产生 "Agent event:" 日志 - 确保 Codex/Claude/Gemini 事件解析不受影响 - 所有测试通过 Closes #96 Generated with SWE-Agent.ai Co-Authored-By: SWE-Agent.ai <noreply@swe-agent.ai>
This commit is contained in:
@@ -271,8 +271,8 @@ func parseJSONStreamInternal(r io.Reader, warnFn func(string), infoFn func(strin
|
||||
continue
|
||||
}
|
||||
|
||||
// Unknown event format
|
||||
warnFn(fmt.Sprintf("Unknown event format: %s", truncateBytes(line, 100)))
|
||||
// Unknown event format from other backends (turn.started/assistant/user); ignore.
|
||||
continue
|
||||
}
|
||||
|
||||
switch {
|
||||
|
||||
Reference in New Issue
Block a user