feat(kiro-desktop-session): emit STEP/LLM/TOOL spans for multi-turn ReAct (#5)#165
Open
rangemer333-cell wants to merge 1 commit into
Open
feat(kiro-desktop-session): emit STEP/LLM/TOOL spans for multi-turn ReAct (#5)#165rangemer333-cell wants to merge 1 commit into
rangemer333-cell wants to merge 1 commit into
Conversation
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.
背景
AGE-966 Kiro 桌面端 pilot plugin 采集开发:将 Kiro CDP 通道产出的对话事件接入 loongsuite-pilot,输出符合 ARMS GenAI 语义规范的 OTel trace。CDP 外挂采集模式(非 shell hook / 进程内 plugin)。
核心改动(CP5: STEP/LLM/TOOL + 多轮 ReAct)
src/inputs/kiro-desktop-session/kiro-desktop-session-input.ts— 重写为 batch 处理:按payload.executionId分组轮次,按记录顺序生成 STEP/LLM/TOOL spans;新增跨 batch 轮次状态持久化(loadTurnState/saveTurnState);tool_call 时间戳自动后移避免 0ms duration;轮次无 assistant Say 时合成 final text-only Say(过last_step_no_tool_call);TextPart 用content字段满足 schema;standalone 用户记录 attach 到下一轮 ENTRY,standalone session_event 丢弃避免 spurious ENTRY+AGENT tracetests/unit/inputs/kiro-desktop-session-input.test.ts— 新增 REACT_FIXTURE_LINES(2 轮、3 tool cycles、final Say),新增断言:3+ STEP / 3+ TOOL / 多轮 ReAct、tool.result 时间 > tool.call、step.id 共享、gen_ai.input.messages_delta / gen_ai.output.messages 非空、kiro_event_type 7 类全保留scripts/e2e/run-ide-e2e.sh— 改为两次 CDP prompt:先 ReAct 多步 prompt(触发 3 个 tool_call),再 no-tool follow-up(保证最终 STEP 是 text-only)CP1~CP3 已落(本轮未改,一并入库)
agents.d/kiro.json、scripts/e2e/kiro-cdp-chat.py、scripts/e2e/kiro-e2e-config.json— agent 定义 + CDP 操控脚本 + E2E 配置src/core/orchestrator.ts、src/flushers/otlp-trace-flusher.ts— orchestrator & OTLP flusher 增量修改文件
src/inputs/kiro-desktop-session/kiro-desktop-session-input.tstests/unit/inputs/kiro-desktop-session-input.test.tsscripts/e2e/run-ide-e2e.shscripts/e2e/kiro-cdp-chat.pyscripts/e2e/kiro-e2e-config.jsonagents.d/kiro.jsonsrc/core/orchestrator.tssrc/flushers/otlp-trace-flusher.ts准出 5 条硬门禁(详见 issue comment ba04a09b)
npx vitest run tests/unit/inputs/kiro-desktop-session-input.test.ts tests/unit/flushers→ 14 文件 / 119 用例全 PASS(Kiro 15/15 + flushers 104/104)PILOT_DATA_DIR=/tmp/pilot-kiro-age966-5 KIRO_E2E_TIMEOUT=120 bash scripts/e2e/run-ide-e2e.sh→ 产出真实 OTLP/normalized JSONL(非手工构造)Summary: 2 traces, 17 spans ✅ Pass: 64 ⚠️ Warn: 0 ❌ Error: 0 ⏭️ Skipped: 0 Verdict: PASSCloses AGE-966.