Skip to content

fix(pipeline): make pipeline_init idempotent per session and emit pipeline_restarted on re-run - #201

Open
ruanzhengxin-zhuxing wants to merge 1 commit into
mainfrom
harness/a6b029db
Open

fix(pipeline): make pipeline_init idempotent per session and emit pipeline_restarted on re-run#201
ruanzhengxin-zhuxing wants to merge 1 commit into
mainfrom
harness/a6b029db

Conversation

@ruanzhengxin-zhuxing

Copy link
Copy Markdown
Collaborator

问题

同一会话(contextId)出现重复 pipeline_init 与重复 intent_parsing step_complete 记录(证据 Session:b0963f5a432c4f60ac357fbb36c8b8ef2253e91dc0c84b678d96e15d88868d90)。

根因

PipelineRunner.run() 每次被调用都无条件向 session.jsonl 追加 pipeline_init lite-meta;A2A 侧 sidecar 状态不匹配后的 fresh-run 及兜底路径会对同一 contextId 再次调用 run(),导致重复。

修复

  • run()pipeline_init 前 best-effort 检查 session.jsonl 是否已有 pipeline_init meta;
  • 已存在时改写显式 pipeline_restarted meta(reason=duplicate_pipeline_init_suppressed);
  • 读取失败按首次启动处理,不影响主流程。

预期:每条会话 pipeline_init 计数 ≤ 1,重启被 pipeline_restarted 显式标注。

测试

  • 新增 3 个单测(重复 run、预存 init meta、读取失败回退)
  • tests/pipeline 1531 passed(1 个 test_prerequisites 失败为预存问题,干净树复现)
  • tests/a2a 1432 passed;ruff + ty 通过

Ref: Aone #84289723 / Harness a6b029db

…eline_restarted on re-run

Same-contextId re-runs of PipelineRunner.run() (e.g. A2A sidecar mismatch
fresh-run paths) appended duplicate pipeline_init meta rows to session.jsonl.
Now run() checks best-effort whether the session already recorded a
pipeline_init lite-meta row; if so it records an explicit pipeline_restarted
meta with a reason instead of a duplicate pipeline_init.

Ref: Aone #84289723
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant