generic-chat adapter: strong error signals depend solely on explicit `is_error` flag — document the contract or widen detection

未关闭 适合新手
#626 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
68/100
Issue 类型
文档
描述清晰度
基本清楚
活跃度
活跃
技术栈
javascript, nodejs

调研方向

从 evolver-runtime-adapters/adapters.js 开始,重点查看 chatMessageToTurns 和 STRONG_TEXT 提取器,追踪工具失败如何变成强信号。在 generic-chat 格式文档中记录 is_error/isError 契约,包括工具结果失败和非零退出时所需的行为;可选的文本标记回退是一个独立的扩展。

由索引模型根据 Issue 内容生成。

描述

Summary

While wiring a custom runtime (Pi session v3) into evolver via the generic-chat format, auto-distill silently produced zero genes ("not enough to distill — need ≥1 strong signal") even though the session contained real tool failures.

Root cause (source-level, 2.0.30)

In evolver-runtime-adapters/adapters.js (chatMessageToTurns), turn.errorMessage is set for a role=tool message only when is_error/isError === true (or text starts with Exit code: N≠0) — the code comment states: "messages have no universal error flag, so we honor an explicit is_error/isError when the producer sets one". Meanwhile the strong-signal extractor (STRONG_TEXT = /(^|\n)\s*(Error:|Traceback|Exception|FAILED|panic:|\bexit code [1-9])/) only tests the turn's text fields. A toolResult carrying a text-prefixed failure (e.g. ERROR (tool failed): ...) sets neither errorMessage nor matches STRONG_TEXT, so the strong-signal count is always 0 and draftGeneCandidate returns null.

Fix we applied (validated end-to-end)

Our adapter now emits "is_error": true on failed toolResults and on bash executions with non-zero exit codes — after which auto-distill immediately drafts genes (2× strong/error_result + 1× success_prose). Reference implementation:
https://github.com/stwhwing/pi-evox-lab/blob/main/code/pi_session_adapter.js

Suggestion

  • Document the is_error contract explicitly in the generic-chat format docs — it is load-bearing for the entire distill path;
  • Optionally: recognize common failure markers in toolResult text (Traceback / UnicodeDecodeError / JSONDecodeError / non-zero exit codes) as a fallback, since many transcript exporters won't set the flag.

Full report: https://github.com/stwhwing/pi-evox-lab/blob/main/docs/experiment-report.md (§13)

主要语言
JavaScript
星标
9.1k
派生
848
平均合并
14 小时 39 分钟
30 天内合并 PR
1

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

EvoMap/evolver 的其他 Issue

查看 EvoMap/evolver 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。